/* =====================================================================
   仓库拿货系统 / Warehouse Ordering System
   全局样式 — 自适应电脑与手机
   ===================================================================== */

:root {
  --bg: #f4f6fb;
  --bg-alt: #eef1f8;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --border: #e4e8f0;
  --border-strong: #cfd6e4;
  --text: #16203a;
  --text-2: #4a5670;
  --muted: #7c879e;
  --primary: #2f5cff;
  --primary-dark: #2449d6;
  --primary-soft: #eaefff;
  --ok: #10a05b;
  --ok-soft: #e5f7ee;
  --warn: #e08b00;
  --warn-soft: #fdf3e0;
  --danger: #dd3d4b;
  --danger-soft: #fdecee;
  --info: #0d8bbd;
  --info-soft: #e6f5fb;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 7px;
  --shadow-1: 0 1px 2px rgba(18, 28, 55, .06), 0 1px 3px rgba(18, 28, 55, .04);
  --shadow-2: 0 2px 6px rgba(18, 28, 55, .06), 0 14px 32px -16px rgba(18, 28, 55, .22);
  --shadow-3: 0 24px 60px -20px rgba(15, 23, 50, .35);
  --sidebar-w: 226px;
  --topbar-h: 58px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* 中文界面字号略微收小，避免中英混排时中文显得过重 */
html[data-lang="zh"] body { font-size: 13.5px; }
html[data-lang="zh"] .btn { font-size: 13.5px; }
html[data-lang="en"] body { font-size: 14px; }

a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #ccd3e2; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3bcd0; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.app-root { min-height: 100%; }

/* ---------------------------------------------------------------- 登录页 */

.login-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}

.login-hero {
  position: relative;
  overflow: hidden;
  padding: 54px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(150deg, #23409c 0%, #2f5cff 46%, #4f83ff 100%);
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: auto -18% -42% -18%;
  height: 78%;
  background: radial-gradient(60% 60% at 50% 50%, rgba(255, 255, 255, .18), transparent 70%);
  pointer-events: none;
}

.login-hero .hero-brand { position: relative; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.login-hero .hero-logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
}
.login-hero .hero-main { position: relative; max-width: 460px; }
.login-hero .hero-main h1 { font-size: 34px; line-height: 1.28; font-weight: 700; letter-spacing: -.4px; }
.login-hero .hero-main h1 span { display: block; font-size: 17px; font-weight: 500; opacity: .78; margin-top: 12px; letter-spacing: .1px; }
.login-hero .hero-points { position: relative; display: grid; gap: 11px; margin-top: 30px; }
.login-hero .hero-points div { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; opacity: .93; }
.login-hero .hero-foot { position: relative; font-size: 12px; opacity: .68; }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: var(--surface);
}
.login-card { width: 100%; max-width: 372px; }
.login-card h2 { font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.login-card .login-sub { color: var(--muted); margin-top: 7px; font-size: 13px; }
.login-form { margin-top: 26px; display: grid; gap: 15px; }/* 登录验证码：输错密码 3 次后出现 */
.captcha-row { display: flex; gap: 8px; align-items: center; }
.captcha-row .input { flex: 1; min-width: 0; }
.captcha-img {
  flex: 0 0 auto; width: 128px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #f4f6fa;
  cursor: pointer; overflow: hidden; user-select: none;
}
.captcha-img:hover { border-color: var(--border-strong); }
.captcha-img:active { opacity: .72; }
.captcha-img svg { display: block; width: 100%; height: 100%; }
.captcha-loading { font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 30px 24px 26px; gap: 20px; }
  .login-hero .hero-main h1 { font-size: 23px; }
  .login-hero .hero-main h1 span { font-size: 14px; margin-top: 8px; }
  .login-hero .hero-points { display: none; }
  .login-hero .hero-foot { display: none; }
  .login-panel { padding: 28px 20px 40px; align-items: flex-start; }
}

/* ------------------------------------------------------------ 应用骨架 */

.shell { min-height: 100dvh; display: flex; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.sidebar-brand .brand-logo {
  width: 32px; height: 32px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(140deg, #2f5cff, #5a86ff);
  display: grid; place-items: center; color: #fff;
}
.sidebar-brand .brand-text { min-width: 0; }
.sidebar-brand .brand-text strong { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand .brand-text span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 14px 10px 20px; }
.nav-group { margin-bottom: 16px; }
.nav-group > .nav-group-title {
  font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
  color: var(--muted); padding: 0 10px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-xs);
  color: var(--text-2); cursor: pointer; user-select: none;
  font-weight: 500; margin-bottom: 2px; border: 1px solid transparent;
  transition: background .14s, color .14s;
}
.nav-item:hover { background: var(--bg-alt); color: var(--text); }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary-dark); border-color: #dbe3ff; font-weight: 600; }
.nav-item .nav-ico { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: inline-grid; place-items: center;
}

.sidebar-foot { flex: 0 0 auto; border-top: 1px solid var(--border); padding: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: var(--radius-xs); }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: var(--primary-soft); color: var(--primary-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.user-chip .u-info { min-width: 0; flex: 1 1 auto; }
.user-chip .u-info strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .u-info span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-xs); border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text-2);
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--text); }

