﻿/* ==========================================================================
   开单通 · 进销存管理软件  设计系统与界面样式
   ========================================================================== */

:root {
  --bg: #f3f5fb;
  --bg-2: #eef2f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e6eaf3;
  --line-2: #d8deeb;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --primary-soft: #eef4ff;
  --primary-ink: #1e40af;
  --ok: #059669;
  --ok-soft: #e8f8f1;
  --warn: #d97706;
  --warn-soft: #fef4e6;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --purple: #7c3aed;
  --purple-soft: #f2edff;
  --sidebar: #0b1220;
  --sidebar-2: #131d31;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 8px 28px rgba(15, 23, 42, .07);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, .18);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ 布局 ------------------------------ */
#app { height: 100vh; }
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #0b1220 0%, #101a2c 60%, #0b1220 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 40;
  transition: transform .32s var(--ease-out), width .32s var(--ease-out);
}
.sidebar::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(600px 200px at 20% -10%, rgba(37, 99, 235, .35), transparent 60%);
  pointer-events: none;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
  position: relative; z-index: 1;
}
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(59, 130, 246, .45);
  flex: 0 0 auto;
}
.brand-logo svg { width: 21px; height: 21px; }
.brand-logo img { width: 100%; height: 100%; border-radius: 9px; display: block; object-fit: cover; }
.brand-text { line-height: 1.2; }
.brand-name { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { color: #64748b; font-size: 11px; letter-spacing: 1px; }

.nav { flex: 1; overflow-y: auto; padding: 6px 10px 20px; position: relative; z-index: 1; }
.nav::-webkit-scrollbar-thumb { background: #1e293b; background-clip: content-box; }
.nav-group-title {
  font-size: 10.5px; color: #475569; letter-spacing: 1.5px;
  padding: 11px 10px 4px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 10px;
  color: #94a3b8; cursor: pointer; user-select: none;
  position: relative; margin-bottom: 2px;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav-item svg { width: 21px; height: 21px; flex: 0 0 21px; opacity: .9; }
.nav-item span { font-size: 16px; }
.nav-item:hover { background: rgba(148, 163, 184, .1); color: #e2e8f0; transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, .28), rgba(37, 99, 235, .06));
  color: #fff;
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: #60a5fa; box-shadow: 0 0 12px #3b82f6;
}
.nav-item .badge-dot {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 10px; border-radius: 10px; padding: 0 6px; line-height: 16px;
}
.sidebar-foot {
  padding: 12px 14px; border-top: 1px solid rgba(148, 163, 184, .12);
  font-size: 11.5px; color: #64748b; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sidebar-foot .ver { color: #475569; }

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

.topbar {
  height: 62px; flex: 0 0 62px;
  background: #fff;
  backdrop-filter: none;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  position: relative; z-index: 30;
}
.topbar h1 { font-size: 17px; font-weight: 650; letter-spacing: .2px; }
.topbar .sub { color: var(--ink-3); font-size: 12px; margin-left: 2px; }
.topbar-spacer { flex: 1; }

.ask-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 6px 5px 14px;
  width: 330px; max-width: 40vw;
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease), width .3s var(--ease);
}
.ask-box:focus-within { border-color: #bfd3ff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); width: 380px; }
.ask-box svg { width: 16px; height: 16px; color: var(--ink-3); flex: 0 0 16px; }
.ask-box input {
  border: 0; background: transparent; outline: none; flex: 1; min-width: 0; font-size: 13px;
}
.ask-box button {
  border: 0; background: var(--primary); color: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; cursor: pointer;
  transition: transform .15s var(--ease), background .2s var(--ease);
}
.ask-box button:hover { background: var(--primary-2); }
.ask-box button:active { transform: scale(.96); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none !important; }
@media (max-width: 860px) { .menu-btn { display: grid !important; } }

.user-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px;
  border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: #fff;
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.user-chip:hover { box-shadow: var(--shadow-sm); border-color: var(--line-2); }
.avatar {
  flex: 0 0 auto;
  width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #3b82f6); color: #fff; font-size: 12px; font-weight: 700;
  line-height: 1;
}
.user-chip .uname { font-size: 13px; font-weight: 600; white-space: nowrap; }
.user-chip .urole { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 20px 22px 40px;
  scroll-behavior: smooth;
}
.page { max-width: 1560px; margin: 0 auto; animation: pageIn .34s var(--ease-out) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.page-head .desc { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.page-head .grow { flex: 1; }

/* ------------------------------ 卡片 ------------------------------ */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card.hoverable:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14px; font-weight: 650; }
.card-head .grow { flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.stat {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease-out), box-shadow .28s var(--ease-out);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .07), transparent 70%);
}
.stat .label { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 25px; font-weight: 700; letter-spacing: -.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.stat .foot { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.stat.ok .value { color: var(--ok); }
.stat.warn .value { color: var(--warn); }
.stat.danger .value { color: var(--danger); }
.stat.primary .value { color: var(--primary); }
.stat .ico {
  position: absolute; right: 14px; top: 13px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
}
.stat .ico svg { width: 17px; height: 17px; }
.stat.ok .ico { background: var(--ok-soft); color: var(--ok); }
.stat.warn .ico { background: var(--warn-soft); color: var(--warn); }
.stat.danger .ico { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: all .18s var(--ease);
  box-shadow: 0 1px 1px rgba(15, 23, 42, .03);
}
.btn:hover { border-color: #c3ccdd; background: #fbfcfe; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn.primary {
  background: linear-gradient(180deg, #3b82f6, var(--primary)); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .28);
}
.btn.primary:hover { background: linear-gradient(180deg, #4f8ef7, var(--primary-2)); }
.btn.ok { background: linear-gradient(180deg, #10b981, var(--ok)); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(5, 150, 105, .25); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f5c9c9; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn.lg { height: 42px; padding: 0 22px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------ 表单 ------------------------------ */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.input, .select, .textarea {
  height: 36px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: #fff; outline: none; width: 100%;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  font-size: 13.5px;
}
.textarea { height: auto; padding: 9px 11px; min-height: 76px; resize: vertical; line-height: 1.6; }
.input:hover, .select:hover, .textarea:hover { border-color: #c3ccdd; }
.input:focus, .select:focus, .textarea:focus {
  border-color: #93b4fb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); background: #fff;
}
.input[disabled], .select[disabled] { background: var(--bg-2); color: var(--ink-3); cursor: not-allowed; }
.input.sm, .select.sm { height: 30px; font-size: 12.5px; padding: 0 8px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; padding-right: 30px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; cursor: pointer;
  transition: background .24s var(--ease);
}
.switch span::before {
  content: ""; position: absolute; width: 17px; height: 17px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: transform .24s var(--ease-out);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(17px); }

/* ------------------------------ 表格 ------------------------------ */
.table-wrap { overflow: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--list-font-size, 13px); }
table.tbl th {
  position: sticky; top: 0; z-index: 2;
  background: #f8fafc; text-align: left; font-weight: 600; color: var(--ink-2);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: inherit;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid #f1f4fa; vertical-align: middle; overflow-wrap: anywhere; }
table.tbl td > * { min-width: 0; max-width: 100%; }
table.tbl tbody tr { transition: background .15s var(--ease); }
table.tbl tbody tr:hover { background: #f8fbff; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.mid, table.tbl th.mid { text-align: center; }
table.tbl.compact td, table.tbl.compact th { padding: 7px 9px; }
table.tbl tfoot td { background: #f8fafc; font-weight: 650; border-top: 1px solid var(--line); }
.tbl-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ------------------------------ 标签 ------------------------------ */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--bg-2); color: var(--ink-2); line-height: 19px; white-space: nowrap;
}
.tag.sale { background: #eaf1ff; color: #1d4ed8; }
.tag.sale_return { background: var(--warn-soft); color: var(--warn); }
.tag.purchase { background: var(--ok-soft); color: var(--ok); }
.tag.purchase_return { background: var(--danger-soft); color: var(--danger); }
.tag.gift { background: #fff1e6; color: #c2410c; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.muted { background: var(--bg-2); color: var(--ink-3); }
.tag.primary { background: var(--primary-soft); color: var(--primary-ink); }

/* ------------------------------ 弹窗 ------------------------------ */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .42);
  /* 必须高于 .designer-overlay(200)：设计器里也要能弹窗 */
  z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .12s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
  width: 560px; max-width: 100%; max-height: calc(100vh - 60px);
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .28s var(--ease-out) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal.wide { width: 920px; }
.modal.xwide { width: 1180px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { font-size: 15.5px; font-weight: 650; }
.modal-head .grow { flex: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: #fcfdff; }
.modal-foot .grow { flex: 1; }

.drawer-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .35); animation: fadeIn .18s var(--ease) both; }
.drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: 720px; max-width: 94vw;
  background: #fff; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: drawerIn .3s var(--ease-out) both;
}
@keyframes drawerIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ------------------------------ 提示 ------------------------------ */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 860px) {
  /* 手机上提示条挪到顶部下方，别盖住搜索框 */
  .toasts { top: 64px; width: calc(100vw - 20px); }
}
.toast {
  display: flex; align-items: center; gap: 8px;
  background: #0f172a; color: #fff; padding: 9px 16px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .3s var(--ease-out) both;
  max-width: 80vw;
}
@media (max-width: 860px) {
  /* 手机上长提示别挤成一条：放宽、允许换行、往下挪一点，别盖住顶部输入框 */
  .toast {
    max-width: calc(100vw - 24px); border-radius: 14px; line-height: 1.5;
    font-size: 13px; padding: 10px 14px; text-align: left;
  }
}
.toast.ok { background: #065f46; }
.toast.err { background: #991b1b; }
.toast.warn { background: #92400e; }
.toast.out { animation: toastOut .26s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.97); } }
.toast svg { width: 15px; height: 15px; }

/* ------------------------------ 加载 ------------------------------ */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, .18); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, #eef2f8 25%, #f7f9fd 50%, #eef2f8 75%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 50px; color: var(--ink-3); font-size: 13px; }

.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty svg { width: 54px; height: 54px; opacity: .5; margin-bottom: 10px; }
.empty p { font-size: 13px; }
.empty .hint { font-size: 12px; margin-top: 4px; color: #b6c0cf; }

/* ------------------------------ Tab ------------------------------ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 8px 14px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; border-radius: 9px 9px 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.tab:hover { background: var(--bg-2); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 650; background: var(--primary-soft); }

/* ------------------------------ 开单界面 ------------------------------ */
.inv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.inv-main { min-width: 0; }
.inv-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; }

.picker { position: relative; }
.picker-input {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.picker-input:focus-within { border-color: #93b4fb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); }
.picker-input input { border: 0; outline: none; flex: 1; min-width: 0; font-size: 14px; background: transparent; }
.picker-input svg { width: 17px; height: 17px; color: var(--ink-3); }
.picker-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; padding: 5px;
  animation: popIn .18s var(--ease-out) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }
.picker-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer;
}
.picker-item.active { background: var(--primary-soft); }
.picker-item:hover { background: var(--bg-2); }
.picker-item.active:hover { background: var(--primary-soft); }
.picker-item .pi-main { flex: 1; min-width: 0; }
.picker-item .pi-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .pi-meta { font-size: 11.5px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; }
.picker-item .pi-price { font-size: 13.5px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

.items-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.items-table th {
  background: #f8fafc; padding: 8px 8px; font-size: 12px; color: var(--ink-2); font-weight: 600;
  border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap;
}
.items-table td { padding: 5px 8px; border-bottom: 1px solid #f1f4fa; vertical-align: middle; }
.items-table tr.gift td { background: #fffbf5; }
.items-table tr.gift td:first-child { box-shadow: inset 3px 0 0 #fb923c; }
.items-table input, .items-table select {
  height: 31px; border: 1px solid transparent; border-radius: 7px; background: transparent;
  width: 100%; padding: 0 6px; font-size: 13px; outline: none;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.items-table input:hover, .items-table select:hover { border-color: var(--line-2); background: #fff; }
.items-table input:focus, .items-table select:focus { border-color: #93b4fb; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .09); }
.items-table input.num { text-align: right; font-variant-numeric: tabular-nums; }
.items-table .amount-cell { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.items-table .del-cell { width: 38px; text-align: center; }
.items-table .del-btn {
  width: 26px; height: 26px; border-radius: 7px; border: 0; background: transparent;
  color: #cbd5e1; cursor: pointer; display: grid; place-items: center;
  transition: all .16s var(--ease);
}
.items-table .del-btn:hover { background: var(--danger-soft); color: var(--danger); }
.items-table tr.row-in { animation: rowIn .26s var(--ease-out) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.totals-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 14px; border-top: 1px solid var(--line); background: #fbfcff;
}
.totals-bar .t-item { font-size: 12.5px; color: var(--ink-3); }
.totals-bar .t-item b { display: block; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 1px; }
.totals-bar .t-item.big b { font-size: 24px; color: var(--primary); }
.totals-bar .grow { flex: 1; }

.chip-tabs { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 2px; }
.chip-tab {
  padding: 5px 13px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--ink-2);
  transition: all .2s var(--ease); border: 0; background: transparent;
}
.chip-tab.active { background: #fff; color: var(--primary); font-weight: 650; box-shadow: var(--shadow-sm); }

/* ------------------------------ 图表 ------------------------------ */
.chart { width: 100%; overflow: visible; }
.chart .grid-line { stroke: #eef2f8; stroke-width: 1; }
.chart .axis-label { fill: #94a3b8; font-size: 10.5px; }
.chart .bar { transition: opacity .2s var(--ease); }
.chart .bar:hover { opacity: .8; }
.chart .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .12; }
.chart .dot { r: 3; transition: r .16s var(--ease); }
.chart .dot:hover { r: 5; }

.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.rank-no {
  width: 21px; height: 21px; border-radius: 7px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; background: var(--bg-2); color: var(--ink-3); flex: 0 0 21px;
}
.rank-row:nth-child(1) .rank-no { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank-row:nth-child(2) .rank-no { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.rank-row:nth-child(3) .rank-no { background: linear-gradient(135deg, #fdba74, #f97316); color: #fff; }
.rank-row .r-main { flex: 1; min-width: 0; }
.rank-row .r-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .r-sub { font-size: 11.5px; color: var(--ink-3); }
.rank-row .r-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-bar { height: 4px; border-radius: 4px; background: var(--bg-2); margin-top: 4px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #60a5fa, #3b82f6); transition: width .6s var(--ease-out); }

/* ------------------------------ 其他 ------------------------------ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.search-input { position: relative; display: flex; align-items: center; }
.search-input svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
.search-input .input { padding-left: 33px; width: 240px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 4px 0; font-size: 12.5px; color: var(--ink-3); }
.pager .btn { min-width: 32px; padding: 0 8px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.w100 { width: 100%; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.scroll-y { overflow-y: auto; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.hl { color: var(--primary); font-weight: 650; }
.nowrap-num { font-variant-numeric: tabular-nums; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.hint-box {
  background: var(--primary-soft); border: 1px solid #dbe7ff; color: var(--primary-ink);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; line-height: 1.6;
}
.hint-box.warn { background: var(--warn-soft); border-color: #fbe3bd; color: #92400e; }
.hint-box.danger { background: var(--danger-soft); border-color: #f8cfcf; color: #991b1b; }
.hint-box.ok { background: var(--ok-soft); border-color: #c9efdf; color: #065f46; }

/* ------------------------------ 登录 ------------------------------ */
.login-wrap {
  height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden;
}
.login-hero {
  background: linear-gradient(140deg, #0b1220 0%, #17233b 45%, #0d1626 100%);
  color: #e2e8f0; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; padding: 60px;
}
.login-hero::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .38), transparent 65%);
  top: -140px; left: -120px; animation: float 12s ease-in-out infinite;
}
.login-hero::after {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, .3), transparent 65%);
  bottom: -160px; right: -100px; animation: float 15s ease-in-out infinite reverse;
}
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(24px, -24px); } }
.login-hero .inner { position: relative; z-index: 1; max-width: 520px; }
.login-hero h1 { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1.16; margin-bottom: 14px; }
.login-hero h1 em { font-style: normal; background: linear-gradient(90deg, #60a5fa, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { color: #94a3b8; font-size: 14.5px; line-height: 1.9; }
.login-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; }
.login-feature {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px;
  background: rgba(148, 163, 184, .08); border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 12px; font-size: 12.5px; color: #cbd5e1; backdrop-filter: blur(4px);
}
.login-feature svg { width: 16px; height: 16px; color: #60a5fa; flex: 0 0 16px; margin-top: 2px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.login-form { width: 100%; max-width: 356px; animation: pageIn .5s var(--ease-out) both; }
.login-form h2 { font-size: 25px; font-weight: 750; margin-bottom: 6px; }
.login-form .sub { color: var(--ink-3); font-size: 13.5px; margin-bottom: 26px; }
.login-form .input { height: 44px; font-size: 14px; }
.login-form .btn { height: 44px; font-size: 15px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.8; }
.login-tip code { background: var(--bg-2); padding: 1px 6px; border-radius: 5px; color: var(--ink-2); }

/* ------------------------------ 手机端 ------------------------------ */
.mobile-tabbar { display: none; }
@media (max-width: 1080px) {
  .inv-layout { grid-template-columns: 1fr; }
  .inv-side { position: static; }
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  /* 行内 repeat(auto-fit,minmax(...)) 栅格在窄屏一律单列，避免横向溢出 */
  .grid[style*="minmax("] { grid-template-columns: minmax(0, 1fr) !important; }
  .grid.c2, .grid.c3, .grid.c4, .grid.auto { grid-template-columns: minmax(0, 1fr); }
  .inv-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .form-row { grid-template-columns: 1fr !important; }
  .field { min-width: 0 !important; }
  .field > * { min-width: 0 !important; max-width: 100%; }
  .page-head, .page-head > div, .flex, .toolbar { min-width: 0; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .items-table { min-width: 620px; }
  .inv-main, .inv-side { min-width: 0; }
  .main, .content, .page { max-width: 100%; min-width: 0; }
  .topbar .sub { display: none; }
  .topbar { gap: 6px; }
  .topbar h1 { font-size: 15px; }
  .topbar .select { width: 106px !important; font-size: 12px; padding: 0 22px 0 7px; background-position: right 6px center; }
  .topbar > div:first-of-type { min-width: 0; flex: 1 1 auto; }
  .topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-shell { flex-direction: column; height: auto; min-height: 100vh; min-width: 0; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-104%);
    width: 250px; flex-basis: 250px; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .sidebar-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 39; animation: fadeIn .12s var(--ease) both; }
  .main { height: auto; overflow: visible; }
  .topbar { padding: 0 12px; gap: 8px; height: 56px; flex-basis: 56px; position: sticky; top: 0; }
  .topbar h1 { font-size: 15.5px; }
  .ask-box { display: none; }
  .content { padding: 12px 12px 90px; overflow: visible; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .grid.auto { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .modal, .modal.wide, .modal.xwide { width: 100%; }
  .drawer { width: 100%; }
  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: #fff;
    border-top: 1px solid var(--line); padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  }
  .mobile-tabbar .mt-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 5px 0; font-size: 10.5px; color: var(--ink-3); cursor: pointer; border-radius: 8px;
  }
  .mobile-tabbar .mt-item svg { width: 20px; height: 20px; }
  .mobile-tabbar .mt-item.active { color: var(--primary); background: var(--primary-soft); }
  .stat .value { font-size: 21px; }
  .user-chip .uname, .user-chip .urole { display: none; }
  .search-input .input { width: 100%; }
  .toolbar { gap: 8px; }
  .items-table { font-size: 12.5px; }
  .items-table th, .items-table td { padding: 4px 5px; }
}
@media (max-width: 520px) {
  .page-head h2 { font-size: 17px; }
  .card-body { padding: 12px; }
  .stat { padding: 12px; }
  .stat .value { font-size: 19px; }
  .kv { grid-template-columns: 76px 1fr; }
}

/* 动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 打印 */
@media print {
  .sidebar, .topbar, .mobile-tabbar, .no-print { display: none !important; }
  body, .content { overflow: visible; background: #fff; }
  .print-frame { position: fixed; inset: 0; border: 0; width: 100%; height: 100%; }
}
.print-frame { width: 100%; height: calc(100vh - 150px); border: 1px solid var(--line); border-radius: 12px; background: #fff; }


/* ==========================================================================
   电子表格（开单明细）· 单价弹层 · 全局字体调节
   ========================================================================== */
.sheet-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--list-font-size, 13px); }
.sheet-grid thead th {
  position: sticky; top: 0; z-index: 2;
  background: #eef2f8; color: var(--ink-2); font-weight: 600; font-size: inherit;
  padding: 8px 8px; border-bottom: 1px solid var(--line-2); border-right: 1px solid #e9eef6;
  white-space: nowrap; text-align: left;
}
.sheet-grid thead th.num { text-align: right; }
.sheet-grid thead th.mid { text-align: center; }
.sheet-grid tbody td {
  padding: 0; border-bottom: 1px solid #eef2f8; border-right: 1px solid #f3f6fb;
  height: 46px; vertical-align: middle; background: #fff;
}
.sheet-grid tbody tr:nth-child(even) td { background: #fbfcff; }
.sheet-grid tbody tr:hover td { background: #f5f9ff; }
.sheet-grid tbody tr.active-row td { background: #eaf2ff; }
.sheet-grid tbody tr.active-row td.gutter { box-shadow: inset 3px 0 0 var(--primary); }
.sheet-grid tbody tr.gift td { background: #fffaf3; }
.sheet-grid tbody tr.gift.active-row td { background: #fdf1e3; }

.sheet-grid td.gutter { width: 66px; }
.row-ops { display: flex; align-items: center; justify-content: center; gap: 3px; height: 46px; }
.row-no { min-width: 20px; text-align: center; color: var(--ink-3); font-size: 12px; }
.mini-btn {
  width: 18px; height: 18px; line-height: 1; border-radius: 6px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink-2); font-size: 12px; cursor: pointer; padding: 0;
  opacity: 0; transition: opacity .15s var(--ease), background .15s var(--ease);
}
.sheet-grid tbody tr:hover .mini-btn, .sheet-grid tbody tr.active-row .mini-btn { opacity: 1; }
.mini-btn:hover { background: var(--primary-soft); border-color: #bfd3ff; color: var(--primary); }

.sheet-grid .cell-input, .sheet-grid .cell-select {
  width: 100%; height: 44px; border: 1px solid transparent; border-radius: 0; background: transparent;
  padding: 0 9px; font-size: 13px; outline: none; color: inherit;
}
.sheet-grid .cell-input:hover, .sheet-grid .cell-select:hover { background: rgba(37,99,235,.04); }
.sheet-grid .cell-input:focus, .sheet-grid .cell-select:focus {
  background: #fff; border-color: #93b4fb; box-shadow: inset 0 0 0 1px #93b4fb; border-radius: 4px;
}
.sheet-grid .cell-input.num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet-grid .cell-input, .sheet-grid .cell-select { font-size: inherit; }
.sheet-grid .cell-select { appearance: none; padding-right: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center; background-size: 13px; }
.sheet-grid td.name-cell { padding: 4px 9px; cursor: pointer; user-select: none; }
.sheet-grid .cell-main { display: flex; align-items: center; gap: 6px; }
.sheet-grid .pname { font-weight: 600; font-size: inherit; }
.sheet-grid .cell-sub { display: flex; gap: 8px; font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.sheet-grid td.num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 10px; }
.sheet-grid td.mid { text-align: center; }
.sheet-grid td .mono { font-weight: 600; }

/* 单价弹层 */
.price-pop {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); width: 306px; overflow: hidden;
  animation: popIn .16s var(--ease-out) both;
}
.price-pop .pop-title { padding: 9px 12px; font-size: 12.5px; font-weight: 700; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.price-pop .pop-row { display: grid; grid-template-columns: 76px 92px 1fr; gap: 6px; align-items: center; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f3f6fb; }
.price-pop .pop-row:hover { background: var(--primary-soft); }
.price-pop .pop-row.disabled { opacity: .5; cursor: default; }
.price-pop .pop-label { font-size: 12.5px; color: var(--ink-2); }
.price-pop .pop-val { font-size: 13px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.price-pop .pop-hint { font-size: 11px; color: var(--ink-3); text-align: right; }
.price-pop .pop-foot { padding: 7px 12px; font-size: 11px; color: var(--ink-3); background: #fcfdff; }

/* 全局字体调节 */
/* 全局缩放：用 zoom 才能真正放大/缩小所有元素（含写死 px 的组件） */
body { letter-spacing: var(--ui-ls, 0px); font-weight: var(--ui-fw, 400); zoom: var(--ui-scale, 1); }
#app, .app-shell { height: var(--ui-vh, 100vh); }
@media (max-width: 860px) { #app, .app-shell { height: auto; min-height: var(--ui-vh, 100vh); } }
html.contrast-soft { --ink-2: #5b6472; --ink-3: #8d97a6; --line: #e9edf5; }
html.contrast-strong { --ink: #050c1a; --ink-2: #333e52; --ink-3: #6b7688; --line: #d6dced; --line-2: #c3ccdd; }
html.density-compact .card-body { padding: 12px; }
html.density-compact .sheet-grid tbody td { height: 38px; }

@media (max-width: 860px) {
  .sheet-grid { min-width: 760px; }
  .mini-btn { opacity: 1; }
  .price-pop { width: 280px; }
}


/* 权限平铺列表 */
.perm-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.perm-group { background: var(--bg-2); padding: 6px 12px; font-size: 12px; font-weight: 700; color: var(--ink-2); border-top: 1px solid var(--line); }
.perm-group:first-child { border-top: 0; }
.perm-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; border-bottom: 1px solid #f3f6fb; font-size: 13px; }
.perm-row:hover { background: #f8fbff; }
.perm-row.disabled { opacity: .6; cursor: default; }
.perm-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.perm-row .perm-name { flex: 1; }
.perm-row .perm-key { font-size: 11px; color: var(--ink-3); font-family: monospace; }


/* ==========================================================================
   可视化打印模板设计器
   ========================================================================== */
.designer-overlay {
  position: fixed; inset: 0; z-index: 200; background: #eef1f7;
  display: flex; flex-direction: column; animation: fadeIn .18s var(--ease) both;
}
.designer-top {
  height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line);
}
.designer-top .grow { flex: 1; }
.designer-body { flex: 1; display: grid; grid-template-columns: 226px minmax(0,1fr) 288px; min-height: 0; }
.designer-palette { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; padding: 10px; }
.designer-props { background: #fff; border-left: 1px solid var(--line); overflow-y: auto; padding: 12px; }
.designer-canvas { overflow: auto; padding: 22px; display: flex; justify-content: center; align-items: flex-start; }
.designer-sheet {
  width: 740px; min-height: 900px; background: #fff; border-radius: 4px;
  box-shadow: 0 12px 40px rgba(15,23,42,.14); padding: 30px 34px;
  font-family: "Microsoft YaHei", sans-serif; color: #111; font-size: 12px;
}
.panel-title { font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 6px 4px; }
.panel-title.small { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.palette-block {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; margin-bottom: 5px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font-size: 12.5px;
  color: var(--ink-2); transition: all .15s var(--ease); text-align: left;
}
.palette-block:hover { border-color: #bfd3ff; background: var(--primary-soft); color: var(--primary-ink); }
.palette-block svg { width: 15px; height: 15px; }
.pb-icon { display: grid; place-items: center; }
.field-palette { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 2px 8px; }
.palette-field {
  padding: 3px 8px; border-radius: 7px; border: 1px dashed var(--line-2); background: #fff;
  font-size: 11.5px; color: var(--ink-2); cursor: grab; user-select: none; transition: all .15s var(--ease);
}
.palette-field:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.palette-field:active { cursor: grabbing; }

.ds-block {
  position: relative; margin: 3px -10px; padding: 5px 10px; border-radius: 6px;
  border: 1px dashed transparent; transition: border-color .15s var(--ease), background .15s var(--ease);
}
.ds-block:hover { border-color: #cbd7ee; background: rgba(37,99,235,.03); }
.ds-block.selected { border-color: var(--primary); background: rgba(37,99,235,.06); }
.ds-block.drop-target { border-color: #22c55e; background: rgba(34,197,94,.1); }
.ds-tools {
  position: absolute; top: -10px; left: 4px; right: 4px; display: none; align-items: center; gap: 3px;
  background: var(--primary); color: #fff; border-radius: 6px; padding: 1px 5px; font-size: 10.5px; z-index: 3;
}
.ds-block:hover .ds-tools, .ds-block.selected .ds-tools { display: flex; }
.ds-tools .grow { flex: 1; }
.ds-tools .mini-btn {
  opacity: 1; width: 16px; height: 16px; border: 0; background: rgba(255,255,255,.2); color: #fff;
  border-radius: 4px; font-size: 11px; line-height: 1;
}
.ds-tools .mini-btn:hover { background: rgba(255,255,255,.35); }
.ds-tools .ds-name { font-weight: 600; }
.ds-content { pointer-events: none; }
.ds-content .pv-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.ds-content .pv-table th, .ds-content .pv-table td { border: 1px solid #555; padding: 3px 4px; }
.ds-content .pv-table th { background: #f0f2f5; }
.ds-content .pv-table th.num, .ds-content .pv-table td.num { text-align: right; }
.ds-content .pv-table th.mid, .ds-content .pv-table td.mid { text-align: center; }
.pv-company { text-align: center; font-size: 17px; font-weight: 700; }
.pv-title { text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 5px; }
.pv-row { display: flex; flex-wrap: wrap; gap: 3px 18px; font-size: 11px; padding: 2px 0; }
.pv-row.center { justify-content: center; }
.pv-row.right { justify-content: flex-end; }
.pv-row.split { justify-content: space-between; }
.pv-row.boxed { border-top: 1px solid #333; border-bottom: 1px solid #333; padding: 4px 0; }
.pv-fld { white-space: nowrap; }

.prop-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.prop-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-bottom: 1px solid #f3f6fb; font-size: 12px; }
.prop-row:last-child { border-bottom: 0; }
.prop-row .prop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop-row .mini-btn { opacity: 1; width: 17px; height: 17px; }
.prop-row .input.sm { height: 26px; }

@media (max-width: 1100px) {
  .designer-body { grid-template-columns: 180px minmax(0,1fr) 240px; }
  .designer-sheet { width: 100%; padding: 18px; }
}
@media (max-width: 860px) {
  .designer-body { grid-template-columns: 1fr; }
  .designer-palette, .designer-props { display: none; }
  .designer-top { height: auto; flex-wrap: wrap; padding: 8px; }
}

/* 设计器顶栏自适应 + 明细名称不换行 */
.designer-top { height: auto !important; min-height: 56px; flex-wrap: wrap; padding: 8px 16px; row-gap: 6px; }
.designer-top .check, .designer-top label, .designer-top .muted { white-space: nowrap; }
.sheet-grid .cell-main { min-width: 0; }
.sheet-grid .pname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sheet-grid td.name-cell { min-width: 210px; }
.row-ops { gap: 5px; }
.sheet-grid td.gutter { min-width: 72px; }

/* ==========================================================================
   v1.2 布局与可读性：表格不折行、开单全宽布局、多选商品
   ========================================================================== */
table.tbl th, table.tbl td { white-space: nowrap; }
table.tbl td { overflow: hidden; text-overflow: ellipsis; }
table.tbl td .wrap { white-space: normal; }
table.tbl td.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
table.tbl td .cell-sub { white-space: nowrap; }

/* 经营历程：列宽固定，窄屏横向滚动而不是挤压换行 */
.history-table .tbl { min-width: 1120px; }
.history-table .tbl td, .history-table .tbl th { padding: 9px 10px; }

/* 开单页：全宽布局 + 底部操作条 */
.inv-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 14px; margin-top: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.inv-actions .grow { flex: 1; }
.totals-bar .t-item b { white-space: nowrap; }

/* 多选商品 */
.picker-item.picked { background: var(--primary-soft); }
.picker-item.picked:hover { background: #e3ecff; }
.picker-item .pi-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 860px) {
  .inv-actions { position: sticky; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 30; }
}

/* 明细表固定列宽：商品名称吃掉剩余空间，其他列严格按设置 */
.sheet-grid { table-layout: fixed; }
.sheet-grid td.name-cell, .sheet-grid th:nth-child(2) { min-width: 0; }
.sheet-grid td .cell-input, .sheet-grid td .cell-select { min-width: 0; }
.picker-counter { white-space: nowrap; }

/* ==========================================================================
   自由画布设计器（v1.3）
   ========================================================================== */
.fd-canvas { overflow: auto; padding: 14px 18px 30px; background: #e9edf5; }
.fd-stage { display: inline-grid; grid-template-columns: 34px auto; grid-template-rows: 22px auto; }
.fd-corner { grid-column: 1; grid-row: 1; }
.fd-ruler { position: relative; background: #f7f9fc; border: 1px solid var(--line); }
.fd-ruler-h { grid-column: 2; grid-row: 1; height: 22px; border-radius: 4px 4px 0 0; }
.fd-ruler-v { grid-column: 1; grid-row: 2; width: 34px; border-radius: 4px 0 0 4px; }
.fd-ruler .fd-tick { position: absolute; font-size: 9px; color: #8a94a6; }
.fd-ruler-h .fd-tick { top: 3px; transform: translateX(-50%); }
.fd-ruler-v .fd-tick { left: 3px; transform: translateY(-50%); }
.fd-row { grid-column: 2; grid-row: 2; display: flex; }
.fd-sheet {
  position: relative; background: #fff; box-shadow: 0 10px 30px rgba(15,23,42,.16);
  border-radius: 0 0 3px 3px; overflow: hidden;
}
.fd-margin { position: absolute; border: 1px dashed #cbd5e1; pointer-events: none; }
.fd-el {
  position: absolute; box-sizing: border-box; cursor: move; user-select: none;
  font-family: "Microsoft YaHei", sans-serif; color: #111; line-height: 1.35;
  display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden;
  border: 1px dashed transparent;
}
.fd-el:hover { border-color: #b9c7e4; background: rgba(37,99,235,.03); }
.fd-el.sel { border-color: var(--primary); background: rgba(37,99,235,.06); z-index: 5; }
.fd-el .lb { color: #444; }
.fd-el .vl { font-weight: 600; }
.fd-el.fd-table { display: block; white-space: normal; }
.fd-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
.fd-table th, .fd-table td { border: 1px solid #444; padding: 1.2px 3px; }
.fd-table th { background: #f0f2f5; font-weight: 600; }
.fd-table tfoot td { font-weight: 600; }
.fd-handle { position: absolute; width: 8px; height: 8px; background: #fff; border: 1.5px solid var(--primary); border-radius: 2px; z-index: 6; }
.fd-handle.e { right: -4px; top: 50%; margin-top: -4px; cursor: ew-resize; }
.fd-handle.s { bottom: -4px; left: 50%; margin-left: -4px; cursor: ns-resize; }
.fd-handle.se { right: -4px; bottom: -4px; cursor: nwse-resize; }
.prop-grid { display: grid; grid-template-columns: 30px 1fr 30px 1fr; gap: 6px 6px; align-items: center; font-size: 12px; }
.prop-grid label { color: var(--ink-3); }
.prop-grid .input.sm { height: 28px; }

/* 设计器顶栏不要再被固定高度挤掉；属性面板加宽 */
.designer-overlay .designer-top { flex: 0 0 auto !important; height: auto !important; min-height: 56px; }
.designer-body { grid-template-columns: 226px minmax(0,1fr) 330px !important; }
.designer-props .prop-grid { grid-template-columns: 36px 1fr 40px 1fr; row-gap: 8px; }
.designer-props .prop-grid .input.sm, .designer-props .prop-grid select.input.sm { width: 100%; }
.designer-props .prop-row { gap: 5px; }
.designer-props .field { margin-bottom: 10px; }

/* 顶栏一行排开，放不下就横向滚动，不再折成三行 */
.designer-overlay .designer-top { flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; align-items: center; }
.designer-overlay .designer-top > .grow { flex: 1 1 auto; min-width: 16px; }
.designer-overlay .designer-top > .flex:last-child { flex: 0 0 auto; flex-wrap: nowrap !important; }
.designer-overlay .designer-top .check { white-space: nowrap; }

/* 属性面板：成对输入框，标签+输入各占一半，不挤 */
.prop-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.prop-pairs > label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.prop-pairs > label > span { flex: 0 0 auto; }
.prop-pairs > label > .input, .prop-pairs > label > select { flex: 1 1 auto; min-width: 0; }

/* ==========================================================================
   商品选择窗口（管家婆式：左分类树 + 右表格多选）
   ========================================================================== */
.pp-wrap { display: grid; grid-template-columns: 200px minmax(0,1fr); gap: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pp-side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 6px 0; max-height: 62vh; overflow: auto; }
.pp-cat {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; border-radius: 6px; margin: 0 6px;
}
.pp-cat:hover { background: #fff; }
.pp-cat.active { background: #fff; color: var(--primary); font-weight: 650; box-shadow: var(--shadow-sm); }
.pp-main { min-width: 0; background: #fff; }
.pp-main .tbl { margin: 0; }
.pp-main tbody tr { cursor: pointer; }
.pp-main tbody tr.picked { background: var(--primary-soft); }
.pp-main tbody tr.active-row td { box-shadow: inset 0 0 0 9999px rgba(37,99,235,.05); }
@media (max-width: 860px) {
  .pp-wrap { grid-template-columns: 1fr; }
  .pp-side { max-height: 130px; border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ==========================================================================
   多标签页（打开过的页面留一个标签，可切换 / 关闭 / 一键关闭）
   ========================================================================== */
.tabstrip {
  display: flex; align-items: center; gap: 6px; padding: 6px 18px 0 18px;
  overflow-x: auto; overflow-y: hidden; background: var(--bg-2);
  border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.tabstrip::-webkit-scrollbar { height: 4px; }
.tab-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 12px;
  background: #fff; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 9px 9px 0 0; font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; position: relative; top: 1px;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.tab-item:hover { color: var(--primary); }
.tab-item.active { background: var(--bg); color: var(--primary); font-weight: 650; border-color: var(--line); box-shadow: 0 -2px 0 var(--primary) inset; }
.tab-label { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.tab-close {
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px; border-radius: 4px;
}
.tab-close:hover { background: var(--danger-soft); color: var(--danger); }
.tab-closeall {
  margin-left: auto; border: 1px solid var(--line); background: #fff; color: var(--ink-3);
  font-size: 12px; padding: 4px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  position: sticky; right: 0;
}
.tab-closeall:hover { color: var(--danger); border-color: var(--danger-soft); }
@media (max-width: 860px) { .tabstrip { display: none !important; } }

/* ==========================================================================
   开单界面：管家婆式抬头（两行内联字段）+ 底部合计条
   ========================================================================== */
.inv-head .card-body { padding: 12px 14px; }
.inv-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 0; }
.inv-lb { flex: 0 0 auto; min-width: 62px; text-align: right; font-size: 12.5px; color: var(--ink-2); }
.inv-fld { flex: 0 0 150px; min-width: 0; }
.inv-fld.grow { flex: 1 1 220px; }
.inv-fld .input, .inv-fld select { width: 100%; height: 34px; }
.inv-hint { padding: 2px 0 0 70px; }
.inv-hint .hint { font-size: 11.5px; }

/* 底部合计条 */
.totals-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line); background: #fff; }
.totals-bar .t-item { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--ink-3); }
.totals-bar .t-item b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.totals-bar .t-item.big b { font-size: 19px; color: var(--primary); }
.inv-actions { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.inv-actions .grow { flex: 1; }

@media (max-width: 860px) {
  .inv-lb { min-width: 54px; }
  .inv-fld { flex: 1 1 120px; }
}

/* 含税方式这一格要宽一点，三个 chip 不能挤成竖排 */
.inv-fld.wide { flex: 0 0 330px; }
.chip-tab { white-space: nowrap; }
.inv-fld.wide .input.sm { width: 64px !important; }

/* 抬头重排：每格固定宽度，五行对齐，不再一根输入框拉到底 */
.inv-head .inv-row { gap: 6px 10px; }
.inv-lb { min-width: 58px; font-size: 12.5px; }
.inv-fld { flex: 0 0 132px; }
.inv-fld.party { flex: 0 0 300px; }
.inv-fld.wide { flex: 0 0 322px; }
.inv-head .inv-row .input, .inv-head .inv-row select { height: 32px; font-size: 13px; }

/* 明细工具条 */
.inv-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inv-toolbar .grow { flex: 1; }

/* 空行样式（还没选商品的行） */
.sheet-grid tbody tr.empty-row td { background: #fff; }
.sheet-grid tbody tr.empty-row .cell-main { color: var(--ink-3); }
.sheet-grid tbody tr.empty-row .cell-main:hover { color: var(--primary); }

/* 付款按钮用黑色底，跟收款（蓝）区分 */
.btn.dark { background: #1f2937; border-color: #111827; color: #fff; }
.btn.dark:hover { background: #111827; }
.btn.dark:active { background: #0b1220; }

/* 含税标记 */
.tag.tax { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; font-weight: 700; }

/* 开单页：底部保存条常驻可见；页面头更紧凑 */
.inv-actions {
  position: sticky; bottom: 0; z-index: 20;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(15,23,42,.06);
  margin: 12px -18px -18px -18px; padding: 12px 18px;
  border-radius: 0 0 var(--radius) var(--radius);
}
.page-head { padding-bottom: 8px; }
.page-head .desc.auto-hide { display: none; }

/* 开单页：抬头更紧凑，明细区尽量高 */
.inv-extra { padding: 4px 0 0 0; }
.inv-head .card-body { padding: 10px 14px 8px 14px; }
.inv-head .inv-row { padding: 2px 0; }
.inv-toolbar { padding: 2px 0 6px; }
#app .page { padding-bottom: 0; }
.sheet-grid tbody td { height: 42px; }

/* 表头齿轮 + 列设置面板 */
.col-gear {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; padding: 0;
  transition: all .15s var(--ease);
}
.col-gear:hover { color: var(--primary); border-color: #bfd3ff; background: var(--primary-soft); }
.col-gear svg { width: 14px; height: 14px; }

.col-pref-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid #f1f4fa; }
.col-pref-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.col-pref-key { width: 96px; font-size: 11.5px; color: var(--ink-3); font-family: monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-pref-row .input.sm { flex: 1; min-width: 0; height: 28px; }
.col-pref-row .mini-btn { opacity: 1; width: 22px; height: 22px; }

/* ==========================================================================
   左侧导航：父级 + 悬停滑出子级
   ========================================================================== */
.nav { overflow: visible; }
.nav-parent {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; margin: 3px 8px; border-radius: 10px; cursor: pointer;
  color: rgba(255,255,255,.82); font-size: 16px; user-select: none;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-parent:hover, .nav-parent.open { background: rgba(255,255,255,.1); color: #fff; }
.nav-parent.has-active { color: #fff; background: rgba(37,99,235,.28); }
.nav-parent-icon { display: grid; place-items: center; opacity: .9; }
.nav-parent-icon svg { width: 21px; height: 21px; }
.nav-parent-label { flex: 1; }
.nav-arrow { opacity: .55; font-size: 15px; transition: transform .18s var(--ease); }
.nav-parent.open .nav-arrow { transform: rotate(90deg); opacity: 1; }

.nav-flyout {
  position: absolute; left: calc(100% + 6px); top: -6px; min-width: 168px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15,23,42,.22); padding: 6px; z-index: 60;
  display: none;
}
.nav-parent.open .nav-flyout { display: block; }
.nav-flyout .nav-item {
  color: var(--ink-2); border-radius: 8px; padding: 8px 10px; margin: 0; font-size: 13px;
}
.nav-flyout .nav-item:hover { background: var(--primary-soft); color: var(--primary); }
.nav-flyout .nav-item.active { background: var(--primary); color: #fff; }
.nav-flyout .nav-item.active svg { color: #fff; }
@media (max-width: 860px) {
  .nav-flyout { position: static; display: block; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 12px; }
  .nav-flyout .nav-item { color: rgba(255,255,255,.7); }
  .nav-parent { margin: 0 8px; }
}

/* 子菜单与父级之间的鼠标桥，避免移过去就消失 */
.nav-flyout::before { content: ''; position: absolute; left: -12px; top: 0; bottom: 0; width: 12px; }
/* 点击固定后保持显示 */
.nav-parent.pinned { background: rgba(37,99,235,.32); color: #fff; }

/* 行操作两列 */
.row-ops-col { display: flex; align-items: center; justify-content: center; gap: 4px; }
.row-ops-col .del-btn { margin: 0; }

/* 开单页：合计栏并入底部固定条 */
.inv-actions {
  position: fixed; left: var(--sidebar-w, 232px); right: 0; bottom: 0;
  margin: 0; padding: 8px 20px; z-index: 40;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(15,23,42,.08);
  display: flex; align-items: center; gap: 16px; flex-wrap: nowrap; overflow-x: auto;
}
.inv-actions .totals-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: nowrap;
  border: 0; padding: 0; background: transparent; box-shadow: none;
}
.inv-actions .totals-bar .t-item { min-width: auto; }
.inv-actions .totals-bar .t-item b { font-size: 14.5px; }
.inv-actions .totals-bar .t-item.big b { font-size: 18px; }
.content { padding-bottom: 78px; }
@media (max-width: 860px) {
  .inv-actions { left: 0; padding: 8px 10px; }
  .content { padding-bottom: 132px; }
}

/* 开单页：明细卡片撑满剩余高度，表格内部滚动，一屏能看到最多行 */
.page:has(.inv-grid-card) {
  display: flex; flex-direction: column;
  height: calc(100vh - 186px);
  min-height: 420px;
  overflow: hidden;
}
.inv-grid-card { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.inv-grid-card .card-body { flex: 1 1 auto; overflow: auto; padding: 0 !important; }
.inv-grid-card .table-wrap { max-height: none; }

/* 打印预览：所见即所得 */
.print-preview-wrap { display: flex; flex-direction: column; }
.print-preview-frame {
  width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.modal.wide { max-width: 1080px; width: 92vw; }
.rowh-item { display: flex; align-items: center; gap: 6px; }
.col-drag .drag-handle { cursor: grab; color: var(--ink-3); font-size: 14px; user-select: none; }
.col-drag.dragging { opacity: .5; }
.col-drag.drag-over { border-top: 2px solid var(--primary); }

/* 型号列可点：空行提示「搜索商品」，有值时鼠标手型 */
.sheet-grid td.model-cell.pickable { cursor: pointer; }
.sheet-grid td.model-cell.pickable:hover { background: var(--primary-soft); }
.sheet-grid td.model-cell .ph { color: var(--ink-3); font-size: 12px; }
.sheet-grid td.model-cell.empty .ph::before { content: '🔍 '; font-size: 11px; }

/* 开单明细：名称/型号列是可输入搜索框，回车才搜 */
.sheet-grid td.search-cell { padding: 3px 6px !important; vertical-align: middle; }
.sheet-grid .cell-search {
  width: 100%; border: 0; background: transparent; font-size: inherit; color: var(--ink);
  padding: 2px 2px; outline: none; font-family: inherit;
}
.sheet-grid .cell-search::placeholder { color: var(--ink-3); font-size: inherit; }
.sheet-grid .cell-search:focus { background: #fff; box-shadow: 0 0 0 2px var(--primary-soft); border-radius: 4px; }
.sheet-grid td.name-cell.search-cell .cell-sub { margin-top: 0; }
.sheet-grid td.name-cell.search-cell .cell-sub:empty { display: none; }
.sheet-grid td.name-cell.search-cell .cell-sub span { font-size: 10.5px; }

/* 设计器右侧属性：输入框明确是「可编辑」的样子 */
.designer-props .input,
.designer-props select.input {
  background: #fff !important;
  border: 1px solid #94a3b8 !important;
  color: var(--ink) !important;
  font-weight: 600;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.04);
  cursor: text;
}
.designer-props select.input { cursor: pointer; }
.designer-props .input:hover { border-color: #64748b !important; }
.designer-props .input:focus,
.designer-props select.input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15) !important;
  outline: none;
}
.designer-props .prop-pairs > label > span { font-weight: 600; color: var(--ink-2); }

/* 子菜单宽一点，长名字不折行 */
.nav-flyout { min-width: 190px; }
.nav-flyout .nav-item { white-space: nowrap; }

/* 没有子级的分组（首页概览）：整条可点 */
.nav-parent.nav-direct { cursor: pointer; }
.nav-parent.nav-direct:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-parent.nav-direct.active, .nav-parent.nav-direct.has-active { background: rgba(37,99,235,.28); color: #fff; }

/* 权限分配：左侧分组 + 右侧权限项 */
.perm-split { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 12px; min-height: 320px; }
.perm-side { border-right: 1px solid var(--line); padding-right: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 56vh; overflow: auto; }
.perm-tab {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--ink-2); font-size: 13px; cursor: pointer; text-align: left; transition: all .16s var(--ease);
}
.perm-tab:hover { background: var(--bg-2); }
.perm-tab.active { background: var(--primary); color: #fff; font-weight: 600; }
.perm-tab-count { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--bg-2); color: var(--ink-3); }
.perm-tab.active .perm-tab-count { background: rgba(255,255,255,.22); color: #fff; }
.perm-tab-count.all { background: #dcfce7; color: #15803d; }
.perm-tab.active .perm-tab-count.all { background: rgba(255,255,255,.28); color: #fff; }
.perm-main { max-height: 56vh; overflow: auto; }
.perm-main-head { font-weight: 700; font-size: 13.5px; padding: 6px 4px 10px; color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 6px; }

/* 登录页：角色登录 */
.login-roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.login-role {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  color: var(--ink-2); transition: all .16s var(--ease);
}
.login-role svg { width: 17px; height: 17px; }
.login-role:hover { border-color: #bfd3ff; background: var(--primary-soft); }
.login-role.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.lr-label { font-size: 12.5px; font-weight: 600; }
.lr-desc { font-size: 10px; opacity: .7; }
.login-accounts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; min-height: 26px; align-items: center; }
.login-account {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer;
}
.login-account:hover { border-color: var(--primary); background: var(--primary-soft); }
.la-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.la-user { font-size: 10.5px; color: var(--ink-3); }
.login-role-hint { font-size: 11.5px; color: var(--ink-3); }

/* 权限勾选框：禁用时也要看得清勾没勾 */
.perm-row input[type=checkbox]:disabled { opacity: 1; }
.perm-row.disabled { opacity: .85; }
.perm-row.disabled input[type=checkbox] { accent-color: #94a3b8; }

/* 开单明细：名称/型号的输入框铺满整个单元格，不要内框 */
.sheet-grid td.search-cell { padding: 0 !important; position: relative; }
.sheet-grid td.search-cell .cell-search {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0 !important; border-radius: 0 !important; background: transparent !important;
  box-shadow: none !important; padding: 0 10px !important; margin: 0;
  font-size: inherit; color: var(--ink); outline: none; font-family: inherit;
}
.sheet-grid td.search-cell .cell-search:focus {
  background: rgba(37,99,235,.05) !important;
  box-shadow: inset 0 0 0 1px var(--primary) !important;
}
.sheet-grid td.name-cell.search-cell .cell-sub {
  position: absolute; left: 10px; bottom: 2px; right: 8px;
  pointer-events: none; font-size: 10.5px; line-height: 1.1;
}
.sheet-grid td.name-cell.search-cell.has-sub .cell-search { padding-bottom: 12px !important; }

/* 首页：客户销售排行 */
.cust-rank { display: flex; flex-direction: column; }
.cust-rank-head, .cust-rank-row {
  display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr);
  gap: 8px; align-items: center;
}
.cust-rank-head { font-size: 11.5px; color: var(--ink-3); padding: 4px 8px 8px; border-bottom: 1px solid var(--line); }
.cust-rank-head > span:not(:first-child) { text-align: right; }
.cust-rank-row { padding: 7px 8px; border-bottom: 1px solid #f1f4fa; font-size: 12.5px; }
.cust-rank-row:hover { background: var(--bg-2); }
.cr-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-sale { position: relative; text-align: right; }
.cr-sale b { position: relative; z-index: 1; }
.cr-sale i {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 18px;
  background: rgba(37,99,235,.12); border-radius: 4px; z-index: 0; max-width: 100%;
}
.cr-ret, .cr-wo { text-align: right; font-family: var(--mono); color: var(--ink-3); }
.cr-ret.has { color: var(--warn); }
.cr-wo.has { color: var(--danger); }

/* 首页：问一句卡片 */
.ask-card-row { display: flex; gap: 8px; }
.ask-card-input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; font-size: 13px;
  background: rgba(148,163,184,.14); border: 1px solid rgba(148,163,184,.28); color: #e2e8f0; outline: none;
}
.ask-card-input::placeholder { color: #64748b; }
.ask-card-input:focus { border-color: #3b82f6; background: rgba(59,130,246,.12); }
.ask-card-btn {
  padding: 0 16px; border-radius: 10px; border: 0; background: #2563eb; color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.ask-card-btn:hover { background: #1d4ed8; }

/* 库存不足的补货行：红字、整行醒目 */
.sheet-grid tbody tr.sup-row td { background: #fff5f5; }
.sheet-grid tbody tr.sup-row td.search-cell .cell-search { color: #dc2626 !important; font-weight: 700; }
.sheet-grid .row-no.sup {
  background: #dc2626; color: #fff; border-radius: 6px; padding: 1px 5px; font-size: 11px; font-weight: 700;
}


/* 顶栏万能搜索框 */
.omni {
  position: relative; display: flex; align-items: center; gap: 8px;
  width: min(460px, 40vw); height: 40px; padding: 0 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15,23,42,.05); transition: all .16s var(--ease);
}
.omni:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.omni > svg { width: 17px; height: 17px; color: var(--ink-3); flex: 0 0 auto; }
.omni input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 13.5px; color: var(--ink); font-family: inherit;
}
.omni input::placeholder { color: var(--ink-3); font-size: 12.5px; }
.omni-key {
  font-size: 10.5px; color: var(--ink-3); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; flex: 0 0 auto;
}
/* 话筒：点一下说话 */
.omni-mic, .ask-card-mic {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.omni-mic svg, .ask-card-mic svg { width: 16px; height: 16px; }
.omni-mic:hover, .ask-card-mic:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.omni-mic.mic-on, .ask-card-mic.mic-on {
  background: #ef4444; border-color: #ef4444; color: #fff;
  animation: micPulse 1s ease-in-out infinite;
}
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
.omni-list {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15,23,42,.16); padding: 5px; z-index: 200; max-height: 60vh; overflow: auto;
}
.omni.open .omni-list { display: block; }
.omni-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.omni-item.active { background: var(--primary-soft); }
.omni-item svg { width: 16px; height: 16px; color: var(--ink-2); flex: 0 0 auto; }
.omni-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.omni-title { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omni-sub { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omni-type { font-size: 10.5px; color: var(--ink-3); flex: 0 0 auto; }

/* 补货行提示 & 合计栏不被挤 */
.sheet-grid tbody tr.sup-row td { white-space: nowrap; }
.inv-actions .muted.small, .inv-actions .totals-bar + .muted { white-space: nowrap; }

/* 补货行标记：填了商品也一直显示 */
.sheet-grid .sup-tag {
  display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px;
  background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; line-height: 15px;
}
.sheet-grid td.name-cell.search-cell .cell-sub { display: flex; align-items: center; gap: 4px; }

/* 补货行：名称输入框下面留出标记的位置，别和商品名重叠 */
.sheet-grid td.name-cell.search-cell.sup-cell .cell-search { padding-bottom: 14px !important; }
.sheet-grid td.name-cell.search-cell.sup-cell .cell-sub { bottom: 1px; }

/* 表头列宽拖拽 */
.sheet-grid thead th { position: relative; }
.sheet-grid thead th .col-resizer {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 3; touch-action: none;
}
.sheet-grid thead th .col-resizer:hover { background: rgba(37, 99, 235, .35); }
body.col-resizing { cursor: col-resize !important; user-select: none; }
body.col-resizing .sheet-grid td { pointer-events: none; }

/* 全站普通列表表格：同样支持拖列宽，宽度=各列之和，右边留白 */
.tbl thead th { position: relative; }
.tbl thead th .col-resizer {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 3; touch-action: none;
}
.tbl thead th .col-resizer:hover { background: rgba(37, 99, 235, .3); }
body.col-resizing .tbl td { pointer-events: none; }

/* 顶栏「一句话」输入框：加品牌色描边 + 淡底，让人一眼看见 */
.omni {
  border: 1.5px solid #7c9cf5 !important;
  background: linear-gradient(180deg, #f5f8ff 0%, #eef4ff 100%) !important;
  box-shadow: 0 0 0 3px rgba(59, 110, 240, .10), 0 2px 10px rgba(59, 110, 240, .12) !important;
}
.omni:focus-within {
  border-color: #3b6ef0 !important;
  box-shadow: 0 0 0 4px rgba(59, 110, 240, .18), 0 4px 14px rgba(59, 110, 240, .18) !important;
  background: #fff !important;
}
.omni .omni-icon { color: #3b6ef0 !important; }
.omni input { color: #1f2a44 !important; }
.omni input::placeholder { color: #5b6b8c !important; }

/* 再强化：一句话输入框要显眼 */
.topbar .omni {
  border: 2px solid #3b6ef0 !important;
  background: #e9f1ff !important;
  box-shadow: 0 0 0 4px rgba(59, 110, 240, .16), 0 3px 12px rgba(59, 110, 240, .20) !important;
  border-radius: 12px !important;
}
.topbar .omni input { font-weight: 600 !important; }
.topbar .omni input::placeholder { color: #3b5da8 !important; font-weight: 600 !important; }
.topbar .omni svg { color: #2b57d6 !important; }

/* 弹窗自适应高度：矮屏幕也一定看得到底部按钮（保存/取消） */
.overlay { padding: 12px !important; }
.modal {
  max-height: calc(100% - 8px) !important;
  height: auto;
}
.modal .modal-body { min-height: 0; }
.modal .modal-foot { flex: 0 0 auto; background: #fff; }

/* 分类树折叠箭头 */
.cat-caret { display: inline-flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; color: var(--ink-3); padding: 0; }
.cat-caret:hover { color: var(--primary); }
.cat-caret-txt { font-size: 12px; line-height: 1; }

/* ============ 商品编辑：规格卡片重排 ============ */
.spec-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
  padding: 14px 16px 10px;
  margin-bottom: 12px;
}
.spec-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.spec-badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-ink);
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.spec-card .form-row { grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px 12px; }
.spec-card .field > label,
.spec-card label { font-size: 12px; color: var(--ink-3); }
.spec-card .input { height: 34px; }
.spec-card .divider { margin: 14px 0 10px; }
/* 单位换算 / 捆绑赠品 的小面板 */
.spec-panel {
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 10px 12px; margin-top: 10px;
}
.spec-panel-title {
  font-size: 12px; font-weight: 650; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
@media (max-width: 1100px) {
  .spec-card .form-row { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

/* 输入框收窄 + 重新排布：字段按内容宽度排，不再拉满 */
.spec-card .form-row {
  grid-template-columns: repeat(auto-fill, minmax(132px, 168px)) !important;
  gap: 12px 18px !important;
  justify-content: start;
}
.spec-card .input { width: 100%; max-width: 168px; }
.spec-card .form-row > .field { min-width: 0; }
/* 价格分级：四个价格同样收窄 */
.spec-price-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 150px));
  gap: 10px 18px; justify-content: start; margin-top: 4px;
}
.spec-price-row .input { max-width: 150px; }
/* 商品编辑弹窗顶部基础信息也收窄 */
.pe-body .form-row {
  grid-template-columns: repeat(auto-fill, minmax(180px, 240px)) !important;
  gap: 12px 20px !important;
  justify-content: start;
}
.pe-body .form-row > .field > .input,
.pe-body .form-row > .field > select { max-width: 240px; }
.pe-body .input { max-width: 240px; }
/* 单位换算 / 捆绑赠品 行也要紧凑 */
.spec-card .unit-row, .spec-card .bundle-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.spec-card .unit-row .input, .spec-card .bundle-row .input { max-width: 120px; }

/* 覆盖：规格卡片内的输入框更窄（提高优先级） */
.pe-body .spec-card .form-row {
  grid-template-columns: repeat(auto-fill, minmax(120px, 156px)) !important;
  gap: 12px 16px !important;
}
.pe-body .spec-card .form-row > .field > .input,
.pe-body .spec-card .form-row .input,
.pe-body .spec-card .input { max-width: 156px !important; }
.pe-body .spec-card .spec-head .input { max-width: 150px !important; }
.pe-body .spec-card .spec-price-row { grid-template-columns: repeat(auto-fill, minmax(110px, 140px)) !important; }
.pe-body .spec-card .spec-price-row .input { max-width: 140px !important; }
.pe-body > .form-row > .field > .input,
.pe-body > .form-row > .field > select { max-width: 220px !important; }

/* 单位选择：输入框 + 一个下拉箭头合成一体 */
.unit-picker { position: relative; display: flex; align-items: center; max-width: 168px; }
.unit-picker .input { padding-right: 30px; max-width: 168px; }
.unit-arrow {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 6px;
}
.unit-arrow:hover { background: var(--bg-2); color: var(--primary); }

/* 商品选择弹窗：名称/型号/规格 在左，单价/库存数量 在右 */
.picker-item .pi-right { text-align: right; min-width: 104px; }
.picker-item .pi-price { font-weight: 700; color: var(--primary); font-size: 14px; }
.picker-item .pi-stock { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.picker-item .pi-stock.zero { color: var(--danger); font-weight: 600; }
.picker-item .pi-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.picker-item .pi-name { font-weight: 650; }

/* 商品选择弹窗：名称 / 型号 / 规格 / 单价 / 库存 五列对齐 */
.picker-item, .picker-head {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 120px 110px 84px 96px;
  align-items: center;
  gap: 10px;
}
.picker-head {
  font-size: 11.5px; color: var(--ink-3); font-weight: 600;
  padding: 4px 10px 6px;
}
.picker-head .pr { text-align: right; }
.picker-item .pi-name { font-weight: 650; font-size: 13.5px; color: var(--ink-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .pi-model { font-size: 13px; color: var(--ink-1); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .pi-spec { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .pi-price { text-align: right; font-weight: 700; color: var(--primary); font-size: 13.5px; }
.picker-item .pi-stock { text-align: right; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.picker-item .pi-stock.zero { color: var(--danger); }

/* 选择弹窗加宽后，五列重新分配 */
.picker-item, .picker-head {
  grid-template-columns: minmax(150px, 1fr) 116px 92px 86px 96px !important;
  gap: 8px !important;
}

/* 五列在默认宽度内放得下 */
.picker-item, .picker-head {
  grid-template-columns: minmax(120px, 1fr) 92px 78px 72px 84px !important;
  gap: 6px !important;
}
.picker-item .pi-name { font-size: 13px !important; }
.picker-item .pi-model { font-size: 12.5px !important; }
.picker-item .pi-spec { font-size: 12px !important; }
.picker-head { font-size: 11px !important; }

/* 分类树：操作按钮默认隐藏，鼠标移到该行才显示，名称就能显示完整 */
.cat-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .12s var(--ease); }
.cat-row:hover .cat-acts, .cat-row.active .cat-acts { opacity: 1; }
.cat-row .cat-name { min-width: 0; }

/* 分类树：图标式层级（文件夹 + 折叠三角），不再画连接线 */
.cat-ficon { flex: 0 0 17px; width: 17px; display: grid; place-items: center; color: #93a3ba; }
.cat-ficon.open { color: var(--primary); }
.cat-chev { display: grid; place-items: center; color: #94a3b8; }
.cat-chev svg { transition: transform .16s var(--ease); }
.cat-chev.collapsed svg { transform: rotate(-90deg); }
.cat-row.cat-root { font-weight: 600; }
.cat-row[draggable="true"] { cursor: grab; }
.cat-row.dragging { opacity: .45; }
.cat-row.drop-into {
  background: var(--primary-soft) !important;
  box-shadow: inset 0 0 0 2px var(--primary);
}
.cat-drag-tip { margin-top: 8px; padding: 6px 8px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }

@media (max-width: 860px) {
  /* 手机上没有 hover，分类的操作按钮常显，否则「移动」按不到 */
  .cat-acts { opacity: 1; }
  .cat-row { padding-right: 2px !important; }
  .cat-drag-tip { display: none; }
}

/* 分类树：层级缩进收窄 + 卡片加宽，长名称能显示完整 */
.card:has(.cat-row) { min-width: 286px; }
.cat-name { font-size: 12.5px !important; }

/* 修掉分类树撑出、压到商品列表上的问题 */
.card:has(.cat-row) { min-width: 0 !important; overflow: hidden; }
.grid > .card { min-width: 0; }

/* 单位下拉：自绘菜单，只有一个箭头 */
.unit-picker { position: relative; }
.unit-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 40;
  min-width: 120px; max-height: 220px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 4px; display: none;
}
.unit-menu.open { display: block; }
.unit-opt {
  display: block; width: 100%; text-align: left; padding: 7px 10px;
  border: none; background: transparent; border-radius: 7px;
  font-size: 13px; color: var(--ink-1); cursor: pointer;
}
.unit-opt:hover { background: var(--bg-2); color: var(--primary); }
/* 去掉浏览器给 input 自带的黑色小三角 */
.unit-picker input::-webkit-calendar-picker-indicator { display: none !important; }
.unit-picker input::-webkit-list-button { display: none !important; }

/* 打印预览：铺满弹窗 */
.pp-wrap { width: 100%; }
.pp-wrap iframe { width: 100% !important; height: 64vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.modal-body:has(.pp-wrap) { padding: 12px 16px; }

/* 打印预览样式（渲染在弹窗里） */
.pp-wrap { font: 12.5px/1.6 "Microsoft YaHei", Arial; color: #111; }
.pp-wrap .pp-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px solid #222; padding-bottom: 8px; margin-bottom: 10px; }
.pp-wrap .pp-title { font-size: 19px; font-weight: 700; }
.pp-wrap .pp-sub { font-size: 12.5px; color: #555; }
.pp-wrap .pp-meta { display: flex; gap: 26px; font-size: 12.5px; margin-bottom: 10px; }
.pp-wrap table.pp-tb { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pp-wrap table.pp-tb th, .pp-wrap table.pp-tb td { border: 1px solid #9aa3b2; padding: 6px 8px; word-break: break-all; }
.pp-wrap table.pp-tb th { background: #f3f5f9; font-weight: 650; }
.pp-wrap table.pp-tb .c { text-align: center; }
.pp-wrap table.pp-tb .r { text-align: right; }
.pp-wrap .pp-sum { text-align: right; font-size: 14px; font-weight: 700; margin-top: 10px; }
.pp-wrap .pp-note { margin-top: 12px; font-size: 12.5px; color: #333; }
.pp-wrap .pp-tip { margin-top: 16px; font-size: 11.5px; color: #8a8f98; }

/* 打印预览：强制铺满弹窗正文 */
.modal-body > .pp-wrap { flex: 1 1 100% !important; width: 100% !important; align-self: stretch !important; min-width: 0 !important; }
.modal-body > .pp-wrap table { width: 100% !important; }
.pp-wrap .pp-doc { width: 100%; }

/* ---------------- 设计器：条码 / 二维码 / 图片 ---------------- */
.fd-el.fd-code { display: flex; flex-direction: column; gap: 2px; padding: 2px; overflow: hidden; }
.fd-el.fd-code .fd-bars { flex: 1 1 auto; display: flex; align-items: stretch; gap: 1px; min-height: 0; }
.fd-el.fd-code .fd-bars span { background: #222; display: block; height: 100%; }
.fd-el.fd-code .fd-qr {
  flex: 1 1 auto; min-height: 0; align-self: center; height: 100%; aspect-ratio: 1 / 1;
  background: repeating-conic-gradient(#222 0% 25%, #fff 0% 50%) 0 0 / 25% 25%;
  border: 1px solid #333;
}
.fd-el.fd-code .fd-code-tip {
  font-size: 9px; line-height: 1.2; color: #475569; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto;
}
.fd-el.fd-image { display: flex; align-items: center; justify-content: center; }
.fd-el.fd-image img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ==========================================================================
   打印设计器：功能区（按管家婆那套「分组菜单 + 左侧工具栏 + 带区」重排）
   ========================================================================== */
.dg-title {
  height: 48px; flex: 0 0 48px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; background: #fff; border-bottom: 1px solid var(--line);
}
.dg-title .grow { flex: 1; }

.dg-ribbon { background: #fff; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.dg-groups { display: flex; overflow-x: auto; padding: 0 6px; }
.dg-group { display: flex; flex-direction: column; padding: 5px 10px 0; border-right: 1px solid #eef1f6; }
.dg-group:last-child { border-right: 0; }
.dg-group-btns { display: flex; align-items: center; gap: 4px; min-height: 38px; }
.dg-group-cap { text-align: center; font-size: 11px; color: #8a94a6; padding: 1px 0 4px; }

.dg-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px;
  border-radius: 7px; border: 1px solid transparent; background: transparent;
  color: var(--ink-2); font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.dg-btn svg { width: 15px; height: 15px; }
.dg-btn:hover:not(:disabled) { background: #f1f5fb; border-color: #e3eaf5; }
.dg-btn.primary { background: var(--primary); color: #fff; }
.dg-btn.primary:hover:not(:disabled) { background: var(--primary-ink); }
.dg-btn.danger { color: #c02626; }
.dg-btn:disabled { opacity: .4; cursor: not-allowed; }
.dg-btn.icon-only { width: 30px; padding: 0; justify-content: center; }

.dg-sep { width: 1px; height: 20px; background: #e8edf4; margin: 0 3px; }
.dg-input { height: 28px; width: 58px; border: 1px solid var(--line); border-radius: 7px; padding: 0 6px; font-size: 12.5px; }
.dg-unit { font-size: 11px; color: #94a3b8; margin-left: -2px; }
.dg-select { height: 28px; border: 1px solid var(--line); border-radius: 7px; padding: 0 4px; font-size: 12px; max-width: 176px; }
.dg-color { width: 28px; height: 28px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }

.dg-tools { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; padding: 8px 6px; }
.dg-tools-cap { font-size: 11px; color: #94a3b8; text-align: center; padding: 8px 0 4px; }
.dg-tool {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: #334155; font-size: 11.5px; cursor: pointer;
}
.dg-tool:hover { background: var(--primary-soft); border-color: #dbe6ff; color: var(--primary-ink); }
.dg-tool-icon { display: grid; place-items: center; }
.dg-tool-icon svg { width: 18px; height: 18px; }

.dg-body { grid-template-columns: 86px minmax(0, 1fr) 300px; }

/* 画布上的带区提示 */
.fd-band-line { position: absolute; left: 0; right: 0; border-top: 1px dashed #b9c6da; pointer-events: none; }
.fd-band-tag {
  position: absolute; right: 6px; transform: translateY(-50%); z-index: 6;
  font-size: 10px; color: #64748b; background: rgba(255,255,255,.92);
  border: 1px solid #dfe6f0; border-radius: 4px; padding: 1px 5px; pointer-events: none;
}

/* 字段选择器 */
.field-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; max-height: 52vh; overflow: auto; }
.field-pick {
  text-align: left; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 12.5px; cursor: pointer;
}
.field-pick:hover { border-color: #bfd3ff; background: var(--primary-soft); color: var(--primary-ink); }

/* ==========================================================================
   全站表格统一：隔行浅蓝底 + 明显竖线（更接近 Excel / WPS 的阅读体验）
   ========================================================================== */
table.tbl thead th {
  background: #eef4fd;
  border-right: 1px solid #d7e2f2;
  border-bottom: 1px solid #cbd9ee;
}
table.tbl tbody td { border-right: 1px solid #e7eef9; }
table.tbl thead th:last-child,
table.tbl tbody td:last-child { border-right: 0; }
table.tbl tbody tr:nth-child(even) td { background: #f5f9ff; }
table.tbl tbody tr:hover td { background: #eaf3ff; }
table.tbl tfoot td { background: #eef4fd; }

.sheet-grid thead th {
  background: #eaf2fd;
  border-right: 1px solid #cfdcef;
  border-bottom: 1px solid #c6d6ea;
}
.sheet-grid tbody td { border-right: 1px solid #e2eaf6; border-bottom: 1px solid #e8eef7; }
.sheet-grid thead th:last-child,
.sheet-grid tbody td:last-child { border-right: 0; }
.sheet-grid tbody tr:nth-child(even):not(.gift):not(.sup-row):not(.active-row) td { background: #f4f8ff; }
.sheet-grid tbody tr:hover:not(.gift):not(.sup-row):not(.active-row):not(.empty-row) td { background: #eaf3ff; }
.sheet-grid tbody tr.active-row td { background: #e2eeff; }

/* 明细列设置：显示中文列名，不用英文 key */
.col-pref-key { width: 110px; font-family: inherit; font-size: 12.5px; color: var(--ink-2); }


/* 登录页：员工名单（姓名 + 职位），取代原来写死的角色块 */
.login-people { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.login-person {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; min-width: 116px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.login-person:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(59,110,240,.14); }
.login-person .lp-avatar {
  width: 26px; height: 26px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary);
}
.login-person .lp-avatar svg { width: 15px; height: 15px; }
.login-person .lp-main { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.login-person .lp-name { font-size: 13px; font-weight: 650; color: var(--ink-1); }
.login-person .lp-role { font-size: 11px; color: var(--ink-3); }

/* ================= 手机端适配（<=860px） ================= */
@media (max-width: 860px) {
  /* 顶部与页面留白收紧 */
  .page-head { padding: 10px 12px 4px !important; }
  .page-head h2 { font-size: 18px !important; }
  .page-head .desc { font-size: 12px !important; }

  /* 表单一行一个，输入框加大好点 */
  .form-row { grid-template-columns: 1fr !important; gap: 10px !important; }
  .input, select.input, textarea.input { min-height: 42px !important; font-size: 15px !important; }

  /* 明细表格：容器横向滚动，表格保持完整列宽，不被压扁 */
  .table-wrap, .inv-grid-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  table.tbl { min-width: 760px; font-size: 13px; }
  table.tbl th, table.tbl td { padding: 8px 6px !important; white-space: nowrap; }

  /* 底部操作条固定住，按钮加大，单手能点 */
  .inv-actions {
    position: sticky !important; bottom: 0; z-index: 30;
    background: #fff; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) !important;
    box-shadow: 0 -6px 16px rgba(15, 23, 42, .10);
    flex-wrap: wrap; gap: 8px !important;
  }
  .inv-actions .btn { min-height: 44px; font-size: 15px; padding: 0 16px; flex: 1 1 auto; }

  /* 卡片间距收紧，避免一屏只剩一个卡片 */
  .card { border-radius: 12px; }
  .card-body { padding: 12px !important; }

  /* 标签页 / 分段按钮更好点 */
  .chip-tab, .tab-item { min-height: 38px; }
  .btn.sm { min-height: 34px; }
}

/* 手机上不要让整页被锁死高度，否则明细被挤没 */
@media (max-width: 860px) {
  .page:has(.inv-grid-card) { height: auto !important; min-height: 0 !important; overflow: visible !important; display: block !important; }
  .inv-grid-card { min-height: 300px; }
  .inv-grid-card .card-body { overflow: visible !important; max-height: none !important; }
  .inv-grid-card .table-wrap { max-height: none !important; }
  table.tbl { min-width: 720px; }
}

/* 手机端：明细行变卡片，每个字段前面带列名 */
@media (max-width: 860px) {
  table.sheet-grid.mcard { min-width: 0 !important; display: block; }
  table.sheet-grid.mcard thead { display: none; }
  table.sheet-grid.mcard tbody { display: block; }
  table.sheet-grid.mcard tr {
    display: block; margin: 8px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 12px; background: #fff;
  }
  table.sheet-grid.mcard td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; border: none !important; padding: 5px 0 !important; white-space: normal;
  }
  table.sheet-grid.mcard td::before {
    content: attr(data-label);
    color: var(--ink-3); font-size: 12px; font-weight: 600; flex: 0 0 62px;
  }
  table.sheet-grid.mcard td > * { flex: 1 1 auto; min-width: 0; }
  table.sheet-grid.mcard td:empty { display: none; }
}

@media (max-width: 860px) {
  table.sheet-grid.mcard tr.m-hide { display: none !important; }
}

/* ================= 手机端整体重塑（<=860px） ================= */
@media (max-width: 860px) {
  /* 1) 底部 dock 先隐藏：导航统一走左上角图标抽屉 */
  .dock { display: none !important; }

  /* 2) 抽屉式侧边导航：占满高度、可滑动、二级菜单直接展开在下面 */
  .sidebar {
    position: fixed !important; top: 0; left: 0; bottom: 0;
    width: 84vw; max-width: 320px; height: 100dvh;
    transform: translateX(-102%); transition: transform .22s var(--ease-out);
    z-index: 90; display: flex; flex-direction: column;
  }
  .sidebar.open { transform: translateX(0) !important; }
  .sidebar-mask { position: fixed; inset: 0; z-index: 89; background: rgba(15,23,42,.45); }
  .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
  .nav .flyout, .nav .submenu {
    position: static !important; display: block !important;
    box-shadow: none !important; border: none !important; background: transparent !important;
    padding-left: 12px !important;
  }

  /* 3) 内容区：整页可滚动，不再锁高度 */
  .app-shell { height: auto !important; min-height: 100dvh; overflow: visible !important; }
  .main { overflow: visible !important; height: auto !important; }
  .content, .page-scroll { overflow: visible !important; height: auto !important; }
  .page { max-width: 100% !important; padding: 10px !important; }
  .page:has(.inv-grid-card) { height: auto !important; overflow: visible !important; }

  /* 4) 列表：卡片化，避免横向穿模 */
  .table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  table.tbl { min-width: 640px; }

  /* 5) 卡片、统计块按屏宽铺满，不再两列挤 */
  .grid { grid-template-columns: 1fr !important; }
  .stat-grid, .cards { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }

  /* 6) 顶部栏：返回按钮 + 标题不换行 */
  .topbar { padding: 8px 10px !important; gap: 8px !important; }
  .topbar .page-title { font-size: 15px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .btn-back { display: inline-flex !important; }
}

/* 手机上任何两列布局都压成一列（覆盖内联 grid-template-columns） */
@media (max-width: 860px) {
  html body div.grid, html body .grid { grid-template-columns: minmax(0, 1fr) !important; }
  html body .card { min-width: 0 !important; }
  html body .card-head h3 { white-space: nowrap; }
}

/* ============ 手机端第二轮：去掉横向溢出、给 dock 留位置 ============ */
@media (max-width: 860px) {
  html, body { max-width: 100vw; overflow-x: hidden !important; }
  .app-shell, .main, .content, .page { max-width: 100vw !important; overflow-x: hidden !important; }

  /* 内容底部留出 dock 的高度，避免被遮住 */
  .content, .page { padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
  .inv-actions { bottom: calc(64px + env(safe-area-inset-bottom)) !important; }

  /* 卡片头：标题不换行，右侧操作自动换行到下一行 */
  .card-head { flex-wrap: wrap !important; row-gap: 6px !important; }
  .card-head > h3, .card-head > strong { white-space: nowrap !important; flex: 0 0 auto; }
  .card-head > .grow { min-width: 8px; }
  .card-head a, .card-head .btn, .card-head .link { white-space: nowrap !important; }

  /* 分段/标签横向滚动，不挤压 */
  .tabs, .chip-tabs, .seg { flex-wrap: nowrap !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }

  /* 顶部栏吸顶，状态栏不压字 */
  .topbar { position: sticky !important; top: 0; z-index: 40; background: #fff; }

  /* 统计卡片两列，卡片内数字不被压 */
  .grid[style*="minmax(170px"] { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}

/* ============ 手机端第三轮：表单控件不再撑破卡片 ============ */
@media (max-width: 860px) {
  .card { overflow: hidden; }
  .card-body, .form-row, .field { min-width: 0 !important; }

  /* 任何输入类控件都不能超过容器 */
  .card input, .card select, .card textarea,
  .card .input, .modal input, .modal select, .modal textarea {
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    box-sizing: border-box;
  }

  /* 一行多个控件的容器：允许换行 */
  .card .flex, .modal .flex { flex-wrap: wrap !important; }
  .card .flex > *, .modal .flex > * { min-width: 0; }

  /* 含税方式这类按钮组：可横向滑动，不撑破 */
  .card .seg, .card .tabs, .card .chip-tabs { max-width: 100% !important; }

  /* 顶部栏吸顶，滚动时始终可见 */
  .main > .topbar, .topbar { position: sticky !important; top: 0 !important; z-index: 60 !important; }
}

@media (max-width: 860px) {
  .totals-bar { flex-wrap: wrap !important; gap: 6px 12px !important; max-width: 100% !important; }
  .totals-bar .t-item { min-width: 0 !important; font-size: 12px !important; }
  .inv-actions { overflow: hidden; }
}

/* 通用表格在手机端变卡片（ui.js table() 自动加 .mcard） */
@media (max-width: 860px) {
  table.tbl.mcard { min-width: 0 !important; display: block; }
  table.tbl.mcard thead { display: none; }
  table.tbl.mcard tbody { display: block; }
  table.tbl.mcard tr {
    display: block; margin: 8px 0; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 12px; background: #fff;
  }
  table.tbl.mcard td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; border: none !important; padding: 5px 0 !important; white-space: normal;
  }
  table.tbl.mcard td::before {
    content: attr(data-label);
    color: var(--ink-3); font-size: 12px; font-weight: 600; flex: 0 0 68px;
  }
  table.tbl.mcard td > * { min-width: 0; }
  table.tbl.mcard td:empty { display: none; }
}

/* ===== 首页手机端细节修正 ===== */
@media (max-width: 860px) {
  /* 排名表：客户名占大头，金额列给够宽度 */
  .cust-rank-head, .cust-rank-row {
    grid-template-columns: minmax(96px, 1.6fr) minmax(84px, 1.1fr) 62px 56px !important;
    gap: 6px !important;
    font-size: 12px !important;
  }
  .cr-name { font-size: 12.5px !important; }
  .cr-sale b, .cr-ret, .cr-wo { font-size: 11.5px !important; }

  /* 时间段切换：一行放不下就换行，不横向滚动也不挤压 */
  .chip-tabs { flex-wrap: wrap !important; overflow: visible !important; }
  .chip-tab { padding: 5px 11px !important; font-size: 12.5px !important; }

  /* 「详细排行 →」这类链接不竖排 */
  .card-head a, .card-head .link, .card-head .btn { white-space: nowrap !important; }
}

@media (max-width: 860px) {
  /* 客户名允许折两行，比省略号更好读 */
  .cr-name { white-space: normal !important; line-height: 1.25; max-height: 2.6em; overflow: hidden; }
  .cust-rank-head > span:first-child { white-space: nowrap; }
}

/* ============ 手机端导航：图标宫格 ============ */
@media (max-width: 860px) {
  .sidebar .brand { padding: 14px 14px 8px !important; }
  .nav {
    display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px !important; padding: 10px 12px 24px !important; align-content: start;
  }
  .nav-parent, .nav-direct {
    position: static !important;
    display: flex !important; flex-direction: column; align-items: center; justify-content: center;
    gap: 7px; padding: 14px 6px !important; border-radius: 14px !important;
    background: rgba(255, 255, 255, .06) !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    min-height: 84px; text-align: center;
  }
  .nav-parent.open, .nav-parent.pinned { background: rgba(59, 110, 240, .22) !important; border-color: rgba(59,110,240,.5) !important; }
  .nav-parent-icon svg, .nav-direct .nav-parent-icon svg { width: 22px; height: 22px; }
  .nav-parent-label { font-size: 12.5px !important; line-height: 1.25; }
  .nav-arrow { display: none !important; }

  /* 二级菜单：点开的模块在下面铺满一行，两列排 */
  .nav-flyout {
    position: static !important; display: none !important;
    grid-column: 1 / -1 !important; width: 100% !important;
    margin-top: 4px; padding: 8px !important; border-radius: 12px !important;
    background: rgba(255,255,255,.06) !important; box-shadow: none !important;
    grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px;
  }
  .nav-parent.pinned .nav-flyout { display: grid !important; }
  .nav-item {
    display: flex !important; align-items: center; gap: 8px;
    padding: 10px 10px !important; border-radius: 10px !important;
    background: rgba(255,255,255,.08) !important; font-size: 13px !important;
  }
  .nav-item svg { width: 16px; height: 16px; }
}

@media (max-width: 860px) {
  /* 展开的模块占满整行，二级菜单在它下面，不压住其他图标 */
  .nav-parent.pinned {
    grid-column: 1 / -1 !important;
    flex-direction: row !important; justify-content: flex-start !important;
    align-items: center !important; gap: 10px !important; min-height: 54px !important;
    padding: 10px 14px !important; flex-wrap: wrap;
  }
  .nav-parent.pinned .nav-parent-label { font-size: 13.5px !important; font-weight: 650; }
  .nav-parent.pinned .nav-flyout { flex-basis: 100%; }
}

@media (max-width: 860px) {
  .inv-grid-card { min-height: 420px !important; }
  .inv-grid-card .table-wrap { min-height: 220px; }
  .inv-actions { padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
}

/* 版本更新提示（右下角，点刷新才消失） */
.ver-tip {
  position: fixed; right: 18px; bottom: 18px; z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 14px; border-radius: 12px;
  background: #111827; color: #fff; font-size: 13px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .35);
  animation: popIn .2s var(--ease-out) both;
}
@media (max-width: 860px) { .ver-tip { left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); justify-content: space-between; } }

/* 首页「说话开单」按钮：录音时变红闪 */
.btn.mic-cta.mic-on {
  background: #ef4444; border-color: #ef4444; color: #fff;
  animation: micPulse 1s ease-in-out infinite;
}

/* 电话开单 */
.po-top { display: flex; align-items: center; gap: 18px; }
.po-mic {
  flex: 0 0 auto; width: 92px; height: 92px; border-radius: 50%;
  border: 2px solid var(--primary); background: var(--primary-soft); color: var(--primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; font-size: 12px; font-weight: 600; transition: all .15s var(--ease);
}
.po-mic svg { width: 26px; height: 26px; }
.po-mic.on { background: #ef4444; border-color: #ef4444; color: #fff; animation: micPulse 1s ease-in-out infinite; }
.po-mic:hover { transform: translateY(-1px); }
.po-status-wrap { min-width: 0; }
.po-status { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.po-text { width: 100%; resize: vertical; font-size: 15px; line-height: 1.7; min-height: 96px; }
.po-customer { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.po-lines { display: flex; flex-direction: column; gap: 6px; }
.po-line {
  display: grid; grid-template-columns: minmax(0, 1fr) 90px 110px 100px;
  gap: 8px; align-items: center; padding: 8px 10px; border-radius: 9px;
  background: var(--bg-2); font-size: 13.5px;
}
.po-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.po-qty, .po-price { color: var(--ink-2); text-align: right; }
.po-amount { text-align: right; font-weight: 700; color: var(--primary); }
.po-total { text-align: right; font-size: 16px; font-weight: 700; margin-top: 10px; }
.po-hint { color: var(--ink-3); font-size: 12.5px; margin-top: 6px; min-height: 18px; }
.po-go { margin-left: auto; }
@media (max-width: 860px) {
  .po-top { gap: 12px; }
  .po-mic { width: 76px; height: 76px; }
  .po-line { grid-template-columns: minmax(0, 1fr) 64px 84px 74px; font-size: 12.5px; padding: 7px 8px; }
}

/* 一句话助手面板（全站一个） */
.assistant-dock {
  position: fixed; top: 74px; right: 18px; width: 460px; max-height: 76vh;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15,23,42,.22); z-index: 320;
  display: none; flex-direction: column; overflow: hidden;
}
.assistant-dock.open { display: flex; }
.ad-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.ad-title { font-size: 14px; }
.ad-status { font-size: 12px; color: var(--ink-3); }
.ad-mic, .ad-x { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ad-mic svg, .ad-x svg { width: 16px; height: 16px; }
.ad-mic.on { background: #ef4444; border-color: #ef4444; color: #fff; animation: micPulse 1s ease-in-out infinite; }
.ad-log { max-height: 96px; overflow: auto; padding: 6px 12px; display: flex; flex-direction: column; gap: 4px; }
.ad-log-item { font-size: 12.5px; color: var(--ink-2); background: var(--bg-2); border-radius: 8px; padding: 4px 8px; }
.ad-log-item.you::before { content: '你说：'; color: var(--ink-3); }
.ad-interim { padding: 0 12px 4px; font-size: 12.5px; color: var(--primary); min-height: 0; }
.ad-body { padding: 10px 12px 12px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.ad-body.busy { opacity: .55; }
.ad-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.ad-answer { font-size: 13.5px; line-height: 1.8; color: var(--ink); white-space: pre-wrap; }
.ad-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ad-chip { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.ad-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.ad-group-title { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-top: 4px; }
.ad-customer { font-size: 13.5px; font-weight: 600; }
.ad-lines { display: flex; flex-direction: column; gap: 5px; }
.ad-line { display: grid; grid-template-columns: minmax(0,1fr) 70px 92px 82px; gap: 6px; align-items: center; background: var(--bg-2); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; }
.ad-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ad-amt { text-align: right; color: var(--primary); font-weight: 700; }
.ad-total { text-align: right; font-weight: 700; font-size: 15px; }
.ad-note { font-size: 12px; color: var(--ink-3); }
.ad-error { color: #b91c1c; font-size: 13px; }
.ad-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.ad-cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.ad-card { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ad-card-l { font-size: 11.5px; color: var(--ink-3); }
.ad-card-v { font-size: 15px; font-weight: 700; }
.ad-table { font-size: 12px; }
.ad-foot { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); background: #fff; }
.ad-input { flex: 1; min-width: 0; }
@media (max-width: 860px) {
  .assistant-dock { top: auto; left: 8px; right: 8px; bottom: 72px; width: auto; max-height: 66vh; }
  .ad-log { max-height: 72px; }
}

/* 明细行「赠送」按钮 */
.del-btn.gift-btn.on { color: #b45309; background: #fffbeb; border-color: #f59e0b; }
.del-btn.gift-btn.on:hover { background: #fef3c7; }

/* 统一表格内容居中（用户要求：不再有左对齐右对齐混排） */
.tbl th, .tbl td,
.sheet-grid th, .sheet-grid td,
.pp-main th, .pp-main td { text-align: center !important; }
.sheet-grid .cell-input,
.sheet-grid .cell-search,
.sheet-grid .cell-select { text-align: center !important; }

/* 操作列：列变窄时图标等比缩小，不穿出格子 */
.sheet-grid th[data-col="op"],
.sheet-grid td .row-ops-col { white-space: nowrap; }
.sheet-grid td .row-ops-col { display: flex; align-items: center; justify-content: center; gap: 3px; width: 100%; overflow: hidden; }
.sheet-grid .row-ops-col .del-btn {
  flex: 0 1 26px; width: 26px; min-width: 14px; height: 24px; padding: 2px;
}
.sheet-grid .row-ops-col .del-btn svg { width: 100%; height: 100%; max-width: 16px; max-height: 16px; }

/* 组合商品：单品清单按列显示（名称/型号/规格/每套/放进组合） */
.kit-head, .kit-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 90px 100px 82px 74px 34px;
  gap: 8px; align-items: center;
}
.kit-head { font-size: 12px; color: var(--ink-3); padding: 6px 0; border-bottom: 1px solid var(--line); }
.kit-head .mid { text-align: center; }
.kit-head span:nth-child(4), .kit-head span:nth-child(5) { text-align: center; }
.kit-row { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kit-row .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 一句话助手：接电话开单按钮 */
.ad-call { white-space: nowrap; margin-right: 6px; }
.ad-call.on { background: #e5484d; border-color: #e5484d; color: #fff; }

/* ------------------------- 一句话助手 · 科幻风（低饱和） ------------------------- */
#assistant-dock.assistant-dock {
  background:
    radial-gradient(130% 90% at 12% 0%, rgba(108, 160, 176, .16), transparent 52%),
    radial-gradient(90% 70% at 100% 100%, rgba(96, 133, 150, .10), transparent 60%),
    linear-gradient(165deg, rgba(10, 17, 28, .97), rgba(7, 12, 20, .98));
  border: 1px solid rgba(138, 186, 202, .26);
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(150, 205, 220, .05) inset,
    0 22px 70px rgba(0, 0, 0, .58),
    0 0 34px rgba(90, 150, 168, .12);
  color: #d7e4ee;
}
#assistant-dock.assistant-dock::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    repeating-linear-gradient(0deg, rgba(165, 210, 222, .028) 0 1px, transparent 1px 4px),
    linear-gradient(rgba(140, 190, 205, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 190, 205, .035) 1px, transparent 1px);
  background-size: auto, 26px 26px, 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.35));
}
#assistant-dock.assistant-dock::after {
  content: '';
  position: absolute; inset: 7px; pointer-events: none; z-index: 1;
  border-radius: 13px;
  background:
    linear-gradient(#8fbccc, #8fbccc) left top / 16px 1px no-repeat,
    linear-gradient(#8fbccc, #8fbccc) left top / 1px 16px no-repeat,
    linear-gradient(#8fbccc, #8fbccc) right top / 16px 1px no-repeat,
    linear-gradient(#8fbccc, #8fbccc) right top / 1px 16px no-repeat,
    linear-gradient(#8fbccc, #8fbccc) left bottom / 16px 1px no-repeat,
    linear-gradient(#8fbccc, #8fbccc) left bottom / 1px 16px no-repeat,
    linear-gradient(#8fbccc, #8fbccc) right bottom / 16px 1px no-repeat,
    linear-gradient(#8fbccc, #8fbccc) right bottom / 1px 16px no-repeat;
  opacity: .35;
}
#assistant-dock .ad-head {
  position: relative; z-index: 2;
  background: linear-gradient(90deg, rgba(34, 54, 68, .55), rgba(16, 26, 38, .18));
  border-bottom: 1px solid rgba(138, 186, 202, .20);
  padding: 11px 14px;
}
#assistant-dock .ad-title {
  color: #e4f0f6; font-weight: 700; letter-spacing: .06em;
  display: inline-flex; align-items: center; gap: 8px;
  text-shadow: 0 0 14px rgba(150, 205, 218, .22);
}
#assistant-dock .ad-title::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #8fc6c0; box-shadow: 0 0 10px rgba(143, 198, 192, .75);
  animation: sfPulse 2.4s ease-in-out infinite;
}
#assistant-dock .ad-status { color: #8ba4b4; letter-spacing: .04em; }
#assistant-dock .ad-mic,
#assistant-dock .ad-x {
  background: rgba(30, 47, 60, .55); border: 1px solid rgba(138, 186, 202, .24);
  color: #b9d0dc; border-radius: 10px; transition: all .18s ease;
}
#assistant-dock .ad-mic:hover,
#assistant-dock .ad-x:hover { border-color: rgba(160, 210, 220, .55); color: #e6f4f7; box-shadow: 0 0 14px rgba(120, 180, 195, .18); }
#assistant-dock .ad-mic.on { background: rgba(154, 76, 76, .75); border-color: rgba(206, 130, 130, .6); color: #fff; box-shadow: 0 0 18px rgba(190, 110, 110, .28); }
#assistant-dock .ad-log {
  position: relative; z-index: 2;
  background: rgba(5, 10, 17, .28);
  border-bottom: 1px solid rgba(138, 186, 202, .10);
  padding: 8px 14px;
}
#assistant-dock .ad-log-item {
  background: rgba(18, 30, 42, .72);
  border: 1px solid rgba(120, 168, 184, .12);
  border-left: 2px solid rgba(138, 198, 202, .42);
  color: #b9cbd8; border-radius: 8px;
}
#assistant-dock .ad-log-item.you::before { content: '你说：'; color: #7f97a7; }
#assistant-dock .ad-interim { color: #93c6ce; letter-spacing: .03em; }
#assistant-dock .ad-body { position: relative; z-index: 2; }
#assistant-dock .ad-hint,
#assistant-dock .ad-note { color: #8197a7; }
#assistant-dock .ad-answer { color: #d5e4ee; }
#assistant-dock .ad-customer { color: #e2eef4; }
#assistant-dock .ad-group-title { color: #8ba4b4; }
#assistant-dock .ad-lines { gap: 6px; }
#assistant-dock .ad-line {
  background: rgba(17, 29, 41, .72);
  border: 1px solid rgba(120, 168, 184, .12);
  color: #c9d9e4;
}
#assistant-dock .ad-name { color: #e0edf4; }
#assistant-dock .ad-amt { color: #9ad1c5; font-weight: 600; }
#assistant-dock .ad-total { color: #dff2ee; }
#assistant-dock .ad-cards { gap: 8px; }
#assistant-dock .ad-card {
  background: rgba(16, 27, 39, .62);
  border: 1px solid rgba(120, 168, 184, .16);
  border-radius: 11px;
}
#assistant-dock .ad-card-l { color: #8197a7; }
#assistant-dock .ad-card-v { color: #d8e8f0; }
#assistant-dock .ad-card-v small { color: #8ba4b4; }
#assistant-dock .ad-chip {
  background: rgba(20, 33, 46, .6);
  border: 1px solid rgba(120, 168, 184, .22);
  color: #a9c0cf;
}
#assistant-dock .ad-chip:hover {
  border-color: rgba(150, 205, 215, .48);
  background: rgba(120, 180, 195, .10);
  color: #def0f5;
  box-shadow: 0 0 14px rgba(120, 180, 195, .12);
}
#assistant-dock .ad-error { color: #d99b9b; }
#assistant-dock .ad-foot {
  position: relative; z-index: 2;
  background: rgba(8, 14, 23, .75);
  border-top: 1px solid rgba(138, 186, 202, .18);
}
#assistant-dock .ad-input {
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(138, 186, 202, .22);
  color: #dbe9f0;
}
#assistant-dock .ad-input::placeholder { color: #72899a; }
#assistant-dock .ad-input:focus {
  border-color: rgba(150, 205, 215, .55);
  box-shadow: 0 0 0 3px rgba(120, 180, 195, .10), 0 0 16px rgba(120, 180, 195, .10);
  outline: none;
}
#assistant-dock .ad-foot .btn.primary {
  background: rgba(108, 160, 172, .16);
  border: 1px solid rgba(150, 205, 215, .38);
  color: #dff2f5;
  box-shadow: 0 0 16px rgba(120, 180, 195, .12);
}
#assistant-dock .ad-foot .btn.primary:hover { background: rgba(108, 160, 172, .26); }
#assistant-dock .ad-call {
  background: rgba(122, 98, 62, .20);
  border: 1px solid rgba(196, 166, 118, .32);
  color: #d8c6a6;
}
#assistant-dock .ad-call.on {
  background: rgba(160, 120, 66, .30);
  border-color: rgba(206, 172, 120, .55);
  color: #f1dfc2;
  box-shadow: 0 0 18px rgba(196, 160, 100, .18);
}
#assistant-dock .ad-body .btn,
#assistant-dock .ad-actions .btn {
  background: rgba(20, 33, 46, .6);
  border: 1px solid rgba(120, 168, 184, .22);
  color: #aec5d3;
}
#assistant-dock .ad-body .btn.primary {
  background: rgba(108, 160, 172, .16);
  border-color: rgba(150, 205, 215, .38);
  color: #dff2f5;
}
#assistant-dock .ad-body .btn:hover,
#assistant-dock .ad-actions .btn:hover {
  border-color: rgba(150, 205, 215, .48); color: #e6f4f7;
}
@keyframes sfPulse {
  0%, 100% { opacity: .45; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* ------------------- v3.23 顶栏「一句话」· 强科技风 ------------------- */
.topbar .omni {
  height: 44px;
  padding: 0 8px 0 13px;
  border: 1px solid rgba(126, 220, 214, .48) !important;
  border-radius: 12px !important;
  background:
    repeating-linear-gradient(90deg, rgba(126, 220, 214, .045) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(126, 220, 214, .035) 0 1px, transparent 1px 22px),
    linear-gradient(110deg, rgba(6, 14, 23, .98), rgba(12, 28, 39, .97) 55%, rgba(7, 16, 25, .99)) !important;
  box-shadow:
    0 0 0 1px rgba(126, 220, 214, .10) inset,
    0 0 0 3px rgba(90, 170, 180, .08),
    0 10px 26px rgba(3, 10, 16, .35),
    0 0 28px rgba(90, 180, 185, .18) !important;
  overflow: visible;
}
.topbar .omni::before {
  content: ''; position: absolute; left: 8px; top: -1px; width: 42%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(158, 240, 230, .95), transparent);
  filter: drop-shadow(0 0 4px rgba(150, 235, 225, .8));
  animation: omniBeam 3.6s linear infinite;
}
.topbar .omni::after {
  content: ''; position: absolute; right: 8px; bottom: -1px; width: 26%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(196, 166, 118, .6), transparent);
}
.topbar .omni:focus-within {
  border-color: rgba(154, 244, 234, .78) !important;
  box-shadow:
    0 0 0 1px rgba(154, 244, 234, .18) inset,
    0 0 0 4px rgba(90, 180, 185, .12),
    0 12px 30px rgba(3, 10, 16, .42),
    0 0 34px rgba(110, 205, 205, .26) !important;
}
.topbar .omni > svg { color: #84d8d0 !important; width: 18px; height: 18px; filter: drop-shadow(0 0 5px rgba(120, 220, 210, .5)); }
.topbar .omni input {
  color: #e6fdff !important; font-weight: 500 !important; font-size: 13.5px !important;
  letter-spacing: .01em; caret-color: #9ef2e8;
}
.topbar .omni input::placeholder {
  color: #7fa6b3 !important; font-weight: 400 !important;
}
.topbar .omni-key {
  color: #7fa6b3; border: 1px solid rgba(126, 220, 214, .22);
  background: rgba(6, 16, 24, .55); border-radius: 5px;
}
.topbar .omni-mic {
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid rgba(126, 220, 214, .38);
  background: rgba(9, 23, 32, .85); color: #9ce6de;
  box-shadow: 0 0 12px rgba(90, 190, 190, .14);
}
.topbar .omni-mic:hover {
  color: #f0fffd; border-color: rgba(154, 244, 234, .65);
  background: rgba(18, 42, 50, .92);
  box-shadow: 0 0 18px rgba(110, 220, 215, .28);
}
.topbar .omni-mic.mic-on {
  background: rgba(154, 76, 76, .85); border-color: rgba(214, 138, 138, .7); color: #fff;
  animation: micPulse 1s ease-in-out infinite;
}
.omni-help {
  flex: 0 0 auto; height: 28px; padding: 0 9px; border-radius: 8px;
  border: 1px solid rgba(126, 220, 214, .28);
  background: rgba(10, 26, 35, .78); color: #9ec7d0;
  font-size: 11.5px; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  white-space: nowrap; transition: all .16s ease;
}
.omni-help:hover {
  color: #eafffb; border-color: rgba(154, 244, 234, .6);
  background: rgba(20, 46, 54, .9);
  box-shadow: 0 0 16px rgba(110, 220, 215, .22);
}
.omni-help .oh-short { display: none; }
.topbar .omni-list {
  background: linear-gradient(165deg, rgba(9, 18, 28, .985), rgba(7, 14, 22, .99));
  border: 1px solid rgba(126, 220, 214, .28);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5), 0 0 26px rgba(90, 180, 185, .12);
}
.topbar .omni-item { color: #bfd5de; }
.topbar .omni-item.active { background: rgba(90, 180, 185, .13); }
.topbar .omni-item svg { color: #8fc6c8; }
.topbar .omni-title { color: #e2f6f5; }
.topbar .omni-sub, .topbar .omni-type { color: #7f9daa; }

/* 功能说明弹窗（深色科技风） */
.omni-help-body {
  margin: -4px; padding: 14px 16px;
  border-radius: 12px;
  background:
    repeating-linear-gradient(0deg, rgba(160, 215, 220, .03) 0 1px, transparent 1px 4px),
    linear-gradient(165deg, rgba(9, 17, 27, .99), rgba(7, 13, 21, .99));
  border: 1px solid rgba(126, 220, 214, .28);
  box-shadow: 0 0 24px rgba(90, 180, 185, .12) inset;
  color: #c9dce5;
}
.oh-lead { margin: 0 0 12px; color: #9fc7ce; font-size: 13px; line-height: 1.7; }
.oh-sec {
  padding: 9px 0 9px 12px; border-left: 1px solid rgba(126, 220, 214, .28);
  border-bottom: 1px solid rgba(126, 220, 214, .08);
}
.oh-sec:last-of-type { border-bottom: 0; }
.oh-sec h4 { margin: 0 0 3px; color: #c9f3ec; font-size: 13.5px; letter-spacing: .04em; }
.oh-sec p { margin: 0; color: #b7ccd6; font-size: 12.5px; line-height: 1.7; }
.oh-ex {
  display: inline-block; margin-top: 5px; padding: 4px 9px; border-radius: 6px;
  color: #a7ddd3; background: rgba(90, 180, 185, .10);
  border: 1px solid rgba(126, 220, 214, .16); font-size: 12px;
}
@keyframes omniBeam {
  0% { transform: translateX(-120%); opacity: 0; }
  12% { opacity: .9; }
  88% { opacity: .9; }
  100% { transform: translateX(260%); opacity: 0; }
}

/* 助手面板再强化一点科技感 */
#assistant-dock.assistant-dock {
  border-color: rgba(150, 226, 220, .38);
  box-shadow:
    0 0 0 1px rgba(160, 230, 225, .06) inset,
    0 24px 74px rgba(0, 0, 0, .62),
    0 0 42px rgba(100, 190, 190, .20);
}
#assistant-dock.assistant-dock::after { opacity: .55; }
#assistant-dock .ad-head { border-bottom-color: rgba(150, 226, 220, .26); }
#assistant-dock .ad-head::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160, 240, 232, .55), transparent);
}
#assistant-dock .ad-title { color: #f0fffd; text-shadow: 0 0 18px rgba(160, 240, 232, .35); }
#assistant-dock .ad-title::before { background: #a6f0e6; box-shadow: 0 0 14px rgba(166, 240, 230, .95); }
#assistant-dock .ad-log-item { border-left-color: rgba(150, 226, 220, .6); }

@media (max-width: 860px) {
  .omni-help { width: 28px; padding: 0; }
  .omni-help .oh-long { display: none; }
  .omni-help .oh-short { display: inline; }
  .topbar .omni { height: 40px; }
}

/* 功能说明弹窗：连标题栏和底部一起做成深色，别只黑中间 */
.overlay:has(.omni-help-body) .modal {
  background: linear-gradient(165deg, #0a1420, #08111b);
  border: 1px solid rgba(126, 220, 214, .30);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .55), 0 0 40px rgba(90, 180, 185, .16);
}
.overlay:has(.omni-help-body) .modal-head {
  background: linear-gradient(90deg, rgba(30, 52, 62, .65), rgba(10, 20, 30, .2));
  border-bottom: 1px solid rgba(126, 220, 214, .22);
}
.overlay:has(.omni-help-body) .modal-head h3 { color: #e8fffb; letter-spacing: .06em; text-shadow: 0 0 14px rgba(150, 235, 225, .25); }
.overlay:has(.omni-help-body) .modal-head .icon-btn { color: #9fc7ce; }
.overlay:has(.omni-help-body) .modal-head .icon-btn:hover { background: rgba(90, 180, 185, .14); color: #f0fffd; }
.overlay:has(.omni-help-body) .modal-body { padding: 12px 14px; }
.overlay:has(.omni-help-body) .modal-foot {
  background: rgba(7, 13, 21, .92);
  border-top: 1px solid rgba(126, 220, 214, .20);
}
.overlay:has(.omni-help-body) .modal-foot .btn.primary {
  background: rgba(108, 180, 172, .18);
  border: 1px solid rgba(150, 235, 225, .42);
  color: #e6fffa;
  box-shadow: 0 0 16px rgba(110, 210, 205, .18);
}

/* 新版本提示条：只提示，不挡操作 */
.update-bar {
  position: fixed; top: 76px; right: 18px;
  z-index: 500; display: flex; align-items: center; gap: 10px;
  max-width: min(560px, calc(100vw - 24px)); padding: 8px 12px;
  background: linear-gradient(120deg, #0d1a24, #10242c);
  border: 1px solid rgba(126, 220, 214, .38);
  border-radius: 11px; color: #d9edf0;
  box-shadow: 0 12px 34px rgba(4, 12, 18, .35), 0 0 20px rgba(90, 180, 185, .16);
  font-size: 12.5px;
}
.update-bar .ub-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #8fe0d6;
  box-shadow: 0 0 10px rgba(143, 224, 214, .8);
}
.update-bar b { color: #eafffb; white-space: nowrap; }
.update-bar .ub-note { color: #8fa9b5; }
.update-bar .btn.sm.primary {
  background: rgba(108, 180, 172, .18); border: 1px solid rgba(150, 235, 225, .40);
  color: #e6fffa; padding: 4px 10px; font-size: 12px;
}
.update-bar .btn.sm.ghost { color: #a9c2cb; border-color: rgba(126, 220, 214, .22); padding: 4px 9px; font-size: 12px; }
@media (max-width: 860px) {
  .update-bar { top: auto; bottom: 76px; left: 8px; right: 8px; max-width: none; font-size: 12px; gap: 7px; }
  .update-bar .ub-note { display: none; }
}

/* 捆绑赠品序号 */
.bundle-no { color: var(--ink-3); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* 手机首页：看板图标入口（桌面不显示） */
.mobile-dash { display: none; }
@media (max-width: 860px) {
  .dash-desktop { display: none !important; }
  .mobile-dash {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
  }
  .md-tile {
    display: flex; align-items: center; gap: 9px;
    min-height: 78px; padding: 10px 11px;
    background: #fff; border: 1px solid var(--line);
    border-radius: 14px; cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
    transition: transform .12s ease, border-color .12s ease;
  }
  .md-tile:active { transform: scale(.98); border-color: var(--primary); }
  .md-icon {
    width: 38px; height: 38px; flex: 0 0 auto;
    border-radius: 11px; background: var(--primary-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
  }
  .md-icon svg { width: 20px; height: 20px; }
  .md-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
  .md-main b { font-size: 13px; color: var(--ink); }
  .md-main span {
    font-size: 11.5px; color: var(--ink-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .md-arrow { color: var(--ink-3); font-size: 18px; line-height: 1; }
}

/* ============================================================
   登录页（企业版）：账号/手机号 + 密码，协议确认，扫码下载
   ============================================================ */
.login-page {
  position: relative; width: 100%; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 36px 20px; overflow: auto;
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(37, 99, 235, .12), transparent 62%),
    radial-gradient(820px 520px at 92% 92%, rgba(79, 70, 229, .10), transparent 60%),
    linear-gradient(135deg, #f8fbff 0%, #eef4ff 52%, #f8fafc 100%);
}
.login-page::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(37,99,235,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(37,99,235,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.85), transparent 75%);
}
.login-card {
  position: relative; z-index: 1; width: min(430px, calc(100vw - 32px)); box-sizing: border-box;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 24px; padding: 32px 34px 22px;
  box-shadow: 0 24px 70px rgba(30,64,175,.13), 0 2px 8px rgba(15,23,42,.04);
  animation: pageIn .42s var(--ease-out) both;
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.login-brand-logo { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 5px 14px rgba(15,118,144,.22); }
.login-brand-name { font-size: 17px; font-weight: 750; color: var(--ink-1); letter-spacing: .2px; }
.login-brand-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; letter-spacing: .8px; }
.login-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.login-head h1 { font-size: 27px; line-height: 1.15; font-weight: 800; color: var(--ink-1); }
.login-register { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; padding-bottom: 3px; }
.login-register a { color: var(--primary); font-weight: 600; text-decoration: none; }
.login-register a:hover { text-decoration: underline; }
.login-message { font-size: 12.5px; color: #1d4ed8; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 10px; padding: 9px 11px; margin-bottom: 14px; line-height: 1.6; }
.login-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.login-tab { position: relative; border: 0; background: none; padding: 0 0 11px; margin: 0; font-size: 14.5px; color: var(--ink-3); cursor: pointer; font-family: inherit; }
.login-tab.active { color: var(--primary); font-weight: 700; }
.login-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--primary); }
.login-company { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 12px; margin-bottom: 14px; border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 11px; font-size: 13px; color: var(--ink-2); }
.login-company-label { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.login-company b { font-weight: 650; color: var(--ink-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-company-badge { margin-left: auto; font-size: 10.5px; color: #1d4ed8; background: #e8f0ff; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.login-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 13px; }
.login-field .login-label { margin-bottom: 0; }
.login-label { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 7px; }
.login-input { width: 100%; height: 46px !important; border-radius: 11px !important; font-size: 14.5px !important; padding: 0 13px !important; border-color: #dbe3ef !important; background: #fff !important; }
.login-input:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(37,99,235,.10) !important; }
.login-mode-hint { font-size: 11px; color: #94a3b8; margin-top: 5px; line-height: 1.5; }
.login-pass-wrap { position: relative; }
.login-pass-wrap .login-input { padding-right: 44px !important; }
.login-eye { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; color: #94a3b8; border-radius: 8px; cursor: pointer; }
.login-eye:hover { background: #f1f5f9; color: var(--primary); }
.login-eye svg { width: 17px; height: 17px; }
.login-agree { display: flex; align-items: flex-start; gap: 7px; margin: 14px 0 8px; font-size: 12px; color: var(--ink-3); line-height: 1.55; cursor: pointer; }
.login-agree input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--primary); flex: 0 0 15px; cursor: pointer; }
.login-agree a { color: var(--primary); text-decoration: none; }
.login-agree a:hover { text-decoration: underline; }
.login-error { min-height: 17px; margin: 2px 0 7px; color: #dc2626; font-size: 12.5px; line-height: 1.5; }
.login-error:not(.show) { visibility: hidden; }
.login-submit { width: 100%; height: 48px; border: 0; border-radius: 12px; color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 1px; cursor: pointer; font-family: inherit; background: linear-gradient(100deg, #2563eb, #4f46e5); box-shadow: 0 9px 22px rgba(37,99,235,.24); transition: transform .15s var(--ease), box-shadow .15s var(--ease), opacity .15s; }
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(37,99,235,.28); }
.login-submit:active { transform: translateY(0); }
.login-submit:disabled { opacity: .72; cursor: default; transform: none; }
.login-links { text-align: right; margin-top: 9px; font-size: 12.5px; }
.login-links a { color: var(--ink-3); text-decoration: none; }
.login-links a:hover { color: var(--primary); }
.login-download { display: flex; align-items: center; gap: 13px; margin-top: 19px; padding-top: 16px; border-top: 1px dashed #e2e8f0; }
.login-qr { width: 86px; height: 86px; cursor: pointer; padding: 4px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; flex: 0 0 86px; }
.login-download-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.login-download-text strong { font-size: 13px; color: var(--ink-1); }
.login-download-sub { font-size: 11px; color: #94a3b8; line-height: 1.4; }
.login-footer { margin-top: 14px; padding-top: 2px; text-align: center; font-size: 10.5px; color: #a7b1c2; line-height: 1.5; }
.login-legal h4 { font-size: 13.5px; color: var(--ink-1); margin: 14px 0 5px; }
.login-legal h4:first-child { margin-top: 0; }
.login-legal p { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin: 0; }
@media (max-width: 560px) {
  .login-page { padding: 0; align-items: stretch; background: #fff; }
  .login-page::before { display: none; }
  .login-card { width: 100%; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; padding: 28px 22px 18px; display: flex; flex-direction: column; }
  .login-brand { margin-bottom: 26px; }
  .login-head h1 { font-size: 25px; }
  .login-download { margin-top: auto; }
  .login-footer { margin-top: 13px; }
}

/* ------------------- v3.40 顶栏「一句话」浅色版 ------------------- */
.topbar .omni {
  background:
    repeating-linear-gradient(90deg, rgba(14, 107, 117, .025) 0 1px, transparent 1px 22px),
    linear-gradient(110deg, #f7fcfc 0%, #edf8f8 55%, #fbfefe 100%) !important;
  border: 1px solid #9dd3ce !important;
  box-shadow:
    0 1px 0 #fff inset,
    0 0 0 3px rgba(14, 107, 117, .06),
    0 4px 14px rgba(14, 107, 117, .10) !important;
}
.topbar .omni:focus-within {
  border-color: #4fa8a3 !important;
  background: #fff !important;
  box-shadow:
    0 0 0 3px rgba(14, 107, 117, .12),
    0 6px 18px rgba(14, 107, 117, .14) !important;
}
.topbar .omni::before {
  background: linear-gradient(90deg, transparent, rgba(14, 107, 117, .45), transparent);
  filter: none;
  opacity: .45;
}
.topbar .omni::after {
  background: linear-gradient(90deg, transparent, rgba(183, 121, 31, .35), transparent);
}
.topbar .omni > svg {
  color: #0e6b75 !important;
  filter: none;
}
.topbar .omni input {
  color: #123b57 !important;
  caret-color: #0e6b75;
  font-weight: 500 !important;
}
.topbar .omni input::placeholder {
  color: #6d8b92 !important;
  font-weight: 400 !important;
}
.topbar .omni-key {
  color: #5d7d84 !important;
  border-color: #cfe3e1 !important;
  background: #f8ffff !important;
}
.topbar .omni-mic {
  color: #0e6b75 !important;
  background: #f8ffff !important;
  border-color: #cfe3e1 !important;
  box-shadow: none !important;
}
.topbar .omni-mic:hover {
  color: #0b565e !important;
  background: #eaf8f7 !important;
  border-color: #9dd3ce !important;
}
.topbar .omni-help {
  color: #456d74 !important;
  background: #f8ffff !important;
  border-color: #cfe3e1 !important;
}
.topbar .omni-help:hover {
  color: #123b57 !important;
  background: #eaf8f7 !important;
  border-color: #9dd3ce !important;
  box-shadow: none !important;
}
/* 下拉列表也改浅，跟输入框一致 */
.topbar .omni-list {
  background: #fff !important;
  border: 1px solid #d7e7e5 !important;
  box-shadow: 0 14px 38px rgba(18, 59, 87, .16) !important;
}
.topbar .omni-item { color: #284a55 !important; }
.topbar .omni-item.active { background: #edf8f7 !important; }
.topbar .omni-item svg { color: #0e6b75 !important; }
.topbar .omni-title { color: #123b57 !important; }
.topbar .omni-sub, .topbar .omni-type { color: #7b969c !important; }

/* 单据备注：标签和输入框绑成一组，缩放时输入框不会掉到标签下面 */
.inv-note-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 330px;
  max-width: 330px;
  min-width: 260px;
}
.inv-note-group .inv-lb { margin-bottom: 0 !important; white-space: nowrap; }
.inv-note-input { flex: 0 0 220px; max-width: 220px; min-width: 160px; }
.inv-note-input .input { width: 100%; }
@media (max-width: 1100px) {
  .inv-note-group { flex-basis: 300px; max-width: 300px; min-width: 230px; }
  .inv-note-input { flex-basis: 190px; max-width: 190px; }
}

@media (min-width: 1000px) { .inv-first-row { flex-wrap: nowrap; } .inv-first-row .inv-fld.party { flex: 0 1 300px; max-width: 300px; } }

/* ===== v3.46.12 界面修复（UI 评审落地） ===== */
/* 1) 次要文字加深，提高可读性 */
:root { --ink-3: #64748b; }
/* 2) 数字等宽，金额列对齐 */
.tbl td.num, .tbl th.num, .mono, .num { font-variant-numeric: tabular-nums; }
/* 3) 控件与浮层统一 */
.btn { min-height: 36px; }
.card { border-radius: 14px; }
.modal { border-radius: 18px; max-height: calc(100% - 48px); box-shadow: 0 12px 32px rgba(15,23,42,.16); }
.drawer { border-radius: 18px 0 0 18px; box-shadow: 0 12px 32px rgba(15,23,42,.16); }
/* 4) 顶部栏：标题不再被挤成竖排 / 不再压住标签栏 */
.topbar { height: auto; min-height: 56px; }
.topbar > div:first-of-type { min-width: 150px; }
.topbar .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.topbar .omni { flex: 0 1 360px; min-width: 140px; }
.tabstrip { margin-top: 2px; }
@media (max-width: 1180px) { .topbar .sub { display: none; } }
/* 5) 开单页：表头表单与吸底条允许换行，不再错位/裁切 */
.inv-row { flex-wrap: wrap; row-gap: 8px; }
.inv-fld { min-width: 170px; }
.inv-actions { flex-wrap: wrap; row-gap: 8px; }
.inv-actions .t-item { min-width: 86px; white-space: nowrap; }
/* 6) 表格横向滚动提示 */
.table-wrap { scrollbar-width: thin; }
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.table-wrap { position: relative; }
.table-wrap::after { content: ''; position: sticky; right: 0; top: 0; float: right; width: 18px; height: 100%; pointer-events: none;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(15,23,42,.06)); }
/* 7) 手机端：账套切换收进头像菜单（顶部不再被挤出屏幕） */
@media (max-width: 860px) {
  .topbar .select { max-width: 92px !important; width: 92px !important; font-size: 12px; }
  .topbar > div:first-of-type { min-width: 96px; }
  .topbar .omni { flex: 1 1 auto; min-width: 110px; }
}

.sidebar-foot { flex-wrap: wrap; }
.sidebar-foot .icp { flex-basis: 100%; margin-top: 4px; font-size: 10px; color: var(--muted); text-decoration: none; }
.sidebar-foot .icp:hover { text-decoration: underline; }