.main {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar h1 { font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
.topbar .page-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.burger { display: none; }

.content { padding: 20px; flex: 1 1 auto; max-width: 1560px; width: 100%; }

.scrim {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .42);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 55;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

@media (max-width: 1000px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; box-shadow: var(--shadow-3); }
  .sidebar.is-open { transform: none; }
  .main { margin-left: 0; }
  .burger { display: grid; }
  .content { padding: 14px 14px 84px; }
  .topbar { padding: 0 13px; }
  .topbar h1 { font-size: 15px; }
}

/* ------------------------------------------------------------ 通用控件 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .06s;
}
.btn:hover { background: var(--bg-alt); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(47, 92, 255, .3); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53442; border-color: #c53442; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0d8a4e; border-color: #0d8a4e; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; }

.field { display: grid; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .err { font-size: 11.5px; color: var(--danger); font-weight: 500; }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color .14s, box-shadow .14s; outline: none;
}
.input:hover, .select:hover, .textarea:hover { border-color: #b9c3d8; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 92, 255, .14);
}
.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237c879e' 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 10px center; padding-right: 30px; }
.input-sm { height: 30px; font-size: 12.5px; padding: 0 9px; }
.input.is-invalid { border-color: var(--danger); }

.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
.input-group .btn { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; border-left: none; height: 36px; }

.search-wrap { position: relative; flex: 1 1 200px; max-width: 320px; }
.search-wrap .search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap .input { padding-left: 32px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 38px; height: 22px; border-radius: 11px; background: #d3dae7; position: relative; transition: background .16s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .16s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }

.seg { display: inline-flex; background: var(--bg-alt); border-radius: var(--radius-xs); padding: 3px; gap: 2px; }
.seg button {
  border: none; background: transparent; padding: 5px 12px; border-radius: 6px;
  cursor: pointer; color: var(--text-2); font-weight: 550; white-space: nowrap;
}
.seg button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

.lang-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); overflow: hidden; }
.lang-toggle button { border: none; background: var(--surface); padding: 6px 10px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 12px; }
.lang-toggle button.is-active { background: var(--primary); color: #fff; }

/* ------------------------------------------------------------ 卡片/布局 */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14.5px; font-weight: 650; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 16px; }
.card-body.tight { padding: 10px 16px; }

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

@media (max-width: 1400px) {
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-6, .grid-4, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

.stat {
  padding: 15px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-1); position: relative; overflow: hidden;
}
.stat .stat-label { font-size: 12px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat .stat-value { font-size: 25px; font-weight: 700; letter-spacing: -.7px; margin-top: 7px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .stat-value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat .stat-foot { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
/* 环比涨跌：增长绿、下降红（业务统计惯例） */
.delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.stat.accent .stat-foot .delta.up { color: #b9f6d4; }
.stat.accent .stat-foot .delta.down { color: #ffd6da; }
/* 今日摘要条 */
.today-strip {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-1);
}
.today-strip .ts-title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--primary);
}
.today-strip .ts-item { display: inline-flex; align-items: baseline; gap: 7px; }
.today-strip .ts-item span { font-size: 11.5px; color: var(--muted); }
.today-strip .ts-item b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .today-strip { gap: 12px; padding: 9px 13px; }
  .today-strip .ts-title { flex: 1 1 100%; }
  .today-strip .ts-item b { font-size: 14px; }
}
.stat.accent { background: linear-gradient(150deg, #2f5cff, #5580ff); border-color: transparent; color: #fff; }
.stat.accent .stat-label, .stat.accent .stat-foot { color: rgba(255, 255, 255, .82); }
.stat.accent .stat-value { color: #fff; }
.stat .stat-ico {
  position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark);
}
.stat.accent .stat-ico { background: rgba(255, 255, 255, .18); color: #fff; }
.stat.is-warn .stat-ico { background: var(--warn-soft); color: var(--warn); }
.stat.is-danger .stat-ico { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- 表格 */

.table-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl thead th {
  font-size: 11.5px; font-weight: 650; color: var(--text-2); text-transform: uppercase;
  letter-spacing: .4px; background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .actions { white-space: nowrap; display: flex; gap: 6px; }
table.tbl .actions .btn { height: 27px; padding: 0 9px; font-size: 12px; }
.row-actions { white-space: nowrap; }

/* 批量打印：勾选列 */
table.tbl th.pick, table.tbl td.pick { width: 36px; padding-left: 8px; padding-right: 4px; text-align: center; }
table.tbl input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.toolbar .btn-print.is-armed { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.toolbar .btn-print .ico { vertical-align: -2px; }

.cell-prod { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.thumb {
  width: 38px; height: 38px; border-radius: 8px; flex: 0 0 auto; object-fit: cover;
  background: var(--bg-alt); border: 1px solid var(--border); display: grid; place-items: center;
  color: var(--muted); font-size: 11px; overflow: hidden;
}
.cell-prod .p-meta { min-width: 0; }
.cell-prod .p-meta strong { display: block; font-weight: 600; font-size: 13px; }
.cell-prod .p-meta span { display: block; font-size: 11.5px; color: var(--muted); }

.mono { font-family: var(--mono); font-size: 12.5px; }
.num-strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.text-muted { color: var(--muted); }
/* 商品列表：库存数量下方的占用（锁定）库存量，小字淡色 */
.stock-lock { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.nowrap { white-space: nowrap; }
.empty {
  padding: 52px 20px; text-align: center; color: var(--muted);
}
.empty .empty-ico { width: 46px; height: 46px; margin: 0 auto 12px; opacity: .5; }
.empty p { font-size: 13px; }
.empty .empty-title { font-weight: 600; color: var(--text-2); font-size: 14px; margin-bottom: 3px; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--bg-alt); color: var(--text-2); border: 1px solid transparent;
}
.tag-primary { background: var(--primary-soft); color: var(--primary-dark); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-info { background: var(--info-soft); color: var(--info); }
.tag-neutral { background: #eef0f5; color: var(--muted); }

.size-chips { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.size-chip {
  min-width: 30px; text-align: center; padding: 2px 5px; border-radius: 5px; font-size: 11px;
  background: var(--bg-alt); border: 1px solid var(--border); font-variant-numeric: tabular-nums;
}
.size-chip b { font-weight: 650; }
.size-chip.is-zero { opacity: .42; }
.size-chip.is-low { background: var(--danger-soft); border-color: #f6ccd1; color: #b02a37; }

@media (max-width: 760px) {
  /* 移动端表格转卡片 */
  table.tbl.tbl-stack thead { display: none; }
  table.tbl.tbl-stack, table.tbl.tbl-stack tbody, table.tbl.tbl-stack tr, table.tbl.tbl-stack td { display: block; width: 100%; }
  table.tbl.tbl-stack tr {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-bottom: 10px; padding: 6px 2px; background: var(--surface);
    box-shadow: var(--shadow-1);
  }
  table.tbl.tbl-stack td {
    border: none; padding: 6px 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between;
  }
  table.tbl.tbl-stack td::before {
    content: attr(data-label); font-size: 11.5px; color: var(--muted); font-weight: 600;
    flex: 0 0 auto; text-transform: uppercase; letter-spacing: .3px;
  }
  table.tbl.tbl-stack td[data-label=""]::before { display: none; }
  table.tbl.tbl-stack td.pick { justify-content: flex-start; padding-bottom: 2px; }
  table.tbl.tbl-stack td.pick::before { display: none; }
  table.tbl.tbl-stack td.pick input { width: 17px; height: 17px; }
  table.tbl.tbl-stack td.full { display: block; }
  table.tbl.tbl-stack td.full::before { display: block; margin-bottom: 4px; }
  table.tbl.tbl-stack .cell-prod { min-width: 0; }
  table.tbl.tbl-stack .num { text-align: left; }
  table.tbl.tbl-stack .actions { display: flex; flex-wrap: wrap; }
}

/* --------------------------------------------------------------- 订货页 */

.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 16px; align-items: start; }
@media (max-width: 1180px) { .order-layout { grid-template-columns: minmax(0, 1fr); } }

.cart-panel { position: sticky; top: calc(var(--topbar-h) + 16px); }
@media (max-width: 1180px) {
  .cart-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 50;
    border-radius: var(--radius) var(--radius) 0 0; border-bottom: none;
    box-shadow: 0 -8px 30px -10px rgba(15, 23, 50, .3);
    max-height: 72dvh; display: flex; flex-direction: column;
    transform: translateY(calc(100% - 56px)); transition: transform .24s ease;
  }
  .cart-panel.is-open { transform: none; }
  .cart-collapsed { display: flex !important; }
  /* 手机端只保留一层滚动（用面板 body 滚），避免内外两层滚动条互相抢手势 */
  .cart-panel .card-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .cart-panel .cart-list { max-height: none; overflow: visible; padding-right: 0; }
}
.cart-collapsed {
  display: none; align-items: center; gap: 10px; padding: 0 16px; height: 56px; cursor: pointer; flex: 0 0 auto;
}
.cart-collapsed .cart-count { font-weight: 700; }
.cart-collapsed .chev { margin-left: auto; transition: transform .2s; }
.cart-panel.is-open .cart-collapsed .chev { transform: rotate(180deg); }

.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
@media (max-width: 640px) { .prod-grid { grid-template-columns: minmax(0, 1fr); } }

.prod-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  overflow: hidden; box-shadow: var(--shadow-1); display: flex; flex-direction: column;
}
.prod-card .pc-top { display: flex; gap: 14px; padding: 12px; align-items: stretch; }
.prod-card .pc-img {
  width: 96px; height: 96px; border-radius: 11px; flex: 0 0 auto; object-fit: cover;
  background: var(--bg-alt); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted);
}
/* 可点开的商品图：放大 + 角标 + 悬停提示 */
.prod-card button.pc-img {
  position: relative; padding: 0; cursor: zoom-in; overflow: hidden; background: var(--bg-alt);
  transition: box-shadow .16s, transform .16s;
}
.prod-card button.pc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-card button.pc-img:hover { box-shadow: 0 6px 18px -6px rgba(15, 23, 50, .35); transform: translateY(-1px); }
.prod-card button.pc-img:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pc-img-count {
  position: absolute; right: 3px; bottom: 3px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: rgba(12, 18, 38, .72); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
}
.pc-img-zoom {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(12, 18, 38, .34); color: #fff; opacity: 0; transition: opacity .16s;
}
.prod-card button.pc-img:hover .pc-img-zoom { opacity: 1; }
.pc-img-empty { color: var(--muted); }
.prod-card .pc-info { min-width: 0; flex: 1 1 auto; padding-left: 2px; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
/* 一行：货号 + 分类名（+ 码段） */
.prod-card .pc-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.prod-card .pc-line .pc-name {
  font-weight: 700; font-size: 14.5px; line-height: 1.3; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.prod-card .pc-line .pc-cat {
  font-size: 11.5px; color: var(--text-2); background: var(--bg-alt);
  padding: 1px 7px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto;
}
.prod-card .pc-info .pc-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.prod-card .pc-prices { display: flex; align-items: baseline; gap: 8px; margin-top: 5px; font-size: 12px; flex-wrap: wrap; }
.prod-card .pc-prices .price { font-weight: 700; color: var(--primary-dark); font-size: 15px; font-variant-numeric: tabular-nums; }
.prod-card .pc-pairs { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 可订库存（图片右侧信息区的第二块） */
.prod-card .pc-avail { display: flex; align-items: baseline; gap: 6px; font-size: 12px; line-height: 1.5; }
.prod-card .pc-avail .lbl { color: var(--muted); flex: 0 0 auto; }
.prod-card .pc-avail .val { font-weight: 650; font-variant-numeric: tabular-nums; }
.prod-card .pc-tags { padding: 0 12px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
/* 双数换算：40 box / 2,400 pcs */
.stock-line .avail-pcs { font-weight: 500; color: var(--muted); font-size: 11.5px; margin-left: 1px; }
.prod-card .pc-stock { padding: 0 12px 10px; display: grid; gap: 6px; }
.stock-line { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.stock-line .lbl { color: var(--muted); flex: 0 0 auto; min-width: 52px; }
.stock-line .val { font-weight: 650; font-variant-numeric: tabular-nums; }
.prod-card .pc-foot { margin-top: auto; border-top: 1px solid var(--border); background: var(--surface-2); padding: 10px 12px; display: grid; gap: 9px; }
.qty-row { display: flex; align-items: center; gap: 9px; }
.qty-row .lbl { font-size: 12px; color: var(--text-2); font-weight: 600; flex: 0 0 auto; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); overflow: hidden; background: var(--surface); }
.stepper button {
  width: 30px; height: 32px; border: none; background: var(--surface); cursor: pointer; color: var(--text-2);
  display: grid; place-items: center; font-size: 15px; line-height: 1;
}
.stepper button:hover { background: var(--bg-alt); color: var(--text); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper input {
  width: 48px; height: 32px; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  text-align: center; outline: none; font-variant-numeric: tabular-nums; font-weight: 600;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* 数量为 0 时输入框留空，灰色 0 仅作占位（避免「0 + 2 = 20」的误操作） */
.stepper input::placeholder { color: #aab3c5; opacity: 1; font-weight: 500; }
.stepper.wide input { width: 62px; }

/* 数量 > 0：数字标红（订货卡 Quantity 与规格格、订货篮通用），一眼看出已选货 */
.stepper input.is-filled,
.size-inputs .si input.is-filled,
.cart-line .cl-qty .cq-in.is-filled { color: var(--danger); }
.stepper input.is-filled::placeholder,
.size-inputs .si input.is-filled::placeholder { color: #aab3c5; }

.size-inputs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.size-inputs .si { display: grid; gap: 3px; }
.size-inputs .si span { font-size: 10.5px; color: var(--muted); text-align: center; font-weight: 600; }
.size-inputs .si input {
  width: 100%; height: 30px; border: 1px solid var(--border-strong); border-radius: 6px;
  text-align: center; outline: none; font-variant-numeric: tabular-nums; font-weight: 600; padding: 0;
  -moz-appearance: textfield;
}
.size-inputs .si input::-webkit-outer-spin-button, .size-inputs .si input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.size-inputs .si input::placeholder { color: #aab3c5; opacity: 1; font-weight: 500; }
.size-inputs .si input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 92, 255, .14); }
.size-inputs .si input:disabled { background: #f5f6fa; color: #a9b2c5; }
.size-inputs .si.is-picked input { border-color: var(--primary); background: var(--primary-soft); }

/* overscroll-behavior: contain —— 购物篮滚到头时不把滚动传给背后的商品列表（防误滚） */
.cart-list {
  display: grid; gap: 9px; max-height: 40vh; overflow-y: auto; padding-right: 2px;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
}
.cart-line { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.cart-line .cl-thumb {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 7px; object-fit: cover;
  border: 1px solid var(--border); background: var(--surface);
}
.cart-line .cl-thumb.is-empty { display: grid; place-items: center; color: var(--muted); }
.cart-line .cl-main { flex: 1 1 auto; min-width: 0; }
.cart-line .cl-main strong { font-size: 12.5px; font-weight: 650; display: block; }
.cart-line .cl-main .cl-detail { font-size: 11.5px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.cart-line .cl-pairs { font-size: 11.5px; color: var(--text-2); margin-top: 3px; font-weight: 600; }
/* 订货篮内数量步进器（单码段/无码段商品可直接改） */
.cart-line .cl-qty {
  display: inline-flex; align-items: center; vertical-align: middle; margin-right: 5px;
  border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--surface);
}
.cart-line .cl-qty .cq-btn {
  width: 22px; height: 22px; border: none; background: var(--surface); color: var(--text-2);
  font-size: 14px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.cart-line .cl-qty .cq-btn:hover { background: var(--primary-soft); color: var(--primary); }
.cart-line .cl-qty .cq-in {
  width: 36px; height: 22px; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  text-align: center; font-size: 12px; font-weight: 650; font-family: inherit;
  background: var(--surface); color: var(--text); padding: 0; -moz-appearance: textfield;
}
.cart-line .cl-qty .cq-in:focus { outline: none; background: var(--primary-soft); }
/* 数量大于 0：数字标红，一眼看出这项已经选了货 */
.cart-line .cl-qty .cq-in.is-filled { color: var(--danger); }
.cart-line .cl-qty .cq-in::-webkit-outer-spin-button,
.cart-line .cl-qty .cq-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-line .cl-unit { margin-right: 4px; }
/* 数量后的「/每箱6件」说明：小字淡色（订单详情 / 列表通用） */
.qty-per { font-size: 11px; font-weight: 500; color: var(--muted); }

.cart-summary { display: grid; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.cart-summary .cs-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); }
.cart-summary .cs-row.total { font-size: 14px; font-weight: 700; color: var(--text); border-top: 1px dashed var(--border-strong); padding-top: 8px; margin-top: 2px; }
.cart-summary .cs-row .v { font-variant-numeric: tabular-nums; font-weight: 650; }

/* --------------------------------------------------------------- 图表 */

.chart { width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { font-size: 10.5px; fill: var(--muted); }
.chart .bar { fill: var(--primary); transition: opacity .14s; }
.chart .bar:hover { opacity: .78; }
.chart .bar-2 { fill: #8fa9ff; }
.chart .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.chart .legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

.bar-list { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12.5px; }
.bar-row .br-label { min-width: 0; }
.bar-row .br-label .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.bar-row .br-label .s { display: block; font-size: 11px; color: var(--muted); }
.bar-row .br-val { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.bar-row .br-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--bg-alt); overflow: hidden; }
.bar-row .br-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #4f83ff, #2f5cff); }

/* ---------------------------------------------------------------- 弹层 */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .46);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 200;
  animation: fade .16s ease;
  overscroll-behavior: contain;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985) } to { opacity: 1; transform: none } }

.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-3);
  width: 100%; max-width: 560px; max-height: 92dvh; display: flex; flex-direction: column;
  animation: pop .18s ease; overflow: hidden;
}
.modal.modal-lg { max-width: 860px; }
.modal.modal-sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.modal-head h3 { font-size: 15px; font-weight: 650; }
.modal-head .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.modal-close { margin-left: auto; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1 1 auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--border); display: flex; gap: 9px; justify-content: flex-end; flex: 0 0 auto; background: var(--surface-2); flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; max-height: 94dvh; }
  .modal-foot { position: sticky; bottom: 0; }
  .modal-foot .btn { flex: 1 1 auto; }
}

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-grid .span-2 { grid-column: auto; } }

.section-title {
  grid-column: 1 / -1; font-size: 12px; font-weight: 650; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .5px; padding-top: 6px; border-top: 1px dashed var(--border);
}
.section-title:first-child { border-top: none; padding-top: 0; }

/* 图片上传 */
.img-grid { display: flex; gap: 9px; flex-wrap: wrap; }
.img-slot {
  width: 78px; height: 78px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  position: relative; overflow: hidden; background: var(--bg-alt);
}
.img-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-slot .rm {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(17, 24, 39, .68); color: #fff; border: none; cursor: pointer;
  display: grid; place-items: center; font-size: 13px; line-height: 1;
}
.img-add {
  width: 78px; height: 78px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong);
  background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--muted);
  text-align: center; font-size: 11px; gap: 3px; padding: 4px;
}
.img-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* 订单详情 */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.detail-item .dl { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.detail-item .dv { font-size: 13.5px; font-weight: 600; margin-top: 3px; word-break: break-word; }

.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
.tl-item .tl-dot { display: grid; justify-items: center; }
.tl-item .tl-dot i { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); margin-top: 5px; }
.tl-item .tl-dot .line { width: 2px; flex: 1 1 auto; background: var(--border); min-height: 18px; }
.tl-item .tl-body { padding-bottom: 14px; }
.tl-item .tl-body strong { font-size: 13px; font-weight: 600; display: block; }
.tl-item .tl-body span { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- Toast */

.toast-host {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 400; display: grid; gap: 8px; justify-items: center; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: #1c2541; color: #fff; padding: 10px 15px; border-radius: var(--radius-xs);
  box-shadow: var(--shadow-3); font-size: 13px; font-weight: 500; max-width: 100%;
  animation: toastIn .22s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) } to { opacity: 1; transform: none } }
.toast.is-out { opacity: 0; transform: translateY(-8px); transition: all .2s; }
.toast.ok { background: #0d8a4e; }
.toast.error { background: #c53442; }
.toast.warn { background: #b8760a; }
.toast svg { flex: 0 0 auto; }

/* ---------------------------------------------------------------- 其他 */

.loading-wrap { display: grid; place-items: center; padding: 60px 0; color: var(--muted); gap: 12px; }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid rgba(47, 92, 255, .2);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.skeleton {
  background: linear-gradient(90deg, #eef1f8 25%, #e4e8f0 37%, #eef1f8 63%);
  background-size: 400% 100%; animation: shim 1.3s ease infinite; border-radius: 6px;
}
@keyframes shim { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1 1 auto; }

.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .pg-info { font-size: 12.5px; color: var(--muted); margin-right: auto; }

.banner {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: 12.5px; margin-bottom: 14px; border: 1px solid transparent;
}
.banner-warn { background: var(--warn-soft); color: #8a5a00; border-color: #f5e0b8; }
.banner-info { background: var(--info-soft); color: #0a6d94; border-color: #c5e7f4; }
.banner-danger { background: var(--danger-soft); color: #a92b37; border-color: #f6ccd1; }
.banner-ok { background: var(--ok-soft, #e8f6ee); color: #1b6b41; border-color: #c3e6d2; }
.banner svg { flex: 0 0 auto; margin-top: 1px; }

.kv-list { display: grid; gap: 9px; }
.kv-list .kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.kv-list .kv:last-child { border-bottom: none; padding-bottom: 0; }
.kv-list .kv .k { color: var(--muted); }
.kv-list .kv .v { font-weight: 600; text-align: right; }

.checkbox { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; font-size: 13px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }

.hide-sm { }
@media (max-width: 760px) { .hide-sm { display: none !important; } }
@media (min-width: 761px) { .show-sm { display: none !important; } }

/* =====================================================================
   基础图标 / 通用小控件
   ===================================================================== */

.ico { display: inline-block; flex: 0 0 auto; vertical-align: middle; }

.rotate { transform: rotate(180deg); }

.input-mini {
  width: 68px; height: 30px; padding: 0 7px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  text-align: center; outline: none; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--text); background: var(--surface);
  -moz-appearance: textfield;
}
.input-mini::-webkit-outer-spin-button, .input-mini::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-mini:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 92, 255, .14); }
.input-mini:disabled { background: #f5f6fa; color: #a9b2c5; }

/* =====================================================================
   精简表格（审核发货、配比等内嵌小表）
   ===================================================================== */

.tbl-mini thead th { padding: 7px 10px; font-size: 11px; background: var(--surface-2); }
.tbl-mini tbody td { padding: 6px 10px; font-size: 12.5px; }
.tbl-mini tbody tr:last-child td { border-bottom: none; }

/* =====================================================================
   规格配比网格（商品建档 / 编辑弹窗）
   ===================================================================== */

.ratio-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.ratio-grid .si input { height: 28px; }

/* =====================================================================
   审核发货弹窗：按商品分块
   ===================================================================== */

.ship-block { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 10px; background: var(--surface); }
.ship-block:last-child { margin-bottom: 0; }
.ship-head {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.ship-head strong { font-size: 13px; font-weight: 650; }
.ship-head .text-muted { font-size: 11.5px; }
.ship-head .spacer { flex: 1 1 auto; }

/* =====================================================================
   订货页规格格：右下角可订量角标
   ===================================================================== */

.size-inputs .si { position: relative; }
.size-inputs .si-avail {
  font-style: normal; font-size: 10px; line-height: 1; text-align: center;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.size-inputs .si.is-picked .si-avail { color: var(--primary); font-weight: 650; }
.size-inputs .si input:disabled + .si-avail { color: #b9c0d0; }

/* =====================================================================
   分类编辑器（基础资料 → 分类）
   ===================================================================== */

.cat-editor { display: grid; gap: 6px; }
.cat-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto;
  gap: 7px; align-items: center;
}
.cat-row .input { height: 32px; }
.cat-row.cat-head span { font-size: 11px; font-weight: 650; color: var(--muted); padding-left: 2px; }
.cat-row.cat-head { padding-bottom: 1px; }
.cat-ops { display: flex; gap: 3px; align-items: center; }
/* 码段编辑：代码 + 范围 两列 */
.cat-row.seg-row { grid-template-columns: 150px minmax(0, 1fr) auto; }
.cat-row.seg-row .mono { font-family: var(--mono); text-transform: uppercase; }

@media (max-width: 640px) {
  .cat-row { grid-template-columns: 1fr 1fr; }
  .cat-row.cat-head span:nth-child(3) { display: none; }
  .cat-ops { grid-column: 1 / -1; justify-content: flex-end; }
  .input-mini { width: 58px; }
}

/* =====================================================================
   视觉精修 v1.2 — 层次、细节、手机端与英文版适配
   （本段位于文件末尾，按需覆盖上方同名规则）
   ===================================================================== */

/* ----------------------------------------------------------- 基础排版 */
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body { letter-spacing: .005em; }

/* 英文界面：字距与大小写更协调，避免长单词挤在一起 */
html[data-lang="en"] body { letter-spacing: .01em; }
html[data-lang="en"] .btn { letter-spacing: .01em; }
html[data-lang="en"] .stat .stat-label { letter-spacing: .01em; }
html[data-lang="en"] .section-title { letter-spacing: .04em; }

/* 数字统一等宽，表格与统计对齐更整齐 */
.num, .num-strong, .stat-value, .size-chip, .mono,
table.tbl .num, .kv-list .kv .v, .cart-summary .cs-row .v {
  font-variant-numeric: tabular-nums;
}

/* 焦点可见性（键盘操作友好） */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }

/* ------------------------------------------------------------- 侧栏 */
.sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.sidebar-brand { padding-bottom: 14px; }
.sidebar-brand .brand-logo {
  box-shadow: 0 4px 12px -4px rgba(47, 92, 255, .45);
}

.nav-item {
  transition: background .14s, color .14s, transform .14s;
}
.nav-item:hover { transform: translateX(1px); }
.nav-item.is-active {
  box-shadow: inset 2px 0 0 var(--primary), 0 1px 2px rgba(47, 92, 255, .08);
  border-color: #dfe6ff;
}
.nav-item .nav-badge { box-shadow: 0 0 0 2px var(--surface); }

/* ------------------------------------------------------------- 顶栏 */
.topbar {
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 1px 0 var(--border), 0 8px 20px -18px rgba(18, 28, 55, .35);
}

/* --------------------------------------------------------- 卡片 / 容器 */
.card {
  box-shadow: var(--shadow-1);
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow-2); }
.card-head {
  background: linear-gradient(180deg, #fdfdff, #fafbfe);
  border-bottom: 1px solid var(--border);
}
.card-head h3 { letter-spacing: -.1px; }

/* 统计卡：左侧色条 + 悬浮微动效 */
.stat {
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #7ea2ff, var(--primary));
  opacity: .55;
}
.stat.accent::before { background: rgba(255, 255, 255, .55); opacity: .8; }
.stat.is-warn::before { background: linear-gradient(180deg, #ffc266, var(--warn)); }
.stat.is-danger::before { background: linear-gradient(180deg, #ff8b96, var(--danger)); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.stat .stat-ico {
  transition: transform .18s ease;
}
.stat:hover .stat-ico { transform: scale(1.06); }
.stat .stat-value { overflow-wrap: anywhere; }

/* ------------------------------------------------------------- 表格 */
table.tbl thead th {
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #f7f9ff; }
table.tbl td { border-bottom: 1px solid #eef1f7; }
table.tbl tbody tr:last-child td { border-bottom: none; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* --------------------------------------------------- 标签 / 规格小标签 */
.tag {
  letter-spacing: .01em;
  border: 1px solid transparent;
}
.tag-ok { border-color: #cdeeda; }
.tag-warn { border-color: #f7e3bd; }
.tag-danger { border-color: #f8d3d8; }
.tag-info { border-color: #cbe9f6; }
.tag-primary { border-color: #dbe3ff; }

.size-chip {
  border: 1px solid var(--border);
  background: #fdfdff;
  transition: background .12s, border-color .12s;
}
.size-chip.is-low {
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(221, 61, 75, .08);
}
.size-chips { gap: 4px; }

/* --------------------------------------------------------- 订货商品卡 */
.prod-card {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.prod-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: #d7dff5;
}
.prod-card .pc-img {
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(18, 28, 55, .05);
}
.prod-card .pc-info .pc-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prod-card .pc-prices .price {
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 1px 7px;
  border-radius: 6px;
}
.prod-card .pc-foot { backdrop-filter: blur(2px); }

/* 无库存商品：整卡灰显（仍可查看图片，但不可下单） */
.prod-card.is-out { opacity: .55; }
.prod-card.is-out:hover { opacity: .75; border-color: var(--border); }
.prod-card.is-out .pc-img img { filter: grayscale(1); }
.prod-card.is-out .pc-name,
.prod-card.is-out .pc-sub,
.prod-card.is-out .pc-prices .price { color: var(--muted); }
.prod-card.is-out .pc-prices .price { background: var(--bg-alt); }
.prod-card.is-out .stepper,
.prod-card.is-out .si { opacity: .6; }

/* 订货篮行内金额 */
.cart-line .cl-pairs .cl-pcs { color: var(--muted); font-weight: 500; }
.cart-line .cl-pairs .cl-amt { float: right; color: var(--text); font-variant-numeric: tabular-nums; }

/* 单价（码段后面）：与订货卡价格同一套蓝色价签 */
.cart-line .cl-detail .cl-price,
.kv-list .kv .k .cf-price {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  border-radius: 5px; background: var(--primary-soft); color: var(--primary-dark);
  font-weight: 700; font-size: 11.5px; font-variant-numeric: tabular-nums;
  line-height: 1.55;
}
/* 订单确认页：货号加粗 */
.kv-list .kv .k .cf-sku { font-weight: 700; color: var(--text); }

/* 返回顶部 */
.back-top {
  position: fixed; right: 22px; bottom: 64px; z-index: 40;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(15, 23, 50, .35);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .18s, transform .18s, visibility .18s, background .14s, color .14s;
}
.back-top.is-show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.back-top:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 订货页悬浮购物篮按钮：窄屏（底部抽屉模式）常驻，宽屏隐藏（右侧栏常显） */
.cart-fab {
  display: none; position: fixed; right: 22px; bottom: 122px; z-index: 45;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--primary);
  place-items: center; cursor: pointer;
  box-shadow: 0 10px 26px -8px rgba(15, 23, 50, .4);
  transition: background .14s, color .14s, transform .14s, border-color .14s;
}
.cart-fab:hover { transform: translateY(-1px); }
.cart-fab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 有货时高亮，吸引注意 */
.cart-fab.has-items { background: var(--primary); color: #fff; border-color: var(--primary); }
.cart-fab.is-active { box-shadow: 0 0 0 3px rgba(47, 92, 255, .2), 0 10px 26px -8px rgba(15, 23, 50, .4); }
.cart-fab .fab-badge {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 19px; text-align: center;
  border: 2px solid var(--surface); box-sizing: content-box;
}
.cart-fab .fab-badge[hidden] { display: none; }
@media (max-width: 1180px) { .cart-fab { display: grid; } }
/* 通过悬浮按钮打开时：以底部浮层覆盖显示（手机端面板平时在页面末尾） */
.cart-panel.is-float {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto;
  z-index: 60; max-height: 76dvh; display: flex; flex-direction: column;
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: none;
  box-shadow: 0 -12px 36px -12px rgba(15, 23, 50, .45);
  overscroll-behavior: contain;
}
.cart-panel.is-float .card-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* 浮层遮罩：挡住背后商品列表（防止滚动串台），点空白即收起 */
.cart-scrim {
  position: fixed; inset: 0; z-index: 55; background: rgba(9, 14, 28, .42);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s;
  -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
}
.cart-scrim.is-show { opacity: 1; visibility: visible; }
/* 浮层打开时锁住页面滚动 */
body.cart-float-lock { overflow: hidden; }
body.cart-float-lock .main { overscroll-behavior: contain; }
/* 弹窗 / 浮层打开期间：整页禁止橡皮筋回弹（配合 UI.lockScroll 的 body fixed） */
html.scroll-locked { overscroll-behavior: none; }

/* 退出按钮改为文字 */
.logout-btn {
  flex: 0 0 auto; border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 11.5px; font-weight: 600; padding: 4px 8px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; transition: background .14s, color .14s, border-color .14s;
}
.logout-btn:hover { background: var(--danger-soft, #fdecec); color: var(--danger, #d64545); border-color: transparent; }

.stepper button {
  min-width: 34px;
  transition: background .12s, color .12s;
}
.stepper button:not(:disabled):hover { background: var(--primary-soft); color: var(--primary-dark); }
.stepper input:focus { background: var(--primary-soft); }

/* --------------------------------------------------- 库存预警明细列表 */
.warn-list { display: grid; gap: 5px; min-width: 170px; }
.warn-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  background: var(--danger-soft);
  border: 1px solid #f8d3d8;
  color: #a92b37;
  border-radius: 999px;
  padding: 2px 10px 2px 8px;
  width: fit-content;
  max-width: 100%;
}
.warn-item b { font-weight: 700; }
.warn-item .w-avail { font-weight: 700; font-variant-numeric: tabular-nums; }
.warn-item .w-slash { opacity: .55; }
.warn-item .w-warn { font-variant-numeric: tabular-nums; opacity: .9; }
.warn-item .w-gap {
  font-size: 11px;
  padding-left: 6px;
  border-left: 1px dashed rgba(169, 43, 55, .35);
  white-space: nowrap;
}

/* --------------------------------------------------------- 审核发货块 */
.ship-block { box-shadow: var(--shadow-1); }
.ship-head {
  background: linear-gradient(180deg, #fdfdff, #f8faff);
  border-bottom: 1px solid var(--border);
}
.ship-head .tag { flex: 0 0 auto; }

/* ------------------------------------------------------------- 弹窗 */
.modal {
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border);
}
.modal-head {
  background: linear-gradient(180deg, #fdfdff, #fafbfe);
}
.modal-foot { background: var(--surface-2); }

/* ------------------------------------------------------------- 表单 */
.form-grid { gap: 15px; }
.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-2);
}
.field > label { letter-spacing: .01em; }
.size-inputs .si input { transition: border-color .12s, box-shadow .12s, background .12s; }
.size-inputs .si input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 92, 255, .14);
  background: #fff;
}
.size-inputs .si.is-picked {
  background: var(--primary-soft);
  border-color: #cfdaff;
}

/* --------------------------------------------------------- 登录页细节 */
@media (min-width: 901px) {
  .login-page { background: linear-gradient(120deg, #eef2ff 0%, #f7f9ff 42%, #ffffff 100%); }
}
.login-card h2 { letter-spacing: -.3px; }

/* =====================================================================
   手机端（<= 760px）
   ===================================================================== */
@media (max-width: 760px) {
  :root { --topbar-h: 56px; }

  .content {
    padding: 12px 12px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  /* 触控目标不小于 34px，避免误触 */
  .btn { height: 38px; padding: 0 14px; }
  .btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .icon-btn { width: 38px; height: 38px; }
  .input, .select, .textarea { height: 42px; border-radius: 10px; }
  .textarea { height: auto; min-height: 88px; }
  /* 16px 可避免 iOS 聚焦时自动放大页面 */
  .input, .select, .textarea, .input-mini, .stepper input, .size-inputs .si input { font-size: 16px; }
  .size-inputs .si input { height: 36px; }
  .input-mini { width: 62px; height: 36px; }

  .topbar {
    height: auto; min-height: 52px;
    flex-wrap: wrap; align-items: center;
    padding: 8px 12px; row-gap: 6px;
  }
  /* 标题块：可收缩到安全宽度，过长省略，避免与右侧按钮重叠 */
  .topbar > div:first-of-type { min-width: 110px !important; flex: 1 1 110px; }
  .topbar h1 { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .page-sub {
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.35;
  }
  .topbar-actions { flex: 0 0 auto; }
  .lang-toggle { flex: 0 0 auto; margin-left: 0; }

  /* 表格转卡片：更像原生列表 */
  table.tbl.tbl-stack tr {
    border-radius: 12px;
    padding: 4px 0;
    box-shadow: 0 1px 2px rgba(18, 28, 55, .05);
  }
  table.tbl.tbl-stack td { padding: 7px 13px; }
  table.tbl.tbl-stack td::before {
    font-size: 11px;
    letter-spacing: .05em;
  }
  table.tbl.tbl-stack td.row-actions,
  table.tbl.tbl-stack td[data-label=""] {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 9px;
  }
  table.tbl.tbl-stack .cell-prod { gap: 11px; }
  table.tbl.tbl-stack .thumb { width: 40px; height: 40px; }
  table.tbl.tbl-stack .actions .btn,
  table.tbl.tbl-stack td[data-label=""] .btn { flex: 1 1 auto; justify-content: center; }

  /* 统计卡：手机两列，字号收敛 */
  .grid-6, .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .stat-value { font-size: 21px; }
  .stat { padding: 13px 13px 13px 15px; }

  /* 弹窗改为底部抽屉，操作按钮更容易点 */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100% !important;
    width: 100%;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
  }
  .modal-head { padding: 14px 16px; position: relative; }
  .modal-head::before {
    content: "";
    position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 999px; background: var(--border-strong);
    opacity: .7;
  }
  .modal-head h3 { font-size: 15px; }
  .modal-body { padding: 15px 16px; }
  .modal-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    position: sticky; bottom: 0;
  }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }

  /* 订货页 */
  .prod-grid { gap: 21px; }
  .prod-card { border-radius: 14px; }
  .prod-card .pc-top { padding: 13px; gap: 12px; }
  .prod-card .pc-img { width: 86px; height: 86px; border-radius: 12px; }
  .stock-line { font-size: 12.5px; }
  .back-top { right: 14px; bottom: calc(122px + env(safe-area-inset-bottom, 0px)); width: 38px; height: 38px; }
  /* 手机端悬浮购物篮按钮在返回顶部按钮上方，避免重叠 */
  .cart-fab { right: 14px; bottom: calc(178px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; }

  .cart-panel { position: static; }
  .cart-panel.is-open { box-shadow: var(--shadow-2); }

  /* 工具条：横向可滚，避免挤压 */
  .toolbar { gap: 8px; }
  .toolbar .search-wrap { max-width: none; flex: 1 1 100%; }

  /* 表单栅格、分类编辑器 */
  .form-grid { gap: 13px; }
  .detail-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

  /* 规格输入格：手机两行排布更整齐 */
  .size-inputs { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
  .size-inputs .si-avail { font-size: 10px; }

  /* 预警明细、审核块 */
  .warn-list { min-width: 0; width: 100%; max-width: 100%; flex: 1 1 auto; }
  .warn-item { font-size: 12px; flex-wrap: wrap; row-gap: 2px; }
  .warn-item .w-gap { white-space: normal; }
  /* 卡片化 td 是 flex 布局，内容一律允许收缩，防止撑破卡片 */
  table.tbl.tbl-stack td > * { min-width: 0; max-width: 100%; }
  .ship-head { flex-wrap: wrap; gap: 6px; }
  .ship-head .spacer { display: none; }
  .ship-head .btn { flex: 1 1 auto; }

  /* 提示与横幅换行更自然 */
  .banner { align-items: flex-start; }
  .toast { max-width: calc(100vw - 28px); }
}

/* 窄屏（<= 420px）：再收一档 */
@media (max-width: 420px) {
  .stat .stat-value { font-size: 19px; }
  .grid-6, .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod-card .pc-img { width: 78px; height: 78px; }
  .content { padding: 10px 10px calc(18px + env(safe-area-inset-bottom, 0px)); }
}

/* --------------------------------------------------------------- 图片查看器 */
.imgview {
  position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(9, 14, 28, .9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: iv-fade .16s ease;
}
@keyframes iv-fade { from { opacity: 0 } to { opacity: 1 } }
.iv-head { display: flex; align-items: center; gap: 12px; padding: 2px 2px 12px; color: #eef2ff; }
.iv-title { font-size: 13.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-count { margin-left: auto; font-size: 12px; color: #a9b4d6; font-variant-numeric: tabular-nums; }
.iv-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
/* 底部关闭区：大按钮，取代右上角 X（避免误触） */
.iv-foot { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 7px; padding-top: 14px; }
.iv-close-btn {
  min-width: 168px; justify-content: center; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .26);
  font-weight: 650;
}
.iv-close-btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.iv-tip { font-size: 11.5px; color: #93a0c4; }
.iv-img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px;
  background: #fff; box-shadow: 0 24px 70px -24px rgba(0, 0, 0, .85);
}
/* 左右切换：叠加在图片两侧的圆形大按钮（原来 40px 贴边太小易误触） */
.iv-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 56px; height: 56px; flex: 0 0 auto; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .55); background: rgba(12, 18, 34, .72); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background .15s, border-color .15s, transform .12s;
}
.iv-nav.is-prev { left: 4px; }
.iv-nav.is-next { right: 4px; }
.iv-nav:hover { background: rgba(91, 131, 255, .9); border-color: #fff; }
.iv-nav:active { transform: translateY(-50%) scale(.93); }
.iv-nav:focus-visible { outline: 3px solid #8fa8ff; outline-offset: 2px; }
.iv-thumbs { display: flex; gap: 8px; justify-content: center; padding: 12px 0 2px; overflow-x: auto; }
.iv-thumb {
  width: 56px; height: 56px; flex: 0 0 auto; padding: 0; border-radius: 9px; overflow: hidden;
  border: 2px solid transparent; background: #1b2438; cursor: pointer; opacity: .72; transition: opacity .15s, border-color .15s;
}
.iv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iv-thumb:hover { opacity: 1; }
.iv-thumb.is-active { border-color: #5b83ff; opacity: 1; }
@media (max-width: 760px) {
  .imgview { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .iv-title { font-size: 12.5px; }
  .iv-nav { width: 46px; height: 46px; border-width: 1.5px; }
  .iv-nav.is-prev { left: 0; }
  .iv-nav.is-next { right: 0; }
  .iv-thumb { width: 48px; height: 48px; }
  .iv-stage { gap: 6px; }
}

/* ------------------------------------------------------------ 操作日志 / 分页 */
.toolbar .select { width: auto; min-width: 132px; }
.toolbar .search-wrap { flex: 1 1 220px; }
.tbl-log td { font-size: 12.5px; }
.tbl-log .log-who { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.tbl-log .log-who strong { font-weight: 650; }
.tbl-log .log-who .text-muted { font-size: 11.5px; }
.tbl-log .log-detail { color: var(--text-2); max-width: 320px; }
/* 商品列表分页 / 订货页滚动加载 */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .pg-info { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.pager .pg-page { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.pager .pg-gap { color: var(--muted); padding: 0 2px; }
.pager .btn.pg-num { min-width: 30px; justify-content: center; padding: 4px 8px; }
.pager .btn.pg-num.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.more-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px 0 6px; }
.prod-grid-empty { padding: 8px 0; }
.pager .pg-page { color: var(--muted); }
.toolbar input[type="date"] { width: 148px; }
@media (max-width: 760px) {
  .pager { padding: 10px 12px; flex-wrap: wrap; justify-content: center; }
  .pager .pg-info { margin-right: 0; width: 100%; text-align: center; }
  .tbl-log .log-detail { max-width: none; }
  .toolbar input[type="date"] { width: 100%; }
}
