/* ============================================================
   视图层：iOS 玻璃风格
   ============================================================ */

/* ============ 通用小工具 ============ */
.pos { color: var(--green); }
.neg { color: var(--red); }
.up { color: var(--green); }
.down { color: var(--red); }
.is-off { opacity: .5; }

.fold-enter-active, .fold-leave-active { transition: opacity .2s var(--ease), transform .2s var(--ease); }
.fold-enter-from, .fold-leave-to { opacity: 0; transform: translateY(-4px); }

.toast-enter-active, .toast-leave-active { transition: opacity .2s var(--ease), transform .2s var(--ease); }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateY(-8px) scale(.96); }

/* ============ 今日 ============ */
.hero-card {
  padding: 20px 18px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 42%),
    var(--glass);
}
.hero-card.is-quiet { padding: 20px 18px; }
.hero-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hero-label {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em;
  color: var(--label-3); text-transform: uppercase;
}
.hero-amount-zero { color: var(--label-4); }
.hero-quiet-text { font-size: var(--fs-sm); color: var(--label-2); margin-top: 12px; line-height: 1.5; }
.hero-quiet-recap {
  margin-top: 16px; padding: 13px 15px;
  background: rgba(255, 255, 255, .46);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
}
.recap-label { font-size: var(--fs-xs); color: var(--label-3); font-weight: 550; }
.recap-line { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.recap-line b { font-size: var(--fs-2xl); font-weight: 680; letter-spacing: -.03em; }
.recap-line span { font-size: var(--fs-sm); color: var(--label-3); }
@media (min-width: 640px) {
  .hero-quiet { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: center; }
  .hero-quiet-recap { margin-top: 0; }
}

.hero-meta { display: flex; flex-wrap: wrap; gap: 0; margin-top: 16px; }
.hero-meta-item {
  display: flex; flex-direction: column; gap: 1px;
  padding-right: 20px; margin-right: 20px;
  border-right: 1px solid var(--stroke);
  min-width: 0;
}
.hero-meta-item:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.hero-meta-item b { font-size: var(--fs-lg); font-weight: 650; display: flex; align-items: center; gap: 2px; letter-spacing: -.02em; }
.hero-meta-item span { font-size: var(--fs-xs); color: var(--label-3); }
.hero-channels {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--stroke);
}
.hero-ch { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--label-2); }
.hero-ch i { width: 7px; height: 7px; border-radius: 50%; }
.hero-ch b { font-weight: 600; font-variant-numeric: tabular-nums; }

@media (min-width: 900px) {
  .hero-card:not(.is-quiet) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    align-items: center; column-gap: 44px;
  }
  .hero-card:not(.is-quiet) .hero-top { grid-column: 1; }
  .hero-card:not(.is-quiet) .hero-amount { grid-column: 1; }
  .hero-card:not(.is-quiet) .hero-meta { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  .hero-card:not(.is-quiet) .hero-channels { grid-column: 1 / -1; }
}

.alert-line {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 0; border-bottom: 1px solid var(--stroke);
}
.alert-line:last-child { border-bottom: none; }
.alert-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.alert-dot.is-low { background: var(--amber); }
.alert-dot.is-neg { background: var(--red); }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 16px 6px 14px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke-bright); border-radius: var(--r-md);
  color: var(--label-2); font-size: var(--fs-sm); font-weight: 550;
  box-shadow: var(--sh-1);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.quick:hover { background: var(--glass-strong); transform: translateY(-1px); }
.quick:active { transform: scale(.97); }
.quick svg { color: var(--blue); }

.lrow-btn { width: 100%; text-align: left; background: none; border: none; border-radius: var(--r-xs); }
.lrow-btn:hover { background: rgba(255, 255, 255, .38); }

/* ============ 筛选条 ============ */
.filter-card .card-body { padding: 14px 14px 12px; }
.filter-card { margin-bottom: 14px; }
.chip-sep { width: 1px; align-self: stretch; background: var(--stroke); margin: 3px 4px; flex: none; }
.chip-freq { background: transparent; box-shadow: inset 0 0 0 1px var(--stroke-strong); }
.chip-freq:hover { box-shadow: inset 0 0 0 1px var(--label-4); }

/* ============ 开单 ============ */
.reg-layout { display: block; }
.reg-pick { min-width: 0; }
.pick-bar {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top));
  z-index: 15;
  padding: 10px 0 14px; margin: -10px 0 8px;
  background: var(--glass-chrome);
  -webkit-backdrop-filter: var(--blur-chrome);
  backdrop-filter: var(--blur-chrome);
  border-bottom: 1px solid var(--stroke);
}
.pick-bar .chips-scroll { margin-top: 10px; }
.pick-clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--label-3); background: var(--fill);
}
.pick-clear:hover { background: var(--fill-2); }
.input-search .input { padding-right: 42px; }

.combo-list { display: flex; flex-direction: column; gap: 10px; padding: 6px 16px 18px; }
.combo-cell {
  position: relative; display: grid;
  grid-template-columns: 1fr auto; grid-template-areas: "name price" "parts price";
  gap: 3px 12px; text-align: left;
  padding: 13px 15px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.combo-cell:hover { background: rgba(255, 255, 255, .8); }
.combo-cell.has-qty { background: var(--blue-soft); border-color: var(--blue-line); }
.combo-name { grid-area: name; font-weight: 600; font-size: var(--fs-md); letter-spacing: -.01em; }
.combo-parts { grid-area: parts; font-size: var(--fs-xs); color: var(--label-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-price { grid-area: price; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px; }
.combo-price b { font-size: var(--fs-lg); color: var(--label); letter-spacing: -.02em; }
.combo-price s { font-size: var(--fs-xs); color: var(--label-4); }
.combo-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 21px; height: 21px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 650;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2.5px var(--bg);
  font-variant-numeric: tabular-nums;
}
.combo-self { margin-left: 5px; padding: 1px 7px; font-size: 10.5px; vertical-align: 1px; }

/* 套餐配置：大区/中类/商品三级子套餐 */
.combo-groups { display: flex; flex-direction: column; gap: 10px; }
.combo-group {
  display: grid; grid-template-columns: 172px minmax(0, 1fr);
  gap: 10px; align-items: stretch;
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  padding: 8px 10px;
}
.combo-group-side {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 8px; border: 1px solid var(--stroke); border-radius: 10px;
  background: rgba(255, 255, 255, .4);
}
.combo-side-label { font-size: var(--fs-xs); line-height: 1.2; color: var(--label-3); }
.combo-group-side .select { width: 100%; max-width: none; min-height: 36px; font-size: 13px; }
.combo-side-foot { display: flex; align-items: center; gap: 4px; }
.combo-side-foot .btn { margin-left: auto; }
.combo-group-qty { width: 58px; min-height: 36px; flex: none; text-align: center; }
.combo-side-actions { display: flex; gap: 4px; margin-top: auto; padding-top: 6px; }
.combo-side-actions .btn { flex: 1; min-height: 26px; padding: 2px 4px; font-size: 11px; }
.combo-group-pool { min-width: 0; }
.combo-group-body { margin-top: 0; padding-top: 0; border-top: none; }
.combo-group-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.combo-group-tools .xs { margin-right: auto; }
.combo-product-scroll {
  max-height: 180px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 8px; padding: 2px;
}
.combo-product-check {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 5px 7px; border-radius: 8px;
  background: rgba(255, 255, 255, .45);
  font-size: var(--fs-sm); cursor: pointer;
}
.combo-product-check input { flex: none; accent-color: var(--blue); }
.combo-product-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-product-check .tag { flex: none; margin-left: auto; font-size: 10px; }
.combo-group-hint { margin-top: 6px; }

/* 套餐表单：中宽弹窗 + 紧凑控件 */
.combo-form .field { margin-bottom: 12px; }
.combo-form .field > label { margin-bottom: 4px; }
.combo-form .form-grid {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 10px; max-width: none;
}
.combo-form .input,
.combo-form .select {
  min-height: 38px; padding: 7px 11px; font-size: 14px;
}
.combo-form .combo-group { padding: 8px 10px; }
.combo-form .combo-group-side .select { min-height: 36px; font-size: 13px; }
.combo-form .combo-status { max-width: 150px; }
.combo-form .combo-status .select { max-width: 150px; }
.combo-form .combo-group-qty { width: 58px; min-height: 36px; }
.combo-form .combo-product-scroll {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  max-height: 170px; gap: 4px 6px;
}
.combo-form .combo-product-check { padding: 5px 8px; font-size: var(--fs-sm); }

@media (max-width: 700px) {
  .combo-form .form-grid { grid-template-columns: 1fr; }
  .combo-group { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .combo-group { padding: 9px; }
  .combo-form .input,
  .combo-form .select { min-height: 40px; font-size: 16px; }
  .combo-form .combo-group-side .select { min-height: 40px; font-size: 16px; }
  .combo-form .combo-status,
  .combo-form .combo-status .select { max-width: none; }
  .combo-group-qty { width: 60px; min-height: 40px; }
  .combo-product-scroll { grid-template-columns: 1fr 1fr; max-height: 220px; }
}

/* 自选套餐选品 */
.cp-intro { font-size: var(--fs-sm); line-height: 1.55; color: var(--label-2); margin-bottom: 12px; }
.cp-group {
  background: rgba(255, 255, 255, .45);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  padding: 12px; margin-bottom: 12px;
}
.cp-group:last-child { margin-bottom: 0; }
.cp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.cp-head b { font-size: var(--fs-md); font-weight: 650; letter-spacing: -.01em; }
.cp-head .xs { margin-left: 6px; }
.cp-count {
  flex: none; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--amber-soft); color: var(--amber);
  font-size: var(--fs-xs); font-weight: 650;
}
.cp-count.is-ok { background: var(--green-soft); color: var(--green); }
.cp-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cp-product {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  min-height: 56px; padding: 9px 10px; text-align: left;
  background: rgba(255, 255, 255, .62); border: 1px solid var(--stroke);
  border-radius: var(--r-sm); transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.cp-product:hover { background: rgba(255, 255, 255, .92); }
.cp-product.has-qty { background: var(--blue-soft); border-color: var(--blue-line); }
.cp-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: var(--fs-sm); font-weight: 600; line-height: 1.35;
}
.cp-meta { font-size: var(--fs-xs); }
.cp-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 650;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg); font-variant-numeric: tabular-nums;
}
.cl-combo-parts { margin-top: 4px; line-height: 1.5; word-break: break-word; }

@media (max-width: 520px) {
  .cp-group { padding: 10px; }
  .cp-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px;
}
.pick-cell {
  position: relative; display: flex; flex-direction: column; gap: 1px;
  min-height: 92px; padding: 12px 11px 10px; text-align: left;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke-bright); border-radius: var(--r-sm);
  box-shadow: var(--sh-1);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.pick-cell:hover { background: var(--glass-strong); }
.pick-cell:active { transform: scale(.97); }
.pick-cell.has-qty { background: rgba(0, 113, 227, .09); border-color: var(--blue-line); }
.pick-name {
  font-size: var(--fs-md); font-weight: 550; line-height: 1.32; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; flex: 1;
}
.pick-price { font-size: var(--fs-lg); font-weight: 650; color: var(--label); margin-top: 3px; letter-spacing: -.02em; }
.pick-stock { font-size: 10.5px; color: var(--label-3); }
.pick-stock.low { color: var(--amber); font-weight: 600; }
.pick-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 21px; height: 21px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 650;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2.5px var(--bg);
  font-variant-numeric: tabular-nums;
}

/* 购物车 */
.reg-cart { position: static; }
.cart-panel {
  display: flex; flex-direction: column;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke-bright);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1); overflow: hidden;
}
.cart-head {
  display: flex; align-items: center; gap: 8px;
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--stroke);
}
.cart-head h3 { font-size: var(--fs-md); font-weight: 640; display: flex; align-items: center; gap: 6px; }
.cart-head h3 svg { color: var(--label-3); }
.cart-head .small { margin-right: auto; color: var(--label-3); }
.cart-body { padding: 8px 16px; max-height: 46vh; overflow-y: auto; }
.cart-empty { padding: 0; max-height: none; }
.cart-empty .empty { padding: 26px 12px; }

.cart-line { padding: 13px 0; border-bottom: 1px solid var(--stroke); }
.cart-line:last-of-type { border-bottom: none; }
.cl-top { display: flex; align-items: flex-start; gap: 8px; }
.cl-name { flex: 1; min-width: 0; font-size: var(--fs-md); font-weight: 550; line-height: 1.35; }
.cl-name .tag { margin-left: 5px; vertical-align: 1px; }
.cl-del {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--label-3); background: var(--fill);
}
.cl-del:hover { background: var(--red-soft); color: var(--red); }
.cl-bottom { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.cl-right { display: flex; align-items: center; gap: 9px; margin-left: auto; }

.gift-check {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; color: var(--label-3); -webkit-tap-highlight-color: transparent;
}
.gift-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.gift-check .switch-track { width: 34px; height: 20px; }
.gift-check .switch-track::after { width: 15px; height: 15px; top: 2.5px; left: 2.5px; }
.gift-check input:checked + .switch-track { background: var(--green); }
.gift-check input:checked + .switch-track::after { transform: translateX(14px); }
.gift-check input:checked ~ .xs { color: var(--green); font-weight: 600; }
.gift-check input:focus-visible + .switch-track { outline: 2px solid var(--blue); outline-offset: 2px; }

.cl-price { display: inline-flex; align-items: center; gap: 2px; }
.cl-price i { font-style: normal; font-size: var(--fs-xs); color: var(--label-3); }
.cl-price-input {
  width: 64px; min-height: 34px; padding: 5px 8px;
  text-align: right; font-size: var(--fs-md);
  background: rgba(255, 255, 255, .6);
}
.cl-price-input:disabled { background: var(--fill); }

.stepper-input {
  width: 34px; min-width: 34px; min-height: 32px; padding: 2px 0;
  text-align: center; font-size: var(--fs-md); font-weight: 650;
  background: transparent; border: none;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cl-amt { min-width: 56px; text-align: right; font-size: var(--fs-md); font-weight: 600; }

.cart-foot {
  padding: 15px 16px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .32);
}
.cart-total-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11px; }
.cart-total-label { font-size: var(--fs-sm); color: var(--label-3); font-weight: 550; }
.cart-total { font-size: 32px; font-weight: 700; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--blue-deep); }
.cart-total i { font-style: normal; font-size: .5em; margin-right: 2px; opacity: .35; }
.cart-actions { display: flex; gap: 9px; }

@media (max-width: 899px) {
  .reg-cart {
    position: fixed; left: 0; right: 0;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    z-index: 45; padding: 0 8px;
    transform: translateY(calc(100% + var(--tabbar-h) + env(safe-area-inset-bottom) + 16px));
    visibility: hidden;
    transition: transform .32s var(--ease), visibility .32s;
    pointer-events: none;
  }
  .reg-cart.is-open { transform: translateY(0); visibility: visible; pointer-events: auto; }
  .cart-panel { box-shadow: var(--sh-3); max-height: 74vh; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .cart-body { max-height: 38vh; }
  .cart-foot .xs { display: none; }
  .cart-actions .btn-checkout { min-height: 48px; }
}

.cart-bar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
  z-index: 44;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px 12px;
  background: linear-gradient(180deg, rgba(10, 132, 255, .96) 0%, rgba(0, 102, 204, .96) 100%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  color: #fff; border-radius: var(--r-pill);
  box-shadow: 0 12px 36px rgba(10, 110, 220, .34);
  transition: transform .2s var(--ease);
}
.cart-bar.is-bump { animation: cart-bump .3s var(--ease); }
@keyframes cart-bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
.cart-bar-count {
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 50%;
  background: var(--blue); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 650; flex: none;
  font-variant-numeric: tabular-nums;
}
.cart-bar-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; flex: 1; }
.cart-bar-text b { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.02em; }
.cart-bar-text em { font-style: normal; font-size: 10.5px; opacity: .55; }
.cart-bar-cta {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 8px 15px; border-radius: var(--r-pill);
  background: var(--blue); font-size: var(--fs-md); font-weight: 600;
}
@media (min-width: 900px) { .cart-bar { display: none; } }

@media (min-width: 900px) {
  .reg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 20px; align-items: start; }
  .reg-cart { position: sticky; top: 22px; }
  .pick-bar { top: -1px; }
  .pick-grid { grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); }
  .cart-body { max-height: 48vh; }
}

/* ============ 订单 ============ */
.order-list { display: flex; flex-direction: column; gap: 12px; }
.order-card {
  width: 100%; text-align: left;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke-bright);
  border-radius: var(--r-md); padding: 14px 16px;
  box-shadow: var(--sh-1);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.order-card:hover { background: var(--glass-strong); transform: translateY(-1px); }
.order-card:active { transform: scale(.995); }
.oc-top { display: flex; align-items: center; gap: 8px; }
.oc-no { font-size: var(--fs-sm); font-weight: 600; color: var(--label-2); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.oc-amt { margin-left: auto; font-size: var(--fs-lg); font-weight: 680; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.oc-mid { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.oc-items { font-size: var(--fs-sm); color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-gift { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--green); white-space: nowrap; flex: none; }
.oc-bottom {
  display: flex; align-items: center; gap: 10px;
  margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--stroke);
  font-size: var(--fs-xs); color: var(--label-3);
}
.oc-channel { display: inline-flex; align-items: center; gap: 4px; }
.oc-channel i { width: 5px; height: 5px; border-radius: 50%; background: var(--label-4); }
.oc-diff { color: var(--amber); font-weight: 600; }
.oc-arrow { margin-left: auto; color: var(--label-4); }

/* 订单详情 */
.od-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.od-amt { margin-left: auto; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.025em; }
.od-items { display: flex; flex-direction: column; gap: 11px; }
.od-item { display: flex; align-items: flex-start; gap: 9px; }
.od-item-name { font-size: var(--fs-md); font-weight: 550; }
.od-item-name .tag { margin-left: 5px; vertical-align: 1px; }
.od-item-sub { margin-top: 2px; }
.od-item-amt { min-width: 62px; text-align: right; font-weight: 600; }
.od-sums { display: flex; flex-direction: column; gap: 7px; }
.od-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: var(--fs-md); }
.od-sum span { color: var(--label-2); }
.od-sum-total { padding-top: 8px; border-top: 1px solid var(--stroke); font-weight: 650; }
.od-sum-total span { color: var(--label); }
.od-sum-total b { font-size: var(--fs-xl); letter-spacing: -.02em; }
.od-block { margin-top: 18px; }
.od-fold {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; font-size: var(--fs-sm); color: var(--label-2); font-weight: 550;
}
.od-movs { padding-top: 2px; }
.od-mov {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; font-size: var(--fs-sm); border-bottom: 1px solid var(--stroke);
}
.od-mov:last-child { border-bottom: none; }

.timeline { display: flex; flex-direction: column; padding-left: 4px; }
.timeline li {
  position: relative; display: flex; align-items: baseline; gap: 9px;
  padding: 0 0 14px 17px; border-left: 1px solid var(--stroke-strong);
  font-size: var(--fs-sm);
}
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.tl-dot {
  position: absolute; left: -4px; top: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--label-4); box-shadow: 0 0 0 3px var(--bg);
}
.tl-pay .tl-dot { background: var(--green); }
.tl-cancel .tl-dot { background: var(--red); }
.tl-create .tl-dot { background: var(--blue); }
.tl-text { color: var(--label-2); }
.tl-time { margin-left: auto; font-size: var(--fs-xs); color: var(--label-4); font-variant-numeric: tabular-nums; }

/* ============ 库存 ============ */
.inv-list { display: flex; flex-direction: column; gap: 10px; }
.inv-row {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke-bright);
  border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-1);
  transition: background var(--dur) var(--ease);
}
.inv-row.is-open { background: var(--glass-strong); }
.inv-main {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 10px;
  padding: 14px 16px; cursor: pointer;
}
.inv-info { min-width: 0; }
.inv-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inv-meta { margin-top: 2px; }
.inv-qty { display: flex; align-items: baseline; gap: 3px; }
.inv-qty b { font-size: var(--fs-xl); font-weight: 680; letter-spacing: -.02em; }
.inv-qty b.low { color: var(--amber); }
.inv-qty b.neg { color: var(--red); }
.inv-caret { color: var(--label-4); transition: transform var(--dur) var(--ease); }
.inv-row.is-open .inv-caret { transform: rotate(180deg); }
.inv-actions { display: flex; gap: 8px; padding: 4px 16px 15px; }
.inv-movs {
  padding: 13px 16px 15px;
  background: rgba(255, 255, 255, .34);
  border-top: 1px solid var(--stroke);
}
.mov-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: var(--fs-sm); }
.mov-qty { min-width: 38px; font-weight: 650; }

/* ============ 预警 ============ */
.alert-list { display: flex; flex-direction: column; gap: 12px; }
.alert-card {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke-bright);
  border-radius: var(--r-md);
  padding: 16px; box-shadow: var(--sh-1);
}
.alert-card.is-resolved { opacity: .62; }
.ac-head { display: flex; align-items: flex-start; gap: 10px; }
.ac-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.ac-icon.is-low { background: var(--amber-soft); color: var(--amber); }
.ac-icon.is-neg { background: var(--red-soft); color: var(--red); }
.ac-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; letter-spacing: -.01em; }
.ac-qty { display: flex; align-items: baseline; gap: 3px; }
.ac-qty b { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; }
.ac-qty b.low { color: var(--amber); }
.ac-qty b.neg { color: var(--red); }
.ac-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--stroke);
  font-size: var(--fs-xs); color: var(--label-3);
}
.ac-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ac-now { margin-right: auto; }

/* ============ 商品 / 套餐 ============ */
.catalog-head { margin-bottom: 12px; }
.catalog-seg { margin-bottom: 0; }

.catalog-filter-card .card-body { padding: 8px 10px; }
.catalog-filter-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.catalog-search { flex: 0 1 300px; min-width: 210px; transition: flex-basis var(--dur) var(--ease); }
.catalog-search .input { min-height: 36px; padding: 6px 12px 6px 36px; }
.catalog-search > svg { left: 11px; }
.catalog-tags { flex: 1; min-width: 0; }
.catalog-filter-row .chip { min-height: 30px; padding: 3px 10px; font-size: var(--fs-xs); }
.catalog-filter-row .chip-count { font-size: 10.5px; }

.catalog-layout {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.cat-rail {
  position: sticky; top: 24px;
  display: flex; flex-direction: column; gap: 1px;
  max-height: calc(100vh - 48px); overflow-y: auto; padding-right: 2px;
}
.cat-rail-title {
  padding: 0 10px 6px;
  font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .04em; color: var(--label-4);
}
.cat-rail-item {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 7px 10px; border-radius: 10px;
  color: var(--label-2); font-size: var(--fs-sm); text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.cat-rail-item:hover { background: var(--fill); color: var(--label); }
.cat-rail-item.is-active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.cat-rail-item.is-current { color: var(--blue); }
.cat-rail-root { font-weight: 600; color: var(--label); }
.cat-rail-mid {
  padding: 5px 10px 5px 25px;
  font-size: var(--fs-xs); color: var(--label-3);
}
.cat-rail-mid.is-active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.cr-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; flex: none; }
.cr-subdot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .4; flex: none; }
.cat-rail-item.is-active .cr-dot,
.cat-rail-item.is-current .cr-dot,
.cat-rail-mid.is-active .cr-subdot { opacity: 1; }
.cr-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-count { margin-left: auto; font-size: var(--fs-xs); color: var(--label-3); font-weight: 500; }
.cat-rail-item.is-active .cr-count,
.cat-rail-item.is-current .cr-count,
.cat-rail-mid.is-active .cr-count { color: var(--blue); }
.cat-rail-mobile { display: none; }

.root-section { min-width: 0; }
.root-section + .root-section { margin-top: 30px; }
.root-head { display: flex; align-items: center; gap: 8px; margin: 0 2px 12px; }
.root-bar { width: 3px; height: 16px; border-radius: 2px; background: var(--blue); flex: none; }
.root-name { font-size: var(--fs-md); font-weight: 680; letter-spacing: -.02em; }
.root-count {
  padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--fill); color: var(--label-3);
  font-size: var(--fs-xs); font-weight: 600;
}
.root-section .prod-group + .prod-group { margin-top: 20px; }
.prod-group { min-width: 0; }
.pg-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 9px; }
.pg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex: none; }
.pg-name { font-size: var(--fs-sm); font-weight: 650; letter-spacing: -.01em; }
.pg-count {
  padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--fill); color: var(--label-3);
  font-size: var(--fs-xs); font-weight: 600;
}
.pg-rule { flex: 1; height: 1px; background: var(--stroke); }

.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.prod-cell {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke-bright); border-radius: var(--r-md);
  padding: 12px 12px 10px; box-shadow: var(--sh-1);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.prod-cell:hover { background: var(--glass-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }
.pc-open { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; flex: 1; min-width: 0; text-align: left; }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 18px; }
.pc-sku { font-size: 10.5px; color: var(--label-4); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--fs-sm); font-weight: 620; line-height: 1.35; letter-spacing: -.01em;
}
.pc-sub { display: flex; align-items: center; gap: 4px; min-width: 0; line-height: 1.4; }
.pc-sub .truncate { min-width: 0; }
.pc-tags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pc-media { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.pc-info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.pc-thumb {
  width: 46px; height: 46px; border-radius: 11px; flex: none; overflow: hidden;
  background: linear-gradient(160deg, rgba(10,132,255,.14), rgba(90,200,250,.20));
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-deep); font-size: 16px; font-weight: 600;
}
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-cell.is-off .pc-thumb img { filter: grayscale(1); opacity: .72; }
@media (max-width: 520px) {
  .pc-media { gap: 6px; }
  .pc-thumb { width: 36px; height: 36px; border-radius: 9px; font-size: 14px; }
  .pc-info { gap: 3px; }
}
.pc-tag { padding: 1px 7px; font-size: 10.5px; }
.pc-more { font-size: 10.5px; }
.pc-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--stroke); }
.pc-price { font-size: var(--fs-md); font-weight: 660; letter-spacing: -.02em; }
.pc-stock { display: inline-flex; align-items: center; gap: 4px; color: var(--label-3); white-space: nowrap; }
.pc-stock-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.pc-stock.is-low { color: var(--amber); }
.pc-stock.is-neg { color: var(--red); }
.pc-stock.is-none { color: var(--label-4); }
.pc-toggle { margin-left: auto; min-height: 26px; padding: 2px 8px; font-size: var(--fs-xs); flex: none; }

@media (max-width: 899px) {
  .catalog-seg .seg-btn { padding: 6px 12px; font-size: var(--fs-xs); }
  .catalog-filter-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .catalog-search { flex: none; width: 100%; }
  .catalog-layout { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
  .cat-rail { display: flex; }
  .cat-rail-mobile {
    display: none; flex-direction: column; gap: 6px;
    position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 20;
    margin: 0 -16px 14px; padding: 8px 16px;
    background: var(--glass-chrome);
    -webkit-backdrop-filter: var(--blur-chrome);
    backdrop-filter: var(--blur-chrome);
    border-bottom: 1px solid var(--stroke);
  }
  .cat-rail-mobile-row {
    display: flex; gap: 8px; overflow-x: auto;
    scrollbar-width: none;
  }
  .cat-rail-mobile-row::-webkit-scrollbar { display: none; }
  .cat-rail-mobile .chip { flex: none; min-height: 30px; padding: 4px 12px; font-size: var(--fs-xs); }
  .crm-mids { gap: 6px; }
  .crm-mid {
    display: inline-flex; align-items: center; gap: 5px; flex: none;
    min-height: 26px; padding: 3px 9px;
    border: 1px solid var(--stroke); border-radius: var(--r-pill);
    color: var(--label-3); font-size: var(--fs-xs); font-weight: 550;
  }
  .crm-mid span { opacity: .6; font-variant-numeric: tabular-nums; }
  .crm-mid.is-on { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
}

/* Each title is constrained by its own section: roots and middle categories
   stick on separate rows and leave together at the next root boundary. */
.root-section { isolation: isolate; }
.catalog-root-head,
.catalog-mid-head {
  position: sticky;
  margin: 0;
  background: var(--bg);
  box-sizing: border-box;
}
.catalog-root-head {
  top: var(--catalog-category-top, 0px);
  z-index: 12;
  height: 40px;
  padding: 8px 2px;
}
.catalog-mid-head {
  top: calc(var(--catalog-category-top, 0px) + 40px);
  z-index: 11;
  height: 34px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: linear-gradient(var(--glass), var(--glass)), var(--bg);
}
.catalog-root-head .root-name,
.catalog-mid-head .pg-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-root-head .root-count,
.catalog-mid-head .pg-count { flex-shrink: 0; }
.catalog-mid-head + .prod-grid { padding-top: 10px; }
.root-section { scroll-margin-top: var(--catalog-category-top, 0px); }
.root-section .prod-group {
  scroll-margin-top: calc(var(--catalog-category-top, 0px) + 40px);
}
@media (min-width: 900px) {
  .cat-rail {
    top: calc(var(--catalog-toolbar-bottom, 44px) + 12px);
    max-height: calc(100dvh - var(--catalog-toolbar-bottom, 44px) - 24px);
  }
}

@media (max-width: 520px) {
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .prod-cell { padding: 10px 10px 8px; }
}

.combo-cards { display: flex; flex-direction: column; gap: 12px; }
.combo-card {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke-bright);
  border-radius: var(--r-md); padding: 15px 16px;
  box-shadow: var(--sh-1);
}
.cc-head { display: flex; align-items: flex-start; gap: 10px; }
.cc-name { font-weight: 640; font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; letter-spacing: -.01em; }
.cc-parts { margin-top: 3px; line-height: 1.5; }
.cc-price { display: flex; flex-direction: column; align-items: flex-end; }
.cc-price b { font-size: var(--fs-md); letter-spacing: -.02em; }
.cc-price s { color: var(--label-4); }
.cc-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--stroke);
}

.cie-list { display: flex; flex-direction: column; gap: 8px; }
.cie-row { display: flex; gap: 8px; align-items: center; }
.cie-qty { width: 64px; flex: none; text-align: center; }

/* ============ 分类选择 / 标签编辑 / 分类管理 ============ */
.cat-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) {
  .cat-picker { grid-template-columns: 1fr; }
}
.cat-picker .select { min-height: 40px; padding: 8px 30px 8px 11px; font-size: var(--fs-sm); }

.tag-editor {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 44px; padding: 6px 10px;
  background: var(--glass-input);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tag-editor:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3.5px var(--blue-soft); }
.tag-input {
  flex: 1; min-width: 110px; min-height: 30px;
  border: none; background: transparent; outline: none;
  font-size: var(--fs-sm); color: var(--label);
}
.tag-input::placeholder { color: var(--label-4); }
.tag-removable { padding-right: 5px; }
.tag-removable button {
  margin-left: 3px; width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; color: var(--blue);
  background: rgba(10, 132, 255, .16);
}
.tag-removable button:hover { background: rgba(10, 132, 255, .3); }
.tag-suggests { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag-suggest {
  padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--fill); color: var(--label-2); font-size: var(--fs-xs);
}
.tag-suggest:hover { background: var(--blue-soft); color: var(--blue); }

/* 两栏联动（iPad / 桌面） */
.cat-cols {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cat-col {
  display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .45);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  overflow: hidden; min-height: 320px;
}
.cat-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--stroke);
  font-size: var(--fs-xs); font-weight: 650; color: var(--label-3);
  background: rgba(255, 255, 255, .4);
}
.cat-col-head em { font-style: normal; font-weight: 500; }
.cat-col-list { flex: 1; overflow-y: auto; padding: 4px; max-height: 44vh; }
.cat-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 8px; border-radius: 8px; text-align: left;
  color: var(--label); font-size: var(--fs-md);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.cat-item:hover { background: var(--fill); }
.cat-item.is-selected { background: var(--blue-soft); color: var(--blue); }
.cat-item.is-selected .cat-name { font-weight: 650; }
.cat-item .cat-count { color: var(--label-3); }
.cat-item.is-selected .cat-count { color: var(--blue); }
.cat-chev { color: var(--label-4); flex: none; }
.cat-item.is-selected .cat-chev { color: var(--blue); opacity: .6; }
.cat-col-foot {
  display: flex; align-items: center; gap: 2px;
  padding: 6px; border-top: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .4);
}
.cat-col-foot .btn { flex: 1; padding: 5px 4px; font-size: var(--fs-xs); }
.cat-col-foot .btn:disabled { opacity: .35; }

/* 窄屏：面包屑钻取 */
.cat-drill { display: block; }
.cat-crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1px;
  margin-bottom: 10px; font-size: var(--fs-sm);
}
.cat-crumbs button {
  padding: 3px 6px; border-radius: 6px; color: var(--blue); font-weight: 500;
}
.cat-crumbs button:hover { background: var(--blue-soft); }
.cat-crumbs button.is-active { color: var(--label); font-weight: 650; }
.cat-list {
  background: rgba(255, 255, 255, .45);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  overflow: hidden;
}
.cat-row {
  display: flex; align-items: center; gap: 6px;
  padding-right: 6px; border-bottom: 1px solid var(--stroke);
}
.cat-row:last-child { border-bottom: none; }
.cat-item.grow { flex: 1; min-height: 48px; border-radius: 0; }
.cat-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.cat-actions .btn { padding: 4px 8px; font-size: var(--fs-xs); }
.cat-actions .btn:disabled { opacity: .35; }
.cat-sort-hint { margin-top: 10px; line-height: 1.6; }
.cat-sort-row { display: flex; align-items: center; gap: 0; border-radius: 8px; }
.cat-sort-row > .cat-item { flex: 1; min-width: 0; width: auto; }
.cat-sort-row.is-dragging { background: var(--blue-soft); outline: 1px dashed var(--blue); outline-offset: -1px; }
.cat-sort-row.is-dragging > * { opacity: .35; }
.cat-drag-handle {
  display: flex; align-items: center; justify-content: center;
  align-self: stretch; width: 32px; min-height: 40px; flex: none;
  color: var(--label-3); border-radius: 8px;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.cat-drag-handle:hover { color: var(--blue); background: var(--blue-soft); }
.cat-drag-handle:active { cursor: grabbing; }
.cat-drag-handle:disabled { opacity: .3; cursor: default; }
.cat-grip {
  display: inline-block; width: 12px; height: 18px; flex: none;
  background: radial-gradient(circle, currentColor 1.4px, transparent 1.6px) 0 0 / 6px 6px;
}
.cat-drag-ghost {
  position: fixed; z-index: 1000; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  transform: translate(-20px, -50%); max-width: calc(100vw - 24px);
  border: 1px solid var(--blue); border-radius: var(--r-sm);
  background: var(--blue-soft); color: var(--blue); box-shadow: var(--sh-pop);
  font-size: var(--fs-md); font-weight: 650; white-space: nowrap;
}
.cat-edit-row {
  display: flex; align-items: center; gap: 6px;
  padding: 7px; border-bottom: 1px solid var(--stroke);
  background: rgba(10, 132, 255, .05);
}
.cat-edit-row:last-child { border-bottom: none; }
.cat-name {
  display: flex; align-items: center; gap: 7px;
  flex: 1; min-width: 0; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--label-4); }
.cat-dot.lv1 { background: var(--blue); }
.cat-dot.lv2 { background: rgba(10, 132, 255, .55); }
.cat-dot.lv3 { background: rgba(10, 132, 255, .3); }
.cat-count { font-size: var(--fs-xs); color: var(--label-3); min-width: 24px; text-align: right; }
.cat-del { color: var(--label-3); }
.cat-del:hover { color: var(--red); background: var(--red-soft); }
.cat-input { flex: 1; min-height: 36px; padding: 6px 10px; font-size: var(--fs-md); }
.cat-drill-foot { display: flex; gap: 8px; margin-top: 12px; }
.cat-drill-foot .btn { flex: 1; }

@media (min-width: 720px) {
  .cat-cols { display: grid; }
  .cat-drill { display: none; }
}

.tag-add { display: flex; gap: 8px; margin-bottom: 10px; }
.tag-add .input { flex: 1; }
.tag-add .btn { flex: none; }
.tag-manager { max-width: 560px; margin: 0 auto; }
.tag-row { padding: 6px 10px; }
.tag-row .cat-count { margin-left: auto; }
.empty-inline { padding: 18px 0; text-align: center; color: var(--label-3); font-size: var(--fs-sm); }

/* ============ 统计 ============ */
.date-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.date-row .input { flex: 1; min-height: 40px; font-size: var(--fs-sm); }

.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-scroll.is-wide .bars { min-width: 640px; }
.bars-tall { height: 150px; }
.bar-wk { font-size: 8.5px; color: var(--label-4); margin-top: -2px; }
.bar-lbl { font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; margin-bottom: 16px; }
@media (min-width: 760px) { .two-col { grid-template-columns: 1fr 1fr; } }

.legend { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.adj-list { display: flex; flex-direction: column; gap: 8px; }
.adj-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.adj-note { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--stroke); line-height: 1.5; }

/* ============ 设置 ============ */
/* 两三项的键值列表：一行一条，不要撑成 5 列网格（会留一片空灰） */
.info-rows {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--stroke); border-radius: var(--r-sm); overflow: hidden;
}
.info-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 11px 14px; background: rgba(255, 255, 255, .62);
}
.info-row span { font-size: var(--fs-sm); color: var(--label-3); }
.info-row b { font-size: var(--fs-md); font-weight: 620; letter-spacing: -.01em; }

.kv-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--stroke); border-radius: var(--r-sm); overflow: hidden;
}
@media (min-width: 620px) { .kv-grid { grid-template-columns: repeat(5, 1fr); } }
.kv { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: rgba(255, 255, 255, .62); }
.kv span { font-size: var(--fs-xs); color: var(--label-3); }
.kv b { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.02em; }

.rule-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--stroke); }
.rule-row:last-child { border-bottom: none; }
.rule-code {
  flex: none; width: 32px; height: 20px;
  font-size: var(--fs-xs); font-weight: 650;
  color: var(--blue); background: var(--blue-soft);
  border-radius: 6px; text-align: center; line-height: 20px;
}

/* ============ 收款抽屉 ============ */
.pay-amount { text-align: center; padding: 8px 0 4px; }
.pay-amount-label {
  display: block; font-size: var(--fs-xs); font-weight: 550;
  color: var(--label-3); margin-bottom: 4px;
}
.pay-amount-value {
  display: block;
  font-size: clamp(38px, 10vw, 48px); font-weight: 700; line-height: 1.08;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  color: var(--blue-deep);
}
.pay-amount-value i { font-style: normal; font-size: .44em; opacity: .3; margin-right: 3px; vertical-align: .18em; }
.pay-amount-sub { display: block; font-size: var(--fs-xs); color: var(--label-3); margin-top: 4px; }

.channel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.channel {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  color: var(--label-2); font-size: var(--fs-sm); font-weight: 550;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
.channel:hover { background: rgba(255, 255, 255, .85); }
.channel.is-on {
  background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue);
  font-weight: 600;
}
.channel.is-on svg { color: var(--blue); }

.paid-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 14px;
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.paid-row:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3.5px var(--blue-soft); }
.paid-cur { font-size: var(--fs-xl); color: var(--label-3); font-weight: 500; }
.paid-input {
  border: none; background: transparent; padding: 6px 0; min-height: 48px;
  font-size: 30px; font-weight: 700; text-align: right; letter-spacing: -.03em;
  box-shadow: none !important; font-variant-numeric: tabular-nums;
  border-radius: 0;
}
.paid-input:focus { outline: none; }

.diff-panel {
  margin-top: 16px; padding: 14px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 159, 10, .26);
  color: var(--amber);
}
.diff-panel.is-more { border-color: var(--blue-line); color: var(--blue); }
.diff-head { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 620; }
.diff-head b { font-size: var(--fs-lg); letter-spacing: -.02em; }
.diff-tag {
  margin-left: auto; font-size: var(--fs-xs); font-weight: 650;
  padding: 2px 8px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .55);
}
.diff-panel .chip { background: rgba(255, 255, 255, .62); color: inherit; }
.diff-panel .chip.chip-brand.is-on { background: var(--blue); color: #fff; }
.diff-panel .input { background: rgba(255, 255, 255, .7); }

/* ============ 收据 ============ */
.rcp-head { text-align: center; }
.rcp-shop { font-size: var(--fs-sm); font-weight: 650; letter-spacing: -.01em; }
.rcp-no { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rcp-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: var(--fs-sm); }
.rcp-name em { font-style: normal; color: var(--label-3); margin-left: 4px; }
.rcp-gift {
  font-style: normal; font-size: 10px; font-weight: 650;
  color: var(--green); background: var(--green-soft);
  border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 1px;
}
.rcp-amt { font-variant-numeric: tabular-nums; }
.rcp-sum { display: flex; flex-direction: column; gap: 6px; }
.rcp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); color: var(--label-2); }
.rcp-total { padding-top: 7px; border-top: 1px solid var(--stroke); color: var(--label); font-weight: 650; }
.rcp-total b { font-size: var(--fs-xl); letter-spacing: -.02em; }
.rcp-meta { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--label-3); }
.rcp-thanks {
  margin-top: 14px; text-align: center;
  font-size: var(--fs-xs); letter-spacing: .06em; color: var(--label-4);
}

/* ============ 入库 / 盘点 ============ */
.sheet-product {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
}
.big-qty { display: flex; align-items: stretch; gap: 9px; }
.big-qty-btn {
  width: 54px; flex: none;
  background: rgba(255, 255, 255, .8);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  font-size: 22px; font-weight: 500; color: var(--label-2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur) var(--ease);
}
.big-qty-btn:hover { background: #fff; }
.big-qty-btn:active { transform: scale(.96); }
.big-qty-input {
  flex: 1; text-align: center; font-size: 26px; font-weight: 700;
  min-height: 54px; letter-spacing: -.02em;
}

.batch-list {
  max-height: 42vh; overflow-y: auto;
  background: rgba(255, 255, 255, .45);
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
}
.batch-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border-bottom: 1px solid var(--stroke);
}
.batch-row:last-child { border-bottom: none; }
.batch-ctrl { display: flex; align-items: center; gap: 4px; flex: none; }
.batch-btn {
  width: 30px; height: 34px; border-radius: 9px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--stroke); color: var(--label-2);
  font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.batch-btn:hover { background: #fff; }
.batch-input { width: 56px; min-height: 34px; padding: 4px; text-align: center; font-size: var(--fs-md); }
.take-system { display: flex; flex-direction: column; align-items: flex-end; }
.take-system b { font-size: var(--fs-xl); font-weight: 680; letter-spacing: -.02em; }
.take-diff {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 550;
  background: var(--fill); color: var(--label-2);
}
.take-diff.is-same { background: var(--green-soft); color: var(--green); }
.take-diff.is-less { background: var(--amber-soft); color: var(--amber); }
.take-diff.is-more { background: var(--blue-soft); color: var(--blue); }
.take-diff.is-new  { background: var(--blue-soft); color: var(--blue); }

/* ============ 更多菜单 ============ */
.more-mask {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(0, 0, 0, .22);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end;
  animation: fade-in .2s var(--ease);
}
.more-panel {
  width: 100%;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-top: 1px solid var(--stroke-bright);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom) + var(--tabbar-h));
  box-shadow: var(--sh-pop);
  animation: sheet-up .3s var(--ease);
}
.more-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--r-sm);
  font-size: var(--fs-md); font-weight: 550; color: var(--label);
}
.more-item:hover { background: var(--fill); }
.more-item[aria-current="page"] { background: var(--blue-soft); color: var(--blue); font-weight: 620; }
.more-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--fill); color: var(--label-2);
  display: flex; align-items: center; justify-content: center;
}
.more-item[aria-current="page"] .more-icon { background: var(--blue); color: #fff; }
@media (min-width: 900px) { .more-mask { display: none; } }

/* ============================================================
   启动占位 & 登录页
   ============================================================ */
.boot-screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 0 24px;
}
.boot-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.4px solid var(--fill-2); border-top-color: var(--blue);
  animation: boot-spin .8s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }

.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  gap: 18px; padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
  max-width: 460px; margin: 0 auto;
}
.login-hero { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.login-mark {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(180deg, #5FB2FF, #0B5BC4);
  box-shadow: 0 6px 18px rgba(11, 91, 196, .26);
}
.login-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; }
.login-sub { font-size: var(--fs-sm); color: var(--label-3); margin-top: 1px; }

.login-card { margin: 0; }
.login-card .card-body { padding: 16px; }

.login-tabs {
  display: flex; gap: 4px; padding: 3px;
  background: var(--fill); border-radius: var(--r-pill);
  margin-bottom: 14px;
}
.login-tab {
  flex: 1; min-height: 34px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 600; color: var(--label-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.login-tab.is-on {
  background: var(--glass-strong); color: var(--label);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}
.login-hint { margin: 0 2px 16px; line-height: 1.5; }

.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; }
.code-btn {
  flex: none; min-width: 108px;
  background: var(--blue-soft); color: var(--blue);
}
.code-btn:hover:not(:disabled) { background: rgba(10, 132, 255, .18); }

.login-error {
  font-size: var(--fs-sm); color: var(--red); line-height: 1.5;
  background: var(--red-soft); border-radius: var(--r-sm);
  padding: 9px 12px; margin-bottom: 12px;
}
.login-info {
  font-size: var(--fs-sm); color: var(--green); line-height: 1.5;
  background: var(--green-soft); border-radius: var(--r-sm);
  padding: 9px 12px; margin-bottom: 12px;
}
.login-foot { margin: 14px 2px 0; line-height: 1.6; text-align: center; }

/* ============ 商品批量导入 ============ */
/* 输入区用等宽字体：粘贴进来的表格靠 tab 对齐，等宽才看得出列有没有错位 */
.bi-intro {
  font-size: var(--fs-sm); line-height: 1.6; color: var(--label-2);
  margin-bottom: 14px;
}
.bi-intro b { color: var(--label); font-weight: 600; }

.bi-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bi-file { position: relative; overflow: hidden; cursor: pointer; }
.bi-file input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

.bi-help {
  background: var(--fill); border: 1px solid var(--stroke);
  border-radius: var(--r-sm); padding: 11px 13px; margin-bottom: 14px;
}
.bi-help-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 3px 0; font-size: var(--fs-sm);
}
.bi-help-row b { flex: none; min-width: 62px; font-weight: 600; color: var(--label); }
.bi-help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em; background: var(--fill-2);
  border-radius: 4px; padding: 1px 4px;
}
.bi-help .field-hint { margin-top: 9px; line-height: 1.55; }

.bi-textarea {
  min-height: 130px; line-height: 1.7; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-sm); tab-size: 10;
  white-space: pre; overflow-x: auto;
}

.bi-preview { margin-top: 16px; }
.bi-stat {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 8px; border-bottom: 1px solid var(--stroke);
  font-size: var(--fs-sm);
}
.bi-stat-ok   { color: var(--green); font-weight: 600; }
.bi-stat-bad  { color: var(--red);   font-weight: 600; }
.bi-stat-warn { color: var(--amber); font-weight: 600; }

/* 预览区不单独滚动：sheet-body 已经在滚，再套一层手机上很难滑 */
.bi-rows { margin-top: 4px; }
.bi-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid var(--stroke);
}
.bi-row:last-child { border-bottom: none; }
.bi-line {
  flex: none; min-width: 20px; padding-top: 1px;
  text-align: right; color: var(--label-4);
}
.bi-name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.4; }
.bi-sub { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.bi-issue { margin-top: 3px; line-height: 1.45; }
.bi-row.is-bad .bi-name,
.bi-row.is-bad .bi-issue { color: var(--red); }
.bi-row.is-warn .bi-issue { color: var(--amber); }

.bi-check {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 14px; font-size: var(--fs-sm); line-height: 1.5;
  color: var(--label-2); cursor: pointer;
}
.bi-check input { flex: none; margin-top: 3px; accent-color: var(--blue); }

.import-entry { margin-bottom: 12px; }

.bi-char { font-size: 13px; font-weight: 650; line-height: 1; letter-spacing: -.02em; }
.bi-modes { margin-bottom: 14px; }
.bi-file.is-loading { opacity: .6; pointer-events: none; }

.bi-sheet-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 2px 0 10px;
}
.bi-sheet-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--stroke); border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .5);
}
.bi-sheet {
  width: max-content; min-width: 1000px;
  border-collapse: separate; border-spacing: 0;
}
.bi-sheet th {
  padding: 8px 6px; text-align: left; white-space: nowrap;
  font-size: var(--fs-xs); font-weight: 600; color: var(--label-3);
  background: rgba(255, 255, 255, .72);
  border-bottom: 1px solid var(--stroke);
}
.bi-sheet td { padding: 4px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
.bi-sheet tbody tr:last-child td { border-bottom: none; }
.bi-sheet .bi-cell {
  min-height: 32px; height: 32px; padding: 4px 7px;
  font-size: 14px; border-radius: 8px;
}
.bi-sheet select.bi-cell { padding-right: 24px; }
.bi-col-name { width: 170px; }
.bi-col-price { width: 78px; }
.bi-col-stock { width: 88px; }
.bi-col-sku { width: 110px; }
.bi-col-cat-root { width: 110px; }
.bi-col-cat-mid { width: 120px; }
.bi-col-tags { width: 110px; }
.bi-col-act { width: 40px; text-align: center; }
.bi-sheet-no { width: 30px; text-align: right !important; color: var(--label-4); }
.bi-sheet td.bi-sheet-no { padding: 12px 4px 0 0 !important; }
.bi-required { color: var(--red); }
.bi-sheet tr.is-bad .bi-cell { border-color: var(--red-line); background: var(--red-soft); }
.bi-sheet tr.is-warn .bi-cell { border-color: var(--amber-line); background: var(--amber-soft); }
.bi-sheet-issue td {
  padding: 0 6px 7px; border-bottom: 1px solid var(--stroke);
  color: var(--red); font-size: 11.5px;
}
.bi-sheet-issue.is-warn td { color: var(--amber); }
.bi-add-row { margin-top: 8px; }
.bi-sheet-stat { margin-top: 10px; }
.bi-sheet-empty { margin-top: 8px; }
.bi-sheet-hint { display: none; }

@media (max-width: 899px) {
  .bi-sheet .bi-cell { font-size: 16px; }
  .bi-sheet-scroll { margin-right: -2px; margin-left: -2px; }
  .bi-sheet-hint { display: block; margin: 0 0 8px; }
}

/* 移动标题与操作留出呼吸空间，商品区随导航尺寸自动让位。 */
.topbar { gap: 8px; flex-shrink: 0; }
.topbar .brand { gap: 8px; font-size: var(--fs-lg); font-weight: 600; line-height: 1.25; letter-spacing: 0; white-space: nowrap; }
.topbar .brand-mark { width: 28px; height: 28px; border-radius: var(--r-xs); background: var(--blue-soft); color: var(--blue); box-shadow: none; }
.topbar .brand-mark svg { width: 17px; height: 17px; }
.topbar .badge-demo { padding: 2px; background: transparent; font-size: var(--fs-xs); font-weight: 500; line-height: 1.25; white-space: nowrap; }
.topbar .badge-demo.badge-bad { background: var(--amber-soft); border-radius: var(--r-xs); }
.topbar-refresh { display: flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-xs); color: var(--blue); background: var(--blue-soft); }
.topbar-refresh:hover { background: var(--blue-soft); }
.topbar-refresh:disabled { opacity: .45; cursor: wait; }
.topbar-refresh .is-spinning { animation: spin .7s linear infinite; }
.tabbar .tab { gap: 1px; font-size: var(--fs-xs); line-height: 1.25; }
.tabbar .tab svg { width: 18px; height: 18px; }
.tabbar .tab .count-badge { top: 2px; }
/* 开单：左侧分类锚点与商品列表联动，列表标题仅作静态分隔。 */
.v-register { font-family: var(--font-sans); }
.v-register .seg-btn, .v-register .chip { font-weight: 500; line-height: 1.25; }
.v-register .seg-btn.is-on, .v-register .chip[aria-pressed="true"] { font-weight: 600; }
.v-register .pick-bar { padding: 6px 0; margin: -4px 0 10px; background: var(--bg); border-bottom: 0; }
.reg-mode-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 0; }
.reg-mode-row + .reg-filter-row { margin-top: 8px; }
.reg-modes { margin-bottom: 0; padding: 3px; flex: none; }
.reg-mode-row .reg-search-scan { flex: 1; min-width: 0; width: auto; }
.reg-mode-row .catalog-search { flex: 1; min-width: 0; }
.reg-mode-row .input-search .input { padding-left: 28px; padding-right: 28px; }
.reg-mode-row .input-search > svg { left: 8px; }
.reg-mode-row .pick-clear { right: 2px; width: 24px; height: 24px; }
.reg-mode-row .input::-webkit-search-cancel-button { -webkit-appearance: none; }
.reg-search-done { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 44px; height: 36px; padding: 0 8px; color: var(--blue); font-size: var(--fs-sm); font-weight: 600; border-radius: var(--r-xs); }
.reg-search-done:hover { background: var(--blue-soft); }
.reg-modes .seg-btn { min-height: 30px; padding: 4px 12px; font-size: var(--fs-sm); }
.reg-frequent { flex: none; min-height: 34px; padding: 5px 10px; font-size: var(--fs-sm); }
.reg-tag-toggle { min-height: 34px; max-width: 88px; padding: 5px 10px; font-size: var(--fs-sm); }
.reg-tag-toggle span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reg-tag-toggle svg { flex: none; }
.v-register .pick-bar .input { min-height: 36px; height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: var(--fs-sm); font-weight: 400; line-height: 1.25; }
.v-register .reg-filter-row { gap: 6px; }
.v-register .reg-filter-row .catalog-search { min-width: 0; flex-basis: 240px; }
.v-register .reg-filter-row .chips-scroll { gap: 6px; margin-top: 0; margin-bottom: 0; padding-bottom: 0; }
.v-register .reg-filter-row .chip { min-height: 28px; padding: 4px 10px; font-size: var(--fs-sm); }
.v-register .reg-filter-row .chip-count { font-size: var(--fs-xs); font-weight: 500; }
@media (max-width: 899px) {
  .content:has(> .v-register) { padding-top: 10px; }
  .v-register .reg-filter-row { flex-direction: column; align-items: stretch; }
  .v-register .reg-filter-row .catalog-search { flex-basis: auto; width: 100%; }
  .v-register .reg-filter-row .catalog-tags { flex: auto; }
}
@media (max-width: 640px) {
  .v-register .reg-mode-row.is-products { gap: 6px; }
  .reg-modes .seg-btn { padding-right: 7px; padding-left: 7px; }
  .reg-frequent { padding-right: 8px; padding-left: 8px; }
  .reg-frequent > svg { display: none; }
  .reg-tag-toggle { flex: none; width: 58px; max-width: 58px; gap: 3px; padding-right: 6px; padding-left: 6px; }
  /* 输入文字保持 16px，避免 iPhone 聚焦时放大页面。 */
  .v-register .reg-mode-row .input { padding-right: 8px; font-size: 16px; text-overflow: ellipsis; }
  .v-register .reg-mode-row .input::placeholder { font-size: var(--fs-sm); }
  .v-register .reg-mode-row .has-query .input { padding-right: 28px; }
  .reg-mode-row.is-searching > .reg-modes, .reg-mode-row.is-searching > .reg-frequent, .reg-mode-row.is-searching > .reg-tag-toggle { display: none; }
  .reg-mode-row.is-searching .input { text-overflow: clip; }
}
.reg-tag-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reg-tag-option { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; min-height: 68px; padding: 12px; text-align: left; background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--r-sm); }
.reg-tag-option[aria-pressed="true"] { color: var(--blue-deep); background: var(--blue-soft); border-color: var(--blue-line); }
.reg-tag-name { padding-right: 22px; font-size: var(--fs-sm); font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.reg-tag-count { color: var(--label-3); font-size: var(--fs-xs); }
.reg-tag-option > svg { position: absolute; top: 12px; right: 12px; color: var(--blue); }
.reg-tag-all { grid-column: 1 / -1; min-height: 46px; justify-content: center; }
.reg-browse { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: start; }
.reg-products { min-width: 0; }
.v-register .reg-category-rail {
  display: flex; position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top) + var(--reg-toolbar-height));
  max-height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top) - var(--reg-toolbar-height) - var(--tabbar-h) - 92px);
  padding-right: 2px; overscroll-behavior-y: contain;
}
.reg-category-rail .cat-rail-title { padding: 2px 8px 7px; font-size: var(--fs-xs); font-weight: 500; }
.reg-category-rail .cat-rail-item { padding: 7px 6px; gap: 4px; font-size: var(--fs-sm); }
.reg-category-rail .cat-rail-mid { padding: 6px 6px 6px 15px; }
.reg-category-rail .cr-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.reg-category-rail .cr-count { font-size: var(--fs-xs); }
.reg-category-rail .cr-dot, .reg-category-rail .cr-subdot { flex-shrink: 0; }
.v-register .root-section, .v-register .root-section .prod-group { scroll-margin-top: calc(var(--reg-toolbar-height) + 8px); }
.v-register .root-section + .root-section { margin-top: 22px; }
.v-register .root-section .prod-group + .prod-group { margin-top: 18px; }
.reg-group-label { display: flex; align-items: center; gap: 7px; margin: 0 2px 8px; font-size: var(--fs-sm); line-height: 1.25; color: var(--label-3); font-weight: 500; }
.reg-group-label b { color: var(--label-2); font-weight: 600; }
.reg-group-label em { font-size: var(--fs-xs); font-style: normal; margin-left: auto; font-variant-numeric: tabular-nums; }
.v-register .pick-grid { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 108px), 1fr)); }
@media (max-width: 640px) {
  /* 手机上固定两列，三列会把名字和库存挤成两行 */
  .v-register .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.v-register .pick-cell { --pick-card-height: 156px; container-type: inline-size; height: var(--pick-card-height); min-height: 0; padding: 7px; box-shadow: none; background: var(--glass-strong); border-color: var(--stroke); }
.v-register .pick-cell:active { transform: none; }
.v-register .pick-cell.has-qty { background: linear-gradient(var(--blue-soft), var(--blue-soft)), var(--bg); border-color: var(--blue-line); }
.pick-product-main { display: flex; flex-direction: column; align-items: stretch; text-align: left; width: 100%; height: 100%; min-width: 0; }
.v-register .pick-name {
  flex: none; width: 100%; height: auto; margin-top: 4px; padding-bottom: 0;
  font-size: var(--fs-sm); line-height: 1.25; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.v-register .pick-head { display: flex; align-items: center; gap: 4px; min-width: 0; }
.v-register .pick-figures { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.v-register .pick-head .pick-price { font-size: var(--fs-sm); font-weight: 600; margin: 0; line-height: 1.25; white-space: nowrap; }
.v-register .pick-head .pick-stock { font-size: var(--fs-xs); line-height: 1.25; white-space: nowrap; }
/* 已加进本单：加减横排在右下，价格/库存保持可见，名称占满整行 */
.v-register .pick-quantity {
  flex-direction: row; gap: 3px; padding: 0;
  border-radius: var(--r-pill); background: var(--bg);
}
.v-register .pick-quantity button { width: 28px; height: 28px; }
.v-register .pick-quantity b { font-size: var(--fs-sm); font-weight: 600; line-height: 1.25; }
.v-register .pick-thumb {
  width: min(clamp(54px, calc(100cqw - 40px), 72px), calc(var(--pick-card-height) - 84px)); aspect-ratio: 1; border-radius: 11px; flex: none; overflow: hidden;
  background: linear-gradient(160deg, rgba(10,132,255,.14), rgba(90,200,250,.20));
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-deep); font-size: var(--fs-sm); font-weight: 600;
}
.v-register .pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v-register .pick-price { font-size: var(--fs-lg); line-height: 1.3; margin-top: 2px; }
.v-register .pick-stock { line-height: 1.3; margin-top: 0; }
@media (max-width: 640px) {
  /* 控制单卡高度，手机保持两列、常用屏高约三至四行。 */
  .v-register .pick-cell { --pick-card-height: clamp(138px, 18dvh, 156px); }
}
@media (max-width: 360px) {
  .topbar { gap: 6px; }
  .topbar .brand { font-size: var(--fs-md); }
  /* 窄屏略收分类栏，给两列商品的大图与价格留出空间。 */
  .v-register .reg-browse { grid-template-columns: 66px minmax(0, 1fr); gap: 8px; }
  .v-register .pick-cell { padding: 6px; }
}
.pick-add, .pick-quantity { position: absolute; right: 7px; bottom: 7px; display: flex; align-items: center; justify-content: center; }
.pick-add, .pick-quantity button { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); }
.pick-quantity { gap: 4px; border-radius: var(--r-pill); background: var(--bg); }
.pick-quantity b { min-width: 18px; text-align: center; color: var(--blue-deep); font-size: var(--fs-sm); }
.pick-quantity button:first-child { background: transparent; }
.v-register .cart-panel { box-shadow: none; border-color: var(--stroke); }
.v-register .cart-head, .v-register .cart-foot { flex-shrink: 0; }
.v-register .cart-body { min-height: 0; }
.v-register .cart-total { color: var(--label); }
.v-register .cart-head { padding: 10px 12px; gap: 6px; }
.v-register .cart-head h3 { font-size: var(--fs-sm); gap: 4px; }
.v-register .cart-head .small { font-size: var(--fs-xs); }
.v-register .cart-head .btn { min-height: 26px; padding: 3px 6px; font-size: var(--fs-xs); }
.v-register .cart-head .btn-icon { min-width: 28px; }
.v-register .cart-body { padding: 5px 12px; }
.v-register .cart-line { padding: 9px 0; }
.v-register .cl-name { font-size: var(--fs-sm); font-weight: 600; }
.v-register .cl-del { width: 24px; height: 24px; }
.v-register .cl-bottom { gap: 6px; margin-top: 5px; }
.v-register .cl-right { gap: 6px; }
.v-register .gift-check { gap: 4px; }
.v-register .gift-check .xs { font-size: var(--fs-xs); }
.v-register .gift-check .switch-track { width: 28px; height: 16px; }
.v-register .gift-check .switch-track::after { width: 12px; height: 12px; top: 2px; left: 2px; }
.v-register .gift-check input:checked + .switch-track::after { transform: translateX(12px); }
.v-register .cl-price-input { width: 54px; min-height: 30px; padding: 3px 6px; font-size: var(--fs-sm); text-align: center; }
.v-register .stepper { padding: 2px; }
.v-register .stepper button { width: 28px; height: 28px; }
.v-register .stepper-input { width: 28px; min-width: 28px; min-height: 28px; font-size: var(--fs-sm); font-weight: 600; }
.v-register .cl-amt { min-width: 44px; font-size: var(--fs-sm); }
.v-register .cart-body .field .input { min-height: 34px; padding: 6px 10px; font-size: var(--fs-sm); }
.v-register .cart-foot { padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); }
.v-register .cart-total-row { margin-bottom: 8px; }
.v-register .cart-total-label { font-size: var(--fs-xs); }
.v-register .cart-total { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.012em; line-height: 1.25; }
.v-register .cart-actions { gap: 7px; }
.v-register .cart-actions .btn { min-height: 40px; padding: 7px 18px; font-size: var(--fs-md); font-weight: 600; line-height: 1.25; }
.v-register .cart-actions .btn svg { width: 16px; height: 16px; }
.v-register .cart-foot > .xs { font-size: var(--fs-xs); }
@media (max-width: 520px) {
  .v-register .cl-price-input, .v-register .stepper-input,
  .v-register .cart-body .field .input { font-size: 16px; }
  .v-register .cart-actions .btn { min-height: 44px; }
}
.v-register .cart-bar { background: var(--glass-chrome); color: var(--label); border-radius: var(--r-md); box-shadow: var(--sh-2); border: 1px solid var(--stroke); }
.cart-summary { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; text-align: left; }
.cart-summary .cart-bar-count { color: var(--bg); }
.cart-summary .cart-bar-text em { opacity: 1; color: var(--label-3); }
.v-register .cart-bar-count { font-size: var(--fs-sm); font-weight: 600; }
.v-register .cart-bar-text b { font-weight: 600; line-height: 1.25; letter-spacing: -.012em; }
.v-register .cart-bar-text em { font-size: var(--fs-xs); line-height: 1.25; }
.cart-direct-pay { min-width: 80px; border-radius: var(--r-pill); }
.cart-direct-scan { flex: none; min-width: 80px; min-height: 44px; border-radius: var(--r-pill); background: var(--blue-deep); color: #fff; box-shadow: 0 4px 12px rgba(11, 91, 196, .26), inset 0 1px 0 rgba(255, 255, 255, .18); }
.cart-direct-scan:hover { background: var(--blue-deep); filter: brightness(1.08); }
.cart-direct-scan:active { filter: brightness(.94); }
.cart-bar .cart-direct-pay, .cart-bar .cart-direct-scan { flex: 0 0 80px; width: 80px; min-height: 44px; font-size: var(--fs-md); font-weight: 600; line-height: 1.25; }
.cart-bar .cart-bar-text { min-width: 0; }
.cart-bar .cart-bar-text b, .cart-bar .cart-bar-text em { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 899px) {
  .v-register { padding-bottom: 90px; }
  .v-register .root-section:last-child > .prod-group:last-child { min-height: calc(var(--reg-pane-height) - var(--reg-toolbar-height) - var(--topbar-h)); }
}
@media (min-width: 900px) {
  .content:has(> .v-register) { padding-bottom: 30px; }
  .v-register .reg-layout { gap: 18px; grid-template-columns: minmax(0, 1fr) 320px; }
  .v-register .reg-pick { height: calc(100dvh - 60px); overflow-y: auto; overscroll-behavior-y: contain; padding-right: 8px; scrollbar-width: thin; }
  .v-register .pick-bar { top: 0; margin-top: 0; padding-top: 0; z-index: 15; }
  .reg-browse { grid-template-columns: 126px minmax(0, 1fr); gap: 14px; }
  .v-register .reg-category-rail { top: var(--reg-toolbar-height); max-height: calc(var(--reg-pane-height) - var(--reg-toolbar-height) - 12px); }
  .reg-category-rail .cat-rail-item { padding: 7px 8px; font-size: var(--fs-sm); }
  .reg-category-rail .cat-rail-mid { padding: 6px 8px 6px 20px; font-size: var(--fs-sm); }
  .v-register .reg-cart { top: 30px; }
  .v-register .cart-panel { max-height: calc(100dvh - 60px); }
  .v-register .cart-body { max-height: none; overflow-y: auto; }
  .v-register .root-section:last-child > .prod-group:last-child { min-height: calc(var(--reg-pane-height) - var(--reg-toolbar-height) - 8px); }
}

.reg-cart-close, .reg-cart-backdrop { display: none; }
@media (max-width: 899px) {
  .reg-cart-close { display: inline-flex; }
  .reg-cart-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: var(--fill-2); }
  .v-register .reg-cart.is-keyboard-open { bottom: calc(var(--cart-keyboard-bottom) + 8px); }
  .v-register .reg-cart.is-keyboard-open .cart-panel { max-height: calc(var(--cart-visible-height) - 24px); }
  .v-register .reg-cart.is-keyboard-open .cart-body { flex: 1; min-height: 0; max-height: none; }
  .v-register .reg-cart.is-keyboard-open .cart-foot { padding-bottom: 8px; }
}

@media (min-width: 521px) and (max-width: 899px) { .reg-browse { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; } }
@media (max-width: 520px) { .reg-category-rail .cr-count { display: none; } }

/* 商品管理沿用开单的左侧锚点浏览，保留编辑、上下架和标签筛选。 */
.v-catalog .catalog-sticky { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 25; padding: 8px 0; margin: -8px 0 10px; background: var(--bg); }
.v-catalog .catalog-head { margin-bottom: 7px; }
.v-catalog .catalog-seg .seg-btn { min-height: 28px; padding: 3px 10px; font-size: var(--fs-sm); }
.v-catalog .catalog-actions .btn { min-height: 30px; min-width: 30px; padding: 4px; }
.v-catalog .catalog-filter-card { background: transparent; border: 0; box-shadow: none; margin: 0; }
.v-catalog .catalog-filter-card .card-body { padding: 0; }
.v-catalog .catalog-filter-row { gap: 6px; }
.v-catalog .catalog-search { min-width: 0; }
.v-catalog .catalog-search .input { height: 32px; min-height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: var(--fs-sm); }
.v-catalog .catalog-filter-row .chip { min-height: 26px; padding: 3px 9px; }
.v-catalog .catalog-layout { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: start; }
.v-catalog .catalog-main { min-width: 0; }
.v-catalog .catalog-category-rail { display: flex; top: calc(var(--topbar-h) + env(safe-area-inset-top) + var(--catalog-toolbar-height)); max-height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top) - var(--catalog-toolbar-height) - var(--tabbar-h) - 24px); overscroll-behavior-y: contain; }
.catalog-category-rail .cat-rail-title { padding: 2px 8px 7px; }
.catalog-category-rail .cat-rail-item { padding: 7px 6px; gap: 4px; font-size: var(--fs-xs); }
.catalog-category-rail .cat-rail-mid { padding: 6px 6px 6px 15px; }
.catalog-category-rail .cr-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.catalog-category-rail .cr-count { font-size: 10px; }
.catalog-category-rail .cr-dot, .catalog-category-rail .cr-subdot { flex-shrink: 0; }
.catalog-group-label { display: flex; align-items: center; gap: 7px; margin: 0 2px 8px; font-size: var(--fs-xs); color: var(--label-3); font-weight: 500; }
.catalog-group-label b { color: var(--label-2); font-weight: 600; }
.catalog-group-label em { font-style: normal; margin-left: auto; font-variant-numeric: tabular-nums; }
.v-catalog .root-section, .v-catalog .root-section .prod-group { scroll-margin-top: calc(var(--catalog-toolbar-height) + 8px); }
.v-catalog .root-section + .root-section { margin-top: 22px; }
.v-catalog .root-section .prod-group + .prod-group { margin-top: 18px; }
.v-catalog .prod-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 8px; }
.v-catalog .prod-cell { background: var(--glass-strong); box-shadow: none; border-color: var(--stroke); }
.v-catalog .prod-cell:hover { box-shadow: none; }
.v-catalog .root-section:last-child > .prod-group:last-child { min-height: calc(var(--catalog-pane-height) - var(--catalog-toolbar-height) - var(--topbar-h)); }
@media (max-width: 520px) {
  .catalog-category-rail .cr-count { display: none; }
  .v-catalog .catalog-layout { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
  .catalog-category-rail .cat-rail-item { padding: 6px 4px; }
  .catalog-category-rail .cat-rail-mid { padding: 5px 4px 5px 12px; }
  .v-catalog .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .v-catalog .prod-cell { padding: 9px 9px 8px; border-radius: var(--r-sm); }
  .v-catalog .pc-open { gap: 3px; }
  .v-catalog .pc-name { font-size: var(--fs-sm); line-height: 1.3; }
  .v-catalog .pc-sub { display: none; }
  .v-catalog .pc-tags { gap: 3px; }
  .v-catalog .pc-tag { padding: 0 5px; font-size: 10.5px; }
  .v-catalog .pc-more { font-size: 10.5px; }
  .v-catalog .pc-foot { gap: 4px; margin-top: 6px; padding-top: 6px; flex-wrap: wrap; }
  .v-catalog .pc-price { font-size: var(--fs-md); }
  .v-catalog .pc-stock { gap: 2px; font-size: 10.5px; }
  .v-catalog .pc-toggle { min-height: 22px; padding: 1px 4px; font-size: 10.5px; }
}
@media (max-width: 380px) {
  .v-catalog .pc-foot { gap: 3px; }
  .v-catalog .pc-toggle { padding: 1px 3px; }
}
@media (max-width: 350px) {
  .v-catalog .prod-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 521px) and (max-width: 899px) { .v-catalog .catalog-layout { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; } }
@media (min-width: 900px) {
  .content:has(> .v-catalog) { padding-bottom: 30px; }
  .v-catalog { height: calc(100dvh - 60px); overflow-y: auto; overscroll-behavior-y: contain; padding-right: 8px; scrollbar-width: thin; }
  .v-catalog .catalog-sticky { top: 0; margin-top: 0; padding-top: 0; }
  .v-catalog .catalog-layout { grid-template-columns: 140px minmax(0, 1fr); gap: 18px; }
  .v-catalog .catalog-category-rail { top: var(--catalog-toolbar-height); max-height: calc(var(--catalog-pane-height) - var(--catalog-toolbar-height) - 12px); }
  .catalog-category-rail .cat-rail-item { padding: 7px 8px; font-size: var(--fs-sm); }
  .catalog-category-rail .cat-rail-mid { padding: 6px 8px 6px 20px; font-size: var(--fs-xs); }
  .v-catalog .root-section:last-child > .prod-group:last-child { min-height: calc(var(--catalog-pane-height) - var(--catalog-toolbar-height) - 8px); }
}

/* 商品条码绑定与开单扫码 */
.reg-search-scan { display: flex; align-items: center; gap: 6px; flex: 0 1 280px; min-width: 0; }
.v-register .reg-search-scan .catalog-search { flex: 1; min-width: 0; width: auto; }
.reg-scan-button { flex: none; min-height: 34px; color: var(--blue); background: var(--blue-soft); }
.barcode-scanner { margin-top: 10px; }
/* 年月日时分同排显示，滚轮内的拖动不传递给收款页。 */
.time-wheel { position: relative; margin-top: 6px; padding: 1px 6px; isolation: isolate; }
.time-wheel-band { position: absolute; left: 5px; right: 5px; top: 33px; height: 32px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--label-2) 6%, transparent); z-index: -1; pointer-events: none; }
.time-wheel-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr)) 10px repeat(2, minmax(0, 1fr)); gap: 2px; }
.time-wheel-column { position: relative; min-width: 0; }
.time-wheel-column:nth-child(4) { grid-column: 5; }
.time-wheel-unit { position: absolute; right: 0; top: 32px; width: 16px; line-height: 32px; text-align: center; color: var(--label-2); font-size: var(--fs-xs); font-weight: 400; pointer-events: none; }
.time-wheel-column:nth-child(-n+3) .time-wheel-track { padding-right: 16px; }
.time-wheel-column:nth-child(4) .time-wheel-unit { right: -9px; font-size: var(--fs-md); }
.time-wheel-track { height: 96px; padding-block: 32px; overflow-y: auto; overscroll-behavior-y: contain; scroll-snap-type: y mandatory; scrollbar-width: none; touch-action: pan-y; -webkit-mask-image: linear-gradient(transparent, black 32%, black 68%, transparent); mask-image: linear-gradient(transparent, black 32%, black 68%, transparent); }
.time-wheel-track.is-dragging { scroll-snap-type: none; }
.time-wheel-track::-webkit-scrollbar { display: none; }
.time-wheel-option { height: 32px; line-height: 32px; text-align: center; font-size: var(--fs-lg); font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--label-4); scroll-snap-align: center; user-select: none; cursor: pointer; }
.time-wheel-option.is-selected { color: var(--label); font-weight: 400; }
.time-wheel-column:first-child .time-wheel-option { font-size: 16px; }
.time-wheel.is-disabled { pointer-events: none; opacity: .6; }
.barcode-camera { position: relative; overflow: hidden; aspect-ratio: 16 / 9; max-height: 260px; border-radius: var(--r-sm); background: var(--fill-2); }
.barcode-camera video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.barcode-camera:not(.is-running) video { visibility: hidden; }
.barcode-camera-hint { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; font-size: var(--fs-sm); color: var(--label-2); }
.barcode-frame { position: absolute; inset: 24% 8%; border: 2px solid var(--blue); border-radius: var(--r-sm); pointer-events: none; }
.barcode-camera-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.barcode-camera-actions .select { flex: 1; min-width: 0; font-size: var(--fs-sm); min-height: 32px; }
.barcode-message { font-size: var(--fs-sm); line-height: 1.5; margin: 10px 0 5px; overflow-wrap: anywhere; }
.barcode-message.is-warn { color: var(--red); }
.barcode-message.is-ok { color: var(--green); }
.barcode-feedback { margin: 10px 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--fill); }
.barcode-feedback.is-ok { font-size: var(--fs-xl); font-weight: 650; line-height: 1.45; background: var(--green-soft); }
.barcode-summary { margin: 10px 0; border: 1px solid var(--stroke); border-radius: var(--r-sm); overflow: hidden; }
.barcode-summary-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 8px 10px; background: var(--fill); font-size: var(--fs-sm); }
.barcode-summary-head span { color: var(--label-2); font-size: var(--fs-xs); }
.barcode-summary-list { max-height: 166px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; }
.barcode-summary table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--fs-sm); }
.barcode-summary th, .barcode-summary td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--stroke); overflow-wrap: anywhere; }
.barcode-summary th { position: sticky; top: 0; z-index: 1; background: var(--bg); color: var(--label-2); font-size: var(--fs-xs); font-weight: 500; }
.barcode-summary th:last-child, .barcode-summary td:last-child { width: 142px; text-align: right; white-space: nowrap; }
.barcode-quantity { display: inline-flex; align-items: center; justify-content: space-between; gap: 4px; vertical-align: middle; }
.barcode-quantity button { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--stroke); border-radius: var(--r-pill); background: var(--fill); color: var(--blue); font-size: var(--fs-lg); touch-action: manipulation; }
.barcode-quantity button:disabled { opacity: .35; cursor: default; }
.barcode-quantity b { min-width: 25px; text-align: center; }
.barcode-summary td b { font-size: var(--fs-lg); }
.barcode-summary td span { margin-left: 5px; color: var(--label-2); font-size: var(--fs-xs); }
.barcode-summary tbody tr:last-child td { border-bottom: 0; }
.barcode-summary-empty { padding: 10px; margin: 0; color: var(--label-2); font-size: var(--fs-sm); }
.barcode-manual { display: flex; align-items: center; gap: 7px; margin-top: 10px; }
.barcode-manual .input { flex: 1; min-width: 0; }
.barcode-manual .btn { flex: none; }
@media (max-width: 899px) {
  .reg-search-scan { flex: none; width: 100%; }
}
.product-barcode { margin-top: 8px; }
.product-barcode-preview { background: white; border: 1px solid var(--stroke); border-radius: var(--r-sm); overflow-x: auto; padding: 5px; margin-bottom: 7px; }
.product-barcode-preview svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }

.barcode-success {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 9px;
  background: var(--glass-strong); color: var(--green);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  animation: barcode-success-flash .5s ease both;
}
.barcode-success-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--green-soft); }
.barcode-success-icon svg { width: 48px; height: 48px; }
.barcode-success-icon path { stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 45; stroke-dashoffset: 45; animation: barcode-success-tick .22s .04s ease-out forwards; }
.barcode-success strong { font-size: var(--fs-lg); font-weight: 650; }
@keyframes barcode-success-flash { 0% { opacity: 0; } 15%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes barcode-success-tick { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .barcode-success { animation: none; }
  .barcode-success-icon path { animation: none; stroke-dashoffset: 0; }
}

/* 收款码仅作为账户配置保存，不随公开代码发布。 */
.payment-code { margin: 10px 0; }
.payment-code-open { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 100%; padding: 10px; background: var(--fill); border-radius: var(--r-sm); }
.payment-code-open img { display: block; width: auto; max-width: 100%; height: 220px; object-fit: contain; background: white; }
.payment-code-open span { font-size: var(--fs-xs); color: var(--blue); font-weight: 600; }
.payment-code-overlay { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); background: var(--bg); }
.payment-code-large-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: min(100%, 680px); flex-shrink: 0; }
.payment-code-overlay > img { display: block; max-width: 100%; max-height: 68dvh; min-height: 0; object-fit: contain; }
.payment-code-amount { font-size: var(--fs-lg); }
.payment-code-amount b { font-size: 28px; margin-left: 6px; }
.payment-code-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.payment-code-file { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
@media (max-width: 520px) { .payment-code-settings { grid-template-columns: minmax(0, 1fr); } .payment-code-open img { height: 200px; } }

/* 平板横屏与桌面：右上常驻扫码，本单明细在下方独立滚动。 */
.reg-scan-dock { padding: 10px 12px; border-bottom: 1px solid var(--stroke); flex-shrink: 0; }
.reg-scan-dock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); line-height: 1.25; }
.reg-scan-dock-head b { font-weight: 600; }
.reg-scan-dock-head span { color: var(--label-3); font-size: var(--fs-xs); }
.reg-dock-scanner { margin-top: 7px; }
.reg-dock-scanner .barcode-camera { height: clamp(110px, 17dvh, 180px); max-height: none; aspect-ratio: auto; }
.reg-dock-scanner .barcode-camera-hint { padding: 12px; font-size: var(--fs-xs); }
.reg-dock-scanner .barcode-camera-actions { gap: 5px; margin-top: 6px; }
.reg-dock-scanner .barcode-camera-actions .btn, .reg-dock-scanner .barcode-camera-actions .select { min-height: 28px; padding: 3px 6px; font-size: var(--fs-xs); font-weight: 500; }
.reg-dock-scanner .barcode-message { font-size: var(--fs-xs); line-height: 1.4; margin: 6px 0 0; }
.reg-dock-scanner .barcode-feedback { padding: 7px 9px; }
.reg-dock-scanner .barcode-feedback.is-ok { font-size: var(--fs-lg); }
.reg-dock-scanner .barcode-summary { margin: 7px 0; }
.reg-dock-scanner .barcode-summary-head { padding: 5px 8px; }
.reg-dock-scanner .barcode-summary-list { max-height: 108px; }
.reg-dock-scanner .barcode-summary th, .reg-dock-scanner .barcode-summary td { padding: 5px 8px; }
.reg-dock-scanner .barcode-summary td b { font-size: var(--fs-md); }
.reg-dock-scanner > .field-hint { display: none; }
.reg-dock-scanner .barcode-manual { margin-top: 7px; gap: 5px; }
.reg-dock-scanner .barcode-manual .input, .reg-dock-scanner .barcode-manual .btn { min-height: 30px; padding: 4px 8px; font-size: var(--fs-xs); }
.reg-dock-scanner .barcode-success-icon { width: 52px; height: 52px; }
.reg-dock-scanner .barcode-success strong { font-size: var(--fs-sm); font-weight: 600; }
@media (min-width: 900px) {
  .v-register .cart-panel { height: calc(100dvh - 60px); }
  .v-register .cart-body { flex: 1; min-height: 0; }
}

/* 管理平台的桌面列表；窄屏保留原有布局与操作。 */
.admin-desktop-list { display: none; }
@media (min-width: 900px) {
  .admin-shell .admin-mobile-list { display: none; }
  .admin-shell .admin-desktop-list { display: block; }
  .admin-shell .catalog-actions .btn-icon { width: auto; min-width: 0; padding: 0 14px; gap: 6px; }
  .admin-shell .catalog-actions .admin-action-label { display: inline; white-space: nowrap; }
  .admin-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--stroke); border-radius: var(--r-md); box-shadow: var(--sh-1); }
  .admin-list-caption { padding: 18px 20px; font-size: 15px; font-weight: 650; }
  .admin-list-caption span { margin-left: 10px; color: var(--label-3); font-size: 12px; font-weight: 400; }
  .admin-table { width: 100%; min-width: 850px; border-collapse: collapse; text-align: left; font-size: 13px; }
  .admin-table th { background: var(--fill); color: var(--label-2); font-weight: 600; white-space: nowrap; }
  .admin-table th, .admin-table td { padding: 13px 16px; border-bottom: 1px solid var(--stroke); vertical-align: middle; }
  .admin-table tbody tr:last-child td { border-bottom: 0; }
  .admin-table tbody tr:hover { background: var(--blue-soft); }
  .admin-product { display: flex; align-items: center; gap: 10px; min-width: 150px; }
  .admin-product-thumb { display: grid; place-items: center; width: 64px; height: 64px; flex: none; overflow: hidden; border-radius: 8px; background: var(--blue-soft); color: var(--blue); }
  .admin-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .admin-sub { color: var(--label-3); font-size: 12px; margin-top: 4px; }
  .admin-row-actions { white-space: nowrap; }
  .admin-action { color: var(--blue); font-size: 13px; padding: 6px 4px; cursor: pointer; }
  .admin-action + .admin-action { margin-left: 10px; }
  .admin-action:hover { text-decoration: underline; }
  .admin-table-footer { padding: 16px; text-align: center; }
}
@media (max-width: 899px) { .admin-action-label { display: none; } }

@media (min-width: 900px) {
  .admin-shell .admin-catalog-layout.admin-desktop-list { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: start; }
  .admin-category-panel { padding: 12px 8px; background: #fff; border: 1px solid var(--stroke); border-radius: var(--r-md); }
  .admin-category-title { padding: 5px 10px 12px; font-size: 14px; font-weight: 650; }
  .admin-category-item { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 8px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--label-2); text-align: left; font-size: 13px; cursor: pointer; }
  .admin-category-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-category-item span:last-child { color: var(--label-3); font-size: 12px; }
  .admin-category-item:hover { background: var(--fill); }
  .admin-category-item.is-selected { color: var(--blue); background: var(--blue-soft); font-weight: 600; }
  .admin-category-child { padding-left: 24px; }
  .admin-catalog-empty { padding: 55px 20px; text-align: center; color: var(--label-3); font-size: 13px; }
}

/* 管理端桌面工作区 */
.admin-workbar { display: none; }
@media (min-width: 900px) {
  body:has(.admin-shell) { background: #f3f5f8; }
  .admin-shell { --sidebar-w: 212px; --r-md: 6px; --r-sm: 4px; --sh-1: none; --content-max: 100%; }
  .admin-shell .sidebar { background: #172338; color: #c7d1e0; border: 0; padding: 22px 12px; backdrop-filter: none; }
  .admin-shell .sidebar .brand, .admin-shell .sidebar .side-brand-name { color: #fff; }
  .admin-shell .sidebar .brand-sub, .admin-shell .sidebar .muted { color: #91a2b9; }
  .admin-shell .side-link { color: #becadd; border-radius: 4px; margin: 2px 0; }
  .admin-shell .side-link svg { color: inherit; }
  .admin-shell .side-link:hover { background: #233650; color: #fff; }
  .admin-shell .side-link[aria-current="page"] { background: #2469d8; color: #fff; }
  .admin-shell .side-brand, .admin-shell .side-foot { border-color: #314057; }
  .admin-shell .admin-workbar { position: fixed; top: 0; left: var(--sidebar-w); right: 0; z-index: 30; height: 60px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid #e3e8ef; font-size: 14px; }
  .admin-workbar-brand { font-weight: 650; }
  .admin-workbar-divider { margin: 0 18px; color: #b6bfcc; }
  .admin-shell .content { max-width: none; min-width: 0; padding: 84px 28px 36px; }
  .admin-shell .v-catalog { height: auto; overflow: visible; padding-right: 0; }
  .admin-shell .catalog-sticky { position: static; background: transparent; backdrop-filter: none; padding: 0; margin: 0; box-shadow: none; }
  .admin-shell .page-title { font-size: 22px; }
  .admin-shell .page-head { margin-bottom: 20px; }
  .admin-shell .card, .admin-shell .admin-table-wrap, .admin-shell .admin-category-panel { border-color: #e1e6ed; box-shadow: none; background: #fff; backdrop-filter: none; border-radius: 6px; }
  .admin-shell .catalog-seg { background: none; padding: 0; border-radius: 0; box-shadow: none; gap: 24px; }
  .admin-shell .catalog-seg .seg-btn { background: none; border-radius: 0; box-shadow: none; padding: 10px 0; border-bottom: 1px solid transparent; color: #657389; font-size: 17px; }
  .admin-shell .catalog-seg .seg-btn.is-on { border-bottom-color: #2469d8; color: #2469d8; }
  .admin-shell .filter-card { margin-bottom: 20px; }
  .admin-shell .filter-card .card-body { padding: 16px 20px; }
  .admin-shell .catalog-filter-row { align-items: center; flex-wrap: wrap; gap: 14px; }
  .admin-shell .catalog-search { flex: 0 1 360px; width: 360px; }
  .admin-shell .input { border-radius: 4px; min-height: 34px; font-size: 13px; }
  .admin-shell .btn { border-radius: 4px; min-height: 34px; font-size: 13px; box-shadow: none; }
  .admin-shell .chip { border-radius: 4px; min-height: 28px; font-size: 12px; }
  .admin-shell .admin-table { min-width: 780px; }
  .admin-shell .admin-table th { background: #f7f9fc; color: #56647a; }
  .admin-shell .admin-table th, .admin-shell .admin-table td { padding: 12px 16px; }
  .admin-shell .admin-category-panel {
    min-height: 340px;
    position: sticky;
    top: 56px;
    align-self: start;
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* 宽屏商品表：分类栏、列表标题和表头一起吸顶，紧贴工作栏 */
@media (min-width: 1100px) {
  .admin-shell .v-catalog .admin-table-wrap { overflow: visible; }
  .admin-shell .v-catalog .admin-list-caption {
    position: sticky;
    top: 56px;
    z-index: 4;
    height: 49px;
    background: #fff;
  }
  .admin-shell .v-catalog .admin-table thead th {
    position: sticky;
    top: 105px;
    z-index: 3;
    background: #f8fafc;
    box-shadow: 0 1px 0 #e4e9f1;
  }
}

.admin-image-info { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: none; }
.admin-image-size { font-size: 11px; color: var(--label-3); white-space: nowrap; }

/* ============================================================
   管理后台桌面视觉（2026-10-30）
   浅色工作区 + 深色导航 + 紧凑表格 + 数据工作台
   ============================================================ */
@media (min-width: 900px) {
  body:has(.admin-shell) { background: #f3f5f9; }
  .admin-shell {
    --sidebar-w: 220px;
    --r-md: 8px;
    --r-sm: 6px;
    --sh-1: none;
    --content-max: 100%;
    background: #f3f5f9;
  }
  .admin-shell .sidebar { padding: 18px 12px 14px; background: #0f1b2d; color: #c7d1e0; }
  .admin-shell .side-brand { padding: 4px 8px 16px; }
  .admin-shell .side-brand .brand { gap: 10px; }
  .admin-shell .side-brand .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .admin-shell .side-brand-name { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
  .admin-shell .brand-sub { margin-top: 3px; color: #8799b1; font-size: 10.5px; letter-spacing: .08em; }
  .admin-shell .badge-demo { display: inline-flex; width: auto; margin-top: 12px; padding: 4px 9px; border: 1px solid #263a54; border-radius: 999px; background: #142238; color: #a9b8cc; font-size: 10.5px; }
  .admin-shell .side-nav { flex: 1; overflow-y: auto; padding: 2px 0 8px; }
  .admin-shell .side-group { padding: 14px 10px 5px; color: #687d98; font-size: 10px; font-weight: 650; letter-spacing: .1em; }
  .admin-shell .side-link { min-height: 38px; margin: 1px 0; padding: 8px 10px; gap: 10px; border-radius: 6px; color: #b9c6d8; font-size: 13px; }
  .admin-shell .side-link svg { color: #8fa3bd; }
  .admin-shell .side-link:hover { background: #1a2b44; color: #fff; }
  .admin-shell .side-link:hover svg { color: #d5e2f3; }
  .admin-shell .side-link[aria-current="page"] { background: #1f5fce; color: #fff; box-shadow: none; font-weight: 600; }
  .admin-shell .side-link[aria-current="page"] svg { color: #fff; }
  .admin-shell .side-link .count-badge { margin-left: auto; background: rgba(255,255,255,.16); color: #fff; }
  .admin-shell .side-foot { padding-top: 12px; border-top: 1px solid #24344b; }
  .admin-shell .side-user { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 7px; background: #142238; }
  .admin-shell .side-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: #1f5fce; color: #fff; font-size: 12px; font-weight: 650; }
  .admin-shell .side-user-meta { flex: 1; min-width: 0; }
  .admin-shell .side-user-meta b { display: block; overflow: hidden; color: #e8eff8; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .admin-shell .side-user-meta span { display: block; margin-top: 1px; color: #8799b1; font-size: 10.5px; }
  .admin-shell .side-icon-btn { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 6px; color: #9fb0c6; }
  .admin-shell .side-icon-btn:hover { background: #233650; color: #fff; }
  .admin-shell .side-refresh { width: 100%; justify-content: center; margin-top: 8px; border: 1px solid #263a54; background: #16263d; color: #c7d3e3; }
  .admin-shell .side-refresh:hover { background: #1e314b; color: #fff; }

  .admin-shell .admin-workbar { height: 56px; padding: 0 28px; border-bottom: 1px solid #e4e9f1; background: #fff; font-size: 13px; }
  .admin-shell .admin-workbar-left { display: flex; align-items: center; gap: 10px; }
  .admin-shell .admin-workbar-brand { color: #334155; font-size: 13px; font-weight: 650; }
  .admin-shell .admin-workbar-divider { margin: 0; color: #c5cfdd; }
  .admin-shell .admin-workbar-left b { color: #1f2d3f; font-weight: 600; }
  .admin-shell .admin-workbar-right { display: flex; align-items: center; gap: 16px; }
  .admin-sync { display: inline-flex; align-items: center; gap: 6px; color: #7b8ba0; font-size: 11.5px; }
  .admin-sync i { width: 6px; height: 6px; border-radius: 50%; background: #22a06b; }
  .admin-sync.is-bad i { background: #d92d20; }
  .admin-workbar-user { color: #64748b; font-size: 12px; font-variant-numeric: tabular-nums; }
  .admin-shell .admin-workbar .btn { min-height: 30px; padding: 0 11px; font-size: 12px; }

  .admin-shell .content { padding: 80px 30px 44px; max-width: none; }
  .admin-shell .page-head { margin-bottom: 18px; align-items: flex-end; }
  .admin-shell .page-title { color: #152238; font-size: 23px; font-weight: 680; letter-spacing: -.025em; }
  .admin-shell .page-sub { margin-top: 4px; color: #77859a; font-size: 12.5px; }
  .admin-page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

  .admin-shell .btn { min-height: 34px; padding: 0 13px; border-radius: 6px; font-size: 13px; }
  .admin-shell .btn-sm { min-height: 28px; padding: 0 10px; font-size: 12px; }
  .admin-shell .input, .admin-shell .select { min-height: 34px; border-radius: 6px; font-size: 13px; }
  .admin-shell .card, .admin-shell .admin-table-wrap, .admin-shell .admin-category-panel {
    border: 1px solid #e4e9f1; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.03);
  }
  .admin-shell .card-head { padding: 15px 18px 10px; }
  .admin-shell .card-head h3 { font-size: 14px; font-weight: 650; }
  .admin-shell .card-body { padding: 10px 18px 16px; }
  .admin-shell .filter-card .card-body { padding: 12px 14px; }
  .admin-shell .stat-grid { gap: 12px; margin-bottom: 16px; }
  .admin-shell .stat { padding: 16px 18px; border: 1px solid #e4e9f1; border-radius: 8px; background: #fff; box-shadow: none; }
  .admin-shell .stat-label { font-size: 12px; }
  .admin-shell .stat-value { margin-top: 6px; font-size: 26px; }
  .admin-shell .stat-foot { font-size: 11.5px; }
  .admin-shell .admin-table { min-width: 780px; font-size: 13px; }
  .admin-shell .admin-table th { padding: 10px 14px; border-bottom: 1px solid #e8edf4; background: #f8fafc; color: #64748b; font-size: 11.5px; font-weight: 600; }
  .admin-shell .admin-table th, .admin-shell .admin-table td { padding: 11px 14px; }
  .admin-shell .admin-table tbody tr:hover { background: #f7fbff; }
  .admin-shell .admin-table-footer { padding: 12px; }
  .admin-shell .admin-list-caption { padding: 15px 18px 12px; border-bottom: 1px solid #eef1f6; font-size: 14px; }

  .admin-shell .two-col { gap: 14px; }
  .admin-shell .v-stats .chart-scroll { padding-bottom: 4px; }
  .admin-shell .bars-tall { height: 210px; }
  .admin-shell .bar { border-radius: 4px; }
  .admin-shell .bar-val, .admin-shell .bar-lbl { font-size: 10.5px; }
  .admin-shell :focus-visible { outline: 1px solid rgba(31,95,206,.45); outline-offset: 1px; }
  .admin-shell .side-link:focus-visible { outline: none; }
}

/* 经营概览 */
.admin-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.admin-kpi {
  min-width: 0; padding: 17px 18px; border: 1px solid #e4e9f1; border-radius: 8px;
  background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.admin-kpi.is-click { cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease; }
.admin-kpi.is-click:hover { border-color: #d5deea; box-shadow: 0 4px 14px rgba(15,23,42,.05); }
.admin-kpi-primary { padding-top: 17px; }
.admin-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #6b7a90; font-size: 12px; }
.admin-kpi-top svg { color: #8a99ad; }
.admin-kpi-value { margin-top: 8px; color: #152238; font-size: 30px; font-weight: 680; line-height: 1.12; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.admin-kpi-value small { margin-left: 4px; color: #8a99ad; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.admin-kpi-value.is-warn { color: #b45309; }
.admin-kpi-value.is-danger { color: #c2410c; }
.admin-kpi-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; margin-top: 10px; color: #7c8a9e; font-size: 11.5px; }
.admin-delta { display: inline-flex; align-items: center; gap: 2px; color: #16803c; font-weight: 600; }
.admin-delta.down { color: #c2410c; }

.admin-dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 16px; }
.admin-panel { min-width: 0; border: 1px solid #e4e9f1; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.admin-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid #eef1f6; }
.admin-panel-head h3 { color: #1f2d3f; font-size: 14px; font-weight: 650; }
.admin-panel-head h3 + span, .admin-panel-head div > span { display: block; margin-top: 3px; color: #8492a6; font-size: 11.5px; }
.admin-panel-head-right { display: flex; align-items: center; gap: 14px; }
.admin-panel-head-right b { color: #152238; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.admin-link { display: inline-flex; align-items: center; gap: 2px; color: #1f5fce; font-size: 12px; white-space: nowrap; }
.admin-link:hover { text-decoration: underline; }
.admin-panel-body { padding: 16px 18px; }
.admin-bars { height: 190px; gap: 10px; }
.admin-bars .bar { max-width: 34px; border-radius: 4px; }
.admin-bars .bar-val { font-size: 10.5px; }
.admin-bars .bar-lbl { font-size: 10.5px; }
.admin-chart-empty { display: grid; min-height: 190px; place-items: center; }
.admin-channel-list { display: flex; flex-direction: column; gap: 16px; }
.admin-channel-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #4b5b70; font-size: 12.5px; }
.admin-channel-top i { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; vertical-align: 1px; }
.admin-channel-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.admin-channel-track { flex: 1; height: 6px; overflow: hidden; border-radius: 3px; background: #edf1f6; }
.admin-channel-track > div { height: 100%; border-radius: 3px; }
.admin-channel-line span { width: 34px; color: #8492a6; font-size: 11px; text-align: right; }
.admin-alert-list { padding: 4px 18px 10px; }
.admin-alert-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f0f3f7; font-size: 12.5px; }
.admin-alert-row:last-child { border-bottom: 0; }
.admin-alert-row b { display: block; color: #28384c; font-size: 13px; font-weight: 600; }
.admin-alert-row .muted { display: block; margin-top: 2px; font-size: 11px; }
.admin-alert-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; }
.admin-alert-dot.is-low { background: #f59e0b; }
.admin-alert-dot.is-neg { background: #dc2626; }
.admin-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; margin-left: 4px; padding: 0 6px; border-radius: 9px; background: #fff1e8; color: #c2410c; font-size: 10.5px; font-weight: 650; vertical-align: 1px; }
.admin-panel-table { padding: 0 18px 6px; overflow-x: auto; }
.admin-panel-table .admin-table { width: 100%; min-width: 560px; border-collapse: collapse; text-align: left; font-size: 12.5px; }
.admin-panel-table .admin-table th { padding: 9px 8px; border-bottom: 1px solid #e8edf4; background: transparent; color: #7b8ba0; font-size: 11px; font-weight: 600; white-space: nowrap; }
.admin-panel-table .admin-table td { padding: 10px 8px; border-bottom: 1px solid #f2f5f9; color: #344256; }
.admin-panel-table .admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-panel-table .admin-table tr.is-click { cursor: pointer; }
.admin-panel-table .admin-table tr.is-click:hover { background: #f7fbff; }
.admin-shell .admin-table tr.is-click { cursor: pointer; }
.admin-action.is-ok { color: #16803c; }
.admin-panel-empty { padding: 18px; }

@media (min-width: 1100px) {
  .admin-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr); }
  .admin-dash-grid.admin-dash-lower { grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr); }
}
@media (max-width: 700px) {
  .admin-shell .page-head.row-between { flex-wrap: wrap; align-items: flex-start; }
  .admin-page-actions { width: 100%; gap: 6px; }
  .admin-page-actions .btn { min-height: 32px; padding: 0 10px; font-size: 12px; }
  .admin-dashboard .page-head.row-between { gap: 12px; }
  .admin-kpi { padding: 14px; }
  .admin-kpi-value { font-size: 26px; }
  .admin-panel-head { padding: 13px 14px; flex-wrap: wrap; }
  .admin-panel-head-right { width: 100%; justify-content: space-between; }
  .admin-panel-body { padding: 14px; }
  .admin-alert-list { padding: 4px 14px 8px; }
  .admin-panel-table { padding: 0 14px 4px; }
}
@media (max-width: 620px) {
  .admin-kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-page-actions { width: 100%; }
  .admin-bars { height: 150px; }
}

@media (min-width: 900px) {
  .admin-shell .v-alerts .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .admin-shell .v-inventory .filter-card .card-body { display: flex; align-items: center; gap: 14px; }
  .admin-shell .v-inventory .filter-card .input-search { flex: 0 1 380px; }
  .admin-shell .v-inventory .filter-card .chips-scroll { flex: 1; margin-top: 0 !important; }
  .admin-shell .v-stats .filter-card .card-body { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .admin-shell .v-stats .filter-card .chips-scroll { margin-top: 0; }
  .admin-shell .v-stats .filter-card .date-row { margin-top: 0; }
}

/* 管理端设置：左侧分区导航 + 右侧内容 */
.admin-settings-layout { display: block; }
.admin-settings-main { display: flex; flex-direction: column; gap: 14px; }
.admin-settings-nav { display: none; }
.settings-anchor { scroll-margin-top: 76px; }
@media (min-width: 1200px) {
  .admin-settings-layout { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 18px; align-items: start; }
  .admin-settings-nav { display: block; position: sticky; top: 76px; padding: 8px; border: 1px solid #e4e9f1; border-radius: 8px; background: #fff; }
  .admin-settings-nav button { display: flex; align-items: center; width: 100%; min-height: 37px; padding: 0 10px; border-radius: 6px; color: #5b6b80; font-size: 13px; text-align: left; }
  .admin-settings-nav button:hover { background: #f5f8fc; color: #1f2d3f; }
  .admin-settings-nav button.is-on { background: #eef4ff; color: #1f5fce; font-weight: 600; }
}
@media (min-width: 900px) {
  .admin-settings-main .admin-table { min-width: 680px; }
}

/* 管理端筛选工具栏 */
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-toolbar-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.admin-toolbar-label { color: #64748b; font-size: 12px; font-weight: 600; }
.admin-range-label { color: #64748b; font-size: 11.5px; white-space: nowrap; }
.admin-toolbar .input-search { flex: 1 1 320px; max-width: 420px; }
.admin-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; }
.admin-seg .seg-btn { min-height: 28px; padding: 0 10px; border-radius: 4px; color: #64748b; font-size: 12px; background: transparent; }
.admin-seg .seg-btn.is-on { background: #fff; color: #1f5fce; font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.admin-filter-select { width: 118px; }

/* 库存 / 预警桌面表格 */
.admin-inv-name { display: flex; flex-direction: column; gap: 3px; min-width: 180px; }
.admin-inv-name b { color: #28384c; font-size: 13px; font-weight: 600; }
.admin-inv-name span { color: #8492a6; font-size: 11px; }
.admin-inv-row { cursor: pointer; }
.admin-inv-row.is-open { background: #f8fbff; }
.admin-expand-row td { padding: 0 14px 14px !important; border-bottom: 1px solid #e8edf4 !important; background: #f8fbff; }
.admin-expand-box { padding: 10px 12px; border: 1px solid #e4e9f1; border-radius: 6px; background: #fff; }
.admin-expand-title { margin-bottom: 7px; color: #7b8ba0; font-size: 11px; }
.admin-mov-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid #f2f5f9; font-size: 11.5px; }
.admin-mov-row:last-child { border-bottom: 0; }
.admin-mov-qty { min-width: 44px; font-weight: 600; }
.admin-alert-kind { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.admin-alert-kind span { color: #8492a6; font-size: 11px; }

/* 侧栏分组与用户区的基础样式（管理端在深色侧栏中覆盖配色） */
.side-group { padding: 12px 10px 4px; color: var(--label-4); font-size: 10px; font-weight: 650; letter-spacing: .08em; }
.side-user { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; }
.side-avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 650; }
.side-user-meta { flex: 1; min-width: 0; }
.side-user-meta b { display: block; overflow: hidden; font-size: 11.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.side-user-meta span { display: block; margin-top: 1px; color: var(--label-3); font-size: 10px; }
.side-icon-btn { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 6px; color: var(--label-3); }
.side-icon-btn:hover { background: var(--fill); color: var(--label); }
.side-refresh { width: 100%; justify-content: center; margin-top: 8px; }

/* ============================================================
   成本页（管理端）
   ============================================================ */
.cost-tabs { margin-bottom: 14px; }
.cost-margin-low { color: var(--amber); font-weight: 600; }
.admin-action.is-danger { color: var(--red); }
.cost-loading { padding: 30px 0; text-align: center; color: var(--label-3); font-size: 13px; }
.cost-edit-head, .cost-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 110px 30px;
  gap: 8px;
  align-items: center;
}
.cost-edit-head { margin: 4px 0 6px; color: var(--label-3); font-size: 11px; }
.cost-edit-row { margin-bottom: 7px; }
.cost-edit-row .input, .cost-edit-row .select { min-height: 34px; }
.cost-remove { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; color: var(--label-3); }
.cost-remove:hover { background: var(--red-soft); color: var(--red); }
.cost-add-row { display: flex; gap: 8px; margin: 4px 0 14px; }
.cost-edit-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cost-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #e4e9f1;
}
.cost-preview > div { padding: 12px 14px; background: #fff; }
.cost-preview span { display: block; color: var(--label-3); font-size: 11px; }
.cost-preview b { display: block; margin-top: 4px; color: var(--label); font-size: 17px; font-weight: 650; }
.cost-preview-total b { color: var(--blue); }
.cost-preset-title { margin: 21px 0 10px; color: var(--label-2); font-size: 14px; font-weight: 650; }
.cost-preset-title span { margin-left: 8px; color: var(--label-3); font-size: 11.5px; font-weight: 400; }
.cost-preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cost-preset-card { padding: 15px 16px; border: 1px solid #e4e9f1; border-radius: 8px; background: #fff; }
.cost-preset-card h4 { color: var(--label); font-size: 14px; font-weight: 650; }
.cost-preset-card p { margin: 8px 0 4px; color: var(--label-3); font-size: 11.5px; }
.cost-preset-items { min-height: 34px; margin-bottom: 10px; color: var(--label-2); font-size: 12px; line-height: 1.5; }
@media (max-width: 1100px) { .cost-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .cost-edit-head { display: none; }
  .cost-edit-row { grid-template-columns: minmax(0, 1fr) 82px 92px 28px; gap: 5px; }
  .cost-edit-two { grid-template-columns: 1fr; }
  .cost-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-preset-grid { grid-template-columns: 1fr; }
}
.sheet-foot:has(.cost-foot-summary) { flex-wrap: wrap; }
.cost-foot-summary { display: flex; flex: 1 0 100%; align-items: center; gap: 18px; padding-bottom: 2px; color: var(--label-3); font-size: 12px; }
.cost-foot-summary b { color: var(--label); font-size: 16px; font-weight: 650; }
.cost-foot-summary b.neg { color: var(--red); }
.cost-edit-two.is-single { grid-template-columns: minmax(0, 1fr); }

/* 管理端商品详情右侧抽屉 */
.drawer-mask { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: rgba(10, 20, 35, .28); backdrop-filter: blur(2px); animation: fade-in var(--dur) var(--ease); }
.drawer { display: flex; flex-direction: column; width: min(560px, 100vw); height: 100dvh; background: #fff; border-left: 1px solid #e4e9f1; box-shadow: -16px 0 45px rgba(15, 23, 42, .12); animation: drawer-in .25s var(--ease); }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px 10px; border-bottom: 1px solid #eef1f6; }
.drawer-head h2 { color: #152238; font-size: 16px; font-weight: 680; line-height: 1.25; }
.drawer-head p { margin-top: 4px; color: #8492a6; font-size: 11.5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 18px 18px; }
.drawer-foot { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid #eef1f6; background: #fff; }
.drawer-foot .btn { flex: 1; }
.drawer-foot:has(.cost-foot-summary) { flex-wrap: wrap; }
.drawer-foot .cost-foot-summary { display: flex; flex: 1 0 100%; order: -1; align-items: center; gap: 18px; padding-bottom: 2px; color: #8492a6; font-size: 11.5px; }
.drawer-foot .cost-foot-summary b { color: #28384c; font-size: 15px; font-weight: 650; }
.drawer-foot .cost-foot-summary b.neg { color: var(--red); }
.drawer-tabs { display: flex; gap: 2px; margin-bottom: 10px; padding: 2px; border: 1px solid #e4e9f1; border-radius: 7px; background: #f8fafc; }
.drawer-tabs button { flex: 1; min-height: 28px; border-radius: 5px; color: #64748b; font-size: 11.5px; }
.drawer-tabs button.is-on { background: #fff; color: #1f5fce; font-weight: 650; box-shadow: 0 1px 2px rgba(15,23,42,.07); }
.drawer-product-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.drawer-product-thumb { display: grid; place-items: center; width: 62px; height: 62px; flex: none; overflow: hidden; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 18px; font-weight: 650; }
.drawer-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-product-thumb.is-previewable, .pc-thumb.is-previewable, .drawer-product-thumb.is-previewable { cursor: zoom-in; }
.drawer-product-head b { display: block; color: #28384c; font-size: 14px; }
.drawer-product-head span { display: block; margin-top: 3px; color: #8492a6; font-size: 11.5px; }
.drawer-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid #e4e9f1; border-radius: 7px; background: #e4e9f1; }
.drawer-kv > div { padding: 11px 12px; background: #fff; }
.drawer-kv span { display: block; color: #8492a6; font-size: 11px; }
.drawer-kv b { display: block; margin-top: 3px; color: #28384c; font-size: 13px; font-weight: 600; }
.drawer-section-title { margin: 18px 0 8px; color: #64748b; font-size: 11.5px; font-weight: 600; }
.drawer-mov-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid #f2f5f9; font-size: 11.5px; }
.drawer-mov-row:last-child { border-bottom: 0; }
.cost-inline-editor { margin-top: 0; }
.cost-inline-editor .cost-loading { padding: 18px 0; }
.cost-inline-editor .cost-stale-hint { margin: 0 0 8px; color: var(--amber); font-size: 11px; line-height: 1.45; }
.cost-template-row { display: flex; align-items: center; gap: 8px; }
.cost-template-row > span { flex: none; color: #64748b; font-size: 11.5px; }
.cost-template-row .select { flex: 1; min-width: 0; min-height: 30px; font-size: 12.5px; }
.cost-current-cost { flex: none; margin-left: auto; color: #8492a6; font-size: 10.5px; white-space: nowrap; }
.cost-current-cost b { margin-left: 2px; color: #28384c; font-size: 12px; font-weight: 650; }
.cost-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 6px; color: #64748b; font-size: 11.5px; }
.cost-toolbar .cost-add-row { display: flex; gap: 5px; margin: 0; }
.cost-toolbar .btn { min-height: 25px; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 500; }
.cost-form-head { display: grid; grid-template-columns: minmax(0, 1fr) 64px 78px 74px 26px; gap: 6px; align-items: center; margin: 6px 0 4px; color: #8492a6; font-size: 10.5px; }
.cost-inline-editor .cost-form-table .cost-edit-row { grid-template-columns: minmax(0, 1fr) 64px 78px 74px 26px; gap: 6px; }
.cost-inline-editor .cost-edit-row { grid-template-columns: minmax(0, 1fr) 74px 88px 26px; gap: 6px; margin-bottom: 5px; }
.cost-qty-input { text-align: center; }
.cost-qty-na { color: #b8c2cf; font-size: 12px; text-align: center; }
.cost-inline-editor .cost-edit-row .input, .cost-inline-editor .cost-edit-row .select { min-height: 30px; padding: 4px 8px; font-size: 12.5px; }
.cost-inline-editor .cost-remove { width: 26px; height: 26px; }
.cost-params { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.cost-params label { display: flex; align-items: center; gap: 5px; color: #64748b; font-size: 11.5px; }
.cost-params .input { width: 76px; min-height: 30px; padding: 4px 8px; font-size: 12.5px; }
.cost-params em { color: #8492a6; font-size: 11.5px; font-style: normal; }
.cost-result-table { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 10px; overflow: hidden; border: 1px solid #e4e9f1; border-radius: 7px; background: #e4e9f1; }
.cost-result-table > div { min-width: 0; padding: 8px 10px; background: #fff; }
.cost-result-table span { display: block; color: #8492a6; font-size: 11px; line-height: 1.3; }
.cost-result-table b { display: block; margin-top: 2px; overflow: hidden; color: #28384c; font-size: 15px; font-weight: 650; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.cost-result-table b.is-total { color: var(--blue); }
.cost-result-table b.neg { color: var(--red); }
.cost-qty-hint { margin: 6px 0 0; color: var(--amber); font-size: 11px; }
@media (max-width: 400px) {
  .cost-inline-editor .cost-edit-row { grid-template-columns: minmax(0, 1fr) 64px 72px 24px; gap: 4px; }
  .cost-inline-editor .cost-edit-row .input, .cost-inline-editor .cost-edit-row .select { padding: 4px 6px; font-size: 12px; }
  .cost-form-head { display: none; }
  .cost-inline-editor .cost-form-table .cost-edit-row { grid-template-columns: minmax(0, 1fr) 58px 68px 64px 24px; gap: 4px; }
  .cost-inline-editor .cost-form-table .cost-remove { width: 24px; height: 24px; }
  .cost-toolbar { flex-wrap: wrap; }
}
@media (max-width: 680px) {
  .drawer-mask { align-items: flex-end; }
  .drawer { width: 100vw; height: min(88dvh, 760px); border-left: 0; border-radius: 18px 18px 0 0; animation: sheet-up .28s var(--ease); }
  .drawer-head { padding-top: 16px; }
}
.drawer-form .form-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 10px; }
.drawer-form .form-grid .span-2 { grid-column: 1 / -1; }
.drawer-form .form-grid .drawer-half { grid-column: span 3; }
.drawer-form .form-grid .drawer-full { grid-column: 1 / -1; }
.drawer-form .form-grid > .field:not(.span-2):not(.drawer-half):not(.drawer-full) { grid-column: span 2; }
.drawer-form .field { gap: 3px; }
.drawer-form .field > label { font-size: 11.5px; }
.drawer-form .input, .drawer-form .select { min-height: 30px; font-size: 12.5px; }
.drawer-form .field-hint { display: none; }
.drawer-form .prod-photo-row { gap: 10px; align-items: center; }
.drawer-form .prod-photo-box { width: 56px; height: 56px; flex: none; border-radius: 8px; }
.drawer-form .prod-photo-info { min-width: 0; }
.drawer-form .tag-editor { min-height: 32px; }
.drawer-form .tag-suggests { display: none; }
.drawer-barcode-row { display: flex; align-items: flex-end; gap: 10px; }
.drawer-barcode-row .barcode-manual { min-width: 0; }
.drawer-barcode-preview { width: 272px; flex: none; }
.drawer-barcode-preview .product-barcode { margin-top: 0; }
.drawer-barcode-preview .product-barcode-preview { margin-bottom: 0; padding: 4px; }
.product-barcode.is-compact .product-barcode-preview svg { height: 56px; }
@media (max-width: 520px) {
  .drawer-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer-form .form-grid .span-2, .drawer-form .form-grid .drawer-half, .drawer-form .form-grid .drawer-full { grid-column: 1 / -1; }
  .drawer-form .form-grid > .field:not(.span-2):not(.drawer-half):not(.drawer-full) { grid-column: auto; }
  .drawer-barcode-row { flex-wrap: wrap; }
  .drawer-barcode-preview { width: 100%; }
}
@media (max-width: 400px) { .drawer-form .form-grid { grid-template-columns: minmax(0, 1fr); } }
.drawer-take-box { margin-bottom: 8px; padding: 13px 14px; border: 1px solid #e4e9f1; border-radius: 8px; background: #fbfcfe; }
.drawer-take-box .btn { width: 100%; margin-top: 4px; }
.drawer-take-diff { display: flex; align-items: center; gap: 5px; padding-top: 20px; font-size: 12px; }
.drawer-take-diff b { font-size: 14px; }
.drawer-head .drawer-product-thumb { width: 44px; height: 44px; flex: none; font-size: 14px; border-radius: 7px; }
.drawer-head-copy { min-width: 0; }
.drawer-head-title-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.drawer-head-title-row h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-head-title-row .tag { flex: none; font-size: 10px; padding: 2px 6px; }
.drawer-head-copy p { margin-top: 2px; overflow: hidden; color: #8492a6; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-head-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--label-3); font-size: 11.5px; }

/* 管理端样板：订单与商品工作区 */
.admin-shell .v-orders .page-head { margin-bottom: 22px; }
.admin-shell .v-orders .page-title { letter-spacing: -.025em; }
.orders-overview { display: flex; align-items: center; gap: 7px; margin-top: 15px; color: #66788a; font-size: 12px; }
.orders-overview strong { color: #253d48; font-size: 14px; }
.orders-overview > span { width: 1px; height: 14px; margin: 0 7px; background: #dce4e3; }
.admin-shell .v-orders .filter-card { border: 1px solid #e2eae8; border-radius: 12px; box-shadow: 0 4px 16px rgba(33, 60, 53, .035); }
.admin-shell .v-orders .filter-card .card-body { padding: 16px; }
.admin-shell .v-orders .admin-table-wrap { overflow-x: auto; border: 1px solid #e2eae8; border-radius: 12px; box-shadow: 0 4px 16px rgba(33, 60, 53, .035); }
.admin-shell .v-orders .admin-list-caption { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; }
.admin-shell .v-orders .admin-list-caption b { color: #213b3a; font-size: 15px; }
.admin-shell .v-orders .admin-list-caption small { display: block; margin-top: 4px; color: #879795; font-size: 11px; font-weight: 400; }
.admin-shell .v-orders .admin-list-caption > span { color: #758985; font-size: 12px; }
.admin-shell .v-orders .admin-table th { background: #f6f9f8; color: #70837f; }
.admin-shell .v-orders .admin-table td { padding-top: 15px; padding-bottom: 15px; }
.admin-shell .v-orders .admin-table th:nth-child(4), .admin-shell .v-orders .admin-table td:nth-child(4), .admin-shell .v-orders .admin-table th:nth-child(6), .admin-shell .v-orders .admin-table td:nth-child(6) { text-align: right; }
.admin-shell .v-orders .admin-table td:nth-child(6) { color: #1e3b36; font-weight: 650; }
.admin-shell .v-orders .admin-table tbody tr:hover { background: #f5faf8; }
.product-detail-drawer .drawer { border-color: #dfe9e5; box-shadow: -18px 0 50px rgba(28, 55, 47, .14); }
.product-detail-drawer .drawer-head { padding: 17px 20px 14px; border-color: #e9efed; }
.product-detail-drawer .drawer-head .drawer-product-thumb { border-radius: 10px; background: #e5f1ed; color: #34745f; }
.product-detail-drawer .drawer-body { padding: 16px 20px 20px; }
.product-detail-drawer .drawer-tabs { gap: 4px; margin-bottom: 16px; padding: 4px; border: 0; border-radius: 10px; background: #f0f5f3; }
.product-detail-drawer .drawer-tabs button { min-height: 34px; border-radius: 7px; color: #6c8079; font-size: 12px; }
.product-detail-drawer .drawer-tabs button.is-on { color: #246e56; box-shadow: 0 2px 6px rgba(34, 67, 56, .1); }
.product-detail-drawer .drawer-form .field > label { color: #536b63; font-weight: 600; }
.product-detail-drawer .drawer-form .input, .product-detail-drawer .drawer-form .select, .product-detail-drawer .drawer-form .tag-editor { border-color: #dce7e2; border-radius: 7px; }
.product-detail-drawer .drawer-foot { padding: 14px 20px; border-color: #e9efed; box-shadow: 0 -4px 18px rgba(33, 60, 53, .035); }
.product-detail-drawer .drawer-kv { border-color: #dce9e3; border-radius: 9px; background: #e4eeea; }
.product-detail-drawer .drawer-kv > div { background: #f8fbf9; }
.product-detail-drawer .drawer-section-title { color: #476a5e; font-size: 12px; }
@media (max-width: 700px) {
  .admin-shell .v-orders .admin-list-caption { align-items: flex-start; flex-direction: column; gap: 6px; }
  .product-detail-drawer .drawer-head { padding: 14px 16px 12px; }
  .product-detail-drawer .drawer-body { padding: 12px 16px 18px; }
  .product-detail-drawer .drawer-foot { padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* 管理工作台：统一卡片、表格和操作层级 */
@media (min-width: 900px) {
  body:has(.admin-shell), .admin-shell { background: #f4f7f6; }
  .admin-shell .sidebar { background: #172d31; }
  .admin-shell .side-group { color: #91a9a7; }
  .admin-shell .side-link { color: #c7d8d5; border-radius: 8px; }
  .admin-shell .side-link svg { color: #a6c0ba; }
  .admin-shell .side-link:hover { background: #26433f; }
  .admin-shell .side-link[aria-current="page"] { background: #337964; }
  .admin-shell .side-foot { border-color: #39524e; }
  .admin-shell .side-user, .admin-shell .side-refresh { background: #213b3b; border-color: #395750; }
  .admin-shell .side-avatar { background: #3e866f; }
  .admin-shell .admin-workbar { border-color: #e2ebe7; }
  .admin-shell .page-title { color: #203d37; }
  .admin-shell .page-sub { color: #71857e; }
  .admin-shell .card, .admin-shell .admin-table-wrap, .admin-shell .admin-category-panel,
  .admin-shell .stat, .admin-shell .admin-kpi, .admin-shell .admin-panel {
    border-color: #e1eae6; border-radius: 12px; box-shadow: 0 4px 16px rgba(33,60,53,.035);
  }
  .admin-shell .admin-table th { background: #f6f9f8; border-color: #e7efeb; color: #6c8179; }
  .admin-shell .admin-table tbody tr:hover { background: #f5faf8; }
  .admin-shell .admin-list-caption { padding: 16px 18px; color: #2c4840; font-weight: 650; }
  .admin-shell .admin-list-caption span { color: #82958d; font-weight: 400; }
  .admin-shell .filter-card .card-body { padding: 15px 16px; }
  .admin-shell .btn, .admin-shell .input, .admin-shell .select { border-radius: 7px; }
  .admin-shell .admin-panel-head, .admin-shell .admin-list-caption { border-color: #edf2ef; }
  .admin-shell .admin-kpi { padding: 18px 20px; }
  .admin-shell .admin-kpi-value { color: #203d37; }
  .admin-shell .admin-kpi-value.is-warn { color: #b45309; }
  .admin-shell .admin-kpi-value.is-danger { color: #c2410c; }
  .admin-shell .admin-settings-nav { border-color: #e1eae6; border-radius: 12px; }
  .admin-shell .admin-category-item.is-selected, .admin-shell .admin-settings-nav button.is-on { background: #eaf4ef; color: #286d57; }
  .admin-shell .catalog-seg .seg-btn.is-on { border-bottom-color: #337964; color: #286d57; }
  .admin-shell .v-catalog .admin-table thead th { background: #f6f9f8; }
}
.admin-shell .is-click[role="button"]:focus-visible { outline: 2px solid #337964; outline-offset: 2px; }
.admin-shell .v-alerts .page-sub { max-width: 720px; line-height: 1.6; }
.admin-shell .v-settings .settings-anchor { scroll-margin-top: 72px; }
@media (max-width: 899px) {
  .admin-shell .stat, .admin-shell .admin-kpi, .admin-shell .admin-panel { border-radius: 10px; }
}

.admin-shell .admin-catalog-empty .btn { margin-top: 12px; }

/* 商品抽屉：库存与流水 */
.product-detail-drawer .stock-detail-summary { margin-bottom: 18px; }
.product-detail-drawer .stock-detail-summary > div { padding: 10px 12px; }
.product-detail-drawer .stock-detail-summary b { font-size: 14px; }
.stock-detail-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.stock-detail-heading b { color: #344c46; font-size: 13px; font-weight: 650; }
.stock-detail-heading > span { color: #8b9d96; font-size: 11px; }
.stock-detail-form { display: grid; gap: 10px; }
.stock-detail-form .field { gap: 4px; }
.stock-detail-form .field-label { color: #536b63; font-size: 11.5px; font-weight: 600; }
.stock-detail-form .input { min-height: 34px; border-color: #dce7e2; border-radius: 7px; font-size: 12.5px; }
.stock-detail-count { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.stock-detail-diff { display: flex; min-height: 34px; align-items: center; justify-content: space-around; gap: 8px; padding: 7px 10px; border-radius: 7px; background: #f3f7f5; color: #81938c; font-size: 11px; }
.stock-detail-diff span { white-space: nowrap; }
.stock-detail-diff b { margin-left: 4px; color: #304b42; font-size: 13px; }
.stock-detail-diff b.neg { color: var(--red); }
.stock-detail-diff b.pos { color: var(--green); }
.stock-detail-hint { color: #92a19b; font-size: 11px; line-height: 1.4; }
.stock-detail-movements-heading { margin-top: 20px; }
.stock-detail-movements { overflow: hidden; border: 1px solid #e4ebe7; border-radius: 8px; }
.stock-detail-mov-head, .stock-detail-mov-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px 94px; align-items: center; gap: 8px; padding: 9px 10px; }
.stock-detail-mov-head { background: #f6f9f7; color: #8b9b94; font-size: 11px; }
.stock-detail-mov-row { border-top: 1px solid #edf2ef; color: #526760; font-size: 11.5px; }
.stock-detail-mov-head > :nth-child(n+2), .stock-detail-mov-qty, .stock-detail-mov-time { text-align: right; }
.stock-detail-mov-info { display: flex; min-width: 0; align-items: center; gap: 8px; }
.stock-detail-mov-info .tag { flex: none; }
.stock-detail-mov-time { color: #899a93; white-space: nowrap; }
.stock-detail-empty { padding: 16px; border: 1px dashed #dfe8e3; border-radius: 8px; color: #91a19a; font-size: 12px; text-align: center; }
@media (max-width: 500px) {
  .stock-detail-count { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .stock-detail-diff { justify-content: flex-start; gap: 24px; }
  .stock-detail-mov-head, .stock-detail-mov-row { grid-template-columns: minmax(0, 1fr) 40px 83px; gap: 6px; padding: 9px 8px; }
  .product-detail-drawer .drawer-foot .btn { min-width: 0; }
}
/* 入库直接在商品库存副页录入，盘点信息与输入框底边对齐。 */
.stock-detail-form .field { margin-bottom: 0; }
.stock-detail-count { align-items: end; }
.stock-detail-in { margin-bottom: 20px; }
.stock-detail-in-fields { display: grid; grid-template-columns: minmax(90px, .75fr) minmax(0, 1.25fr) auto; align-items: end; gap: 10px; }
.stock-detail-in-fields .btn { min-height: 34px; white-space: nowrap; }
@media (max-width: 500px) {
  .stock-detail-in-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .stock-detail-in-fields .btn { grid-column: 1 / -1; }
}

.product-order-hint { margin: 0 0 12px; color: #879a92; font-size: 11.5px; line-height: 1.5; }
.product-order-list { overflow: hidden; border: 1px solid #e4ebe7; border-radius: 8px; }
.product-order-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: 1px solid #edf2ef; }
.product-order-row:last-child { border-bottom: 0; }
.product-order-main { min-width: 0; }
.product-order-main b { display: block; overflow: hidden; color: #344c46; font-size: 12px; text-overflow: ellipsis; }
.product-order-date { display: block; margin-top: 4px; color: #91a19a; font-size: 11px; }
.product-order-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.product-order-extra { color: #83968d; font-size: 11px; }
.product-order-message, .product-order-more { padding: 15px 0; color: #81948b; font-size: 12px; text-align: center; }
.product-order-message .btn { margin-left: 6px; }
@media (max-width: 500px) { .product-detail-drawer .drawer-tabs button { font-size: 11px; } .product-order-row { align-items: flex-start; } .product-order-meta { max-width: 48%; } }
/* 日期统一显示年份；流水和图表为完整日期预留空间。 */
.stock-detail-mov-head, .stock-detail-mov-row { grid-template-columns: minmax(0, 1fr) 48px 132px; }
.chart-date { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.2; }
.v-stats .bars-tall .bar-col { min-width: 52px; }
.oc-bottom { flex-wrap: wrap; }
.tl-time { white-space: nowrap; }
@media (max-width: 500px) {
  .stock-detail-mov-head, .stock-detail-mov-row { grid-template-columns: minmax(0, 1fr) 35px 120px; }
  .stock-detail-mov-info { gap: 4px; }
  .stock-detail-mov-time { font-size: 10px; }
  .admin-bars .chart-date, .v-today .chart-date { font-size: 9px; }
}

/* 分类与标签：桌面管理工作区 */
.catalog-manager-intro, .tag-manager-heading, .tag-list-head { display: none; }
@media (min-width: 900px) {
  .catalog-manager-sheet .sheet { max-width: 1040px; height: min(740px, 86vh); background: #fff; border-radius: 14px; }
  .catalog-manager-sheet .sheet-head { padding: 20px 26px 16px; border-bottom: 1px solid #e9efec; }
  .catalog-manager-sheet .sheet-head h2 { color: #233f38; font-size: 18px; }
  .catalog-manager-sheet .sheet-body { padding: 20px 26px 24px; }
  .catalog-manager-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
  .catalog-manager-intro { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
  .catalog-manager-intro b { color: #2c4840; font-size: 15px; }
  .catalog-manager-intro span { color: #81948b; font-size: 12px; }
  .catalog-manager-top .seg { flex: none; margin: 0; padding: 4px; border: 0; border-radius: 9px; background: #f0f5f3; }
  .catalog-manager-top .seg-btn { min-width: 94px; min-height: 34px; border-radius: 6px; color: #71867e; font-size: 13px; }
  .catalog-manager-top .seg-btn.is-on { color: #2c6f5b; background: #fff; box-shadow: 0 1px 5px rgba(26, 54, 44, .09); }
  .catalog-manager-sheet .cat-cols { gap: 16px; }
  .catalog-manager-sheet .cat-col { min-height: 410px; border-color: #e1ebe5; border-radius: 10px; background: #fff; }
  .catalog-manager-sheet .cat-col-head { min-height: 66px; padding: 13px 16px; border-color: #e9f0ec; background: #f8faf9; }
  .catalog-manager-sheet .cat-col-heading { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .catalog-manager-sheet .cat-col-heading b { color: #314c43; font-size: 13px; }
  .catalog-manager-sheet .cat-col-heading small { overflow: hidden; color: #94a49d; font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
  .catalog-manager-sheet .cat-col-head em { color: #8a9c93; font-size: 11px; white-space: nowrap; }
  .catalog-manager-sheet .cat-col-list { padding: 8px; max-height: min(42vh, 390px); }
  .catalog-manager-sheet .cat-sort-row { margin-bottom: 2px; }
  .catalog-manager-sheet .cat-drag-handle { min-height: 42px; width: 34px; }
  .catalog-manager-sheet .cat-item { min-height: 42px; font-size: 13px; }
  .catalog-manager-sheet .cat-item.is-selected { color: #286e57; background: #eaf4ef; }
  .catalog-manager-sheet .cat-item.is-selected .cat-count, .catalog-manager-sheet .cat-item.is-selected .cat-chev { color: #286e57; }
  .catalog-manager-sheet .cat-dot.lv1, .catalog-manager-sheet .cat-dot.lv2 { background: #6ca38f; }
  .catalog-manager-sheet .cat-count { min-width: 32px; }
  .catalog-manager-sheet .cat-col-foot { justify-content: flex-start; gap: 5px; padding: 10px 12px; border-color: #e9f0ec; background: #fff; }
  .catalog-manager-sheet .cat-col-foot .btn { flex: 0 0 auto; min-height: 32px; padding: 0 10px; font-size: 12px; }
  .catalog-manager-sheet .cat-col-foot .btn:first-child { margin-right: auto; background: #edf5f1; color: #286e57; }
  .catalog-manager-sheet .cat-sort-hint { margin-top: 14px; color: #90a198; }
  .catalog-manager-sheet .tag-manager { max-width: none; margin: 0; }
  .catalog-manager-sheet .tag-manager-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 2px 0 16px; }
  .catalog-manager-sheet .tag-manager-heading > div { display: flex; flex-direction: column; gap: 5px; }
  .catalog-manager-sheet .tag-manager-heading b { color: #314c43; font-size: 14px; }
  .catalog-manager-sheet .tag-manager-heading span { color: #8a9c93; font-size: 12px; }
  .catalog-manager-sheet .tag-add { max-width: 560px; margin-bottom: 18px; }
  .catalog-manager-sheet .tag-add .input, .catalog-manager-sheet .tag-add .btn { min-height: 36px; border-radius: 7px; }
  .catalog-manager-sheet .tag-list { border-color: #e1ebe5; border-radius: 10px; background: #fff; }
  .catalog-manager-sheet .tag-list-head { display: grid; grid-template-columns: minmax(0, 1fr) 110px 132px; align-items: center; padding: 12px 16px; background: #f8faf9; color: #899c93; font-size: 11px; }
  .catalog-manager-sheet .tag-row { min-height: 54px; padding: 7px 16px; border-color: #edf2ef; }
  .catalog-manager-sheet .tag-row .cat-count { width: 110px; margin-left: auto; text-align: left; font-size: 12px; }
  .catalog-manager-sheet .tag-row .cat-actions { width: 132px; }
  .catalog-manager-sheet .tag-row .cat-actions .btn { min-height: 30px; padding: 0 10px; font-size: 12px; }
  .catalog-manager-sheet .tag-row .tag-brand { color: #377d65; background: #eaf4ef; }
}

/* 分类与标签切换：等宽、文字和数量统一对齐。 */
.catalog-manager-sheet .catalog-manager-top .seg { display: inline-grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.catalog-manager-sheet .catalog-manager-top .seg-btn { display: inline-grid; grid-template-columns: auto minmax(3ch, auto); align-items: center; justify-content: center; column-gap: 6px; min-width: 0; padding: 7px 14px; line-height: 1.2; font-weight: 600; white-space: nowrap; }
.catalog-manager-sheet .catalog-manager-top .seg-btn .mono { min-width: 3ch; text-align: left; line-height: inherit; opacity: .7; }
@media (min-width: 900px) {
  .catalog-manager-sheet .catalog-manager-top .seg { width: 208px; }
  .catalog-manager-sheet .catalog-manager-top .seg-btn { min-height: 34px; }
}

/* 商品导入工作区 */
.product-import-sheet .sheet { background: #fff; }
.product-import-sheet .sheet-head { border-bottom: 1px solid #e9efec; }
.product-import-sheet .sheet-body { background: #f8faf9; }
.bi-workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 14px; }
.bi-workspace-head > div { display: flex; flex-direction: column; gap: 5px; }
.bi-workspace-head b { color: #29473d; font-size: 15px; }
.bi-workspace-head span { color: #788d83; font-size: 12px; }
.bi-rules { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; color: #657d72; font-size: 11px; line-height: 1.5; }
.bi-rules span:before { content: '·'; margin-right: 5px; color: #68a48b; font-weight: 700; }
.bi-result-alert { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #f0d3aa; border-radius: 8px; background: #fff8ec; color: #8a531a; font-size: 12px; line-height: 1.6; }
.bi-product-list { display: grid; gap: 12px; }
.bi-product-card { min-width: 0; padding: 14px; border: 1px solid #e1eae5; border-radius: 10px; background: #fff; }
.bi-product-card.is-bad { border-color: #e6a5a0; }
.bi-product-card.is-warn { border-color: #e7d0a7; }
.bi-product-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bi-product-head b { color: #304c42; font-size: 13px; }
.bi-product-head > span { color: #47816b; font-size: 12px; }
.bi-product-head button { margin-left: auto; }
.bi-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.bi-name-field { grid-column: span 2; }
.bi-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: #61796e; font-size: 11.5px; font-weight: 600; }
.bi-field .input, .bi-field .select { width: 100%; min-width: 0; min-height: 36px; padding: 6px 9px; border-radius: 7px; font-size: 13px; font-weight: 400; }
.bi-cost-details { margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf2ef; }
.bi-cost-details summary { cursor: pointer; color: #426757; font-size: 12px; font-weight: 600; }
.bi-cost-details summary span { margin-left: 4px; color: #94a49c; font-size: 11px; font-weight: 400; }
.bi-cost-details p { margin: 8px 0; color: #899b92; font-size: 11px; line-height: 1.5; }
.bi-cost-fields { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 10px; }
.bi-card-issue { margin-top: 10px; color: #bc3830; font-size: 12px; }
.bi-card-issue.is-warn { color: #9a641e; }
.bi-file-note { margin-top: 12px; color: #778b81; font-size: 12px; line-height: 1.5; }
@media (min-width: 900px) {
  .product-import-sheet .sheet { max-height: 88vh; border-radius: 14px; }
  .product-import-sheet .sheet-head { padding: 18px 24px 14px; }
  .product-import-sheet .sheet-body { padding: 14px 24px 22px; }
}
@media (max-width: 700px) {
  .bi-workspace-head { align-items: flex-start; }
  .bi-workspace-head > .btn { flex: none; }
  .bi-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bi-name-field { grid-column: 1 / -1; }
  .bi-cost-fields { grid-template-columns: 1fr; }
  .bi-field .input, .bi-field .select { font-size: 16px; }
}

/* 批量商品表格与行内成本模板 */
.bi-import-grid { min-width: 1530px; border-collapse: collapse; background: #fff; }
.bi-import-grid th { white-space: nowrap; }
.bi-import-grid .bi-col-name { width: 180px; }
.bi-import-grid .bi-col-number { width: 90px; }
.bi-import-grid .bi-col-category { width: 120px; }
.bi-import-grid .bi-col-status { width: 88px; }
.bi-import-grid .bi-cost-toggle { width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-import-grid .bi-grid-detail td { background: #f8fbf9; }
.bi-cost-panel { padding: 12px; color: #536f62; }
.bi-cost-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 10px; font-size: 12px; }
.bi-cost-panel-head b { color: #304c42; font-size: 13px; }
.bi-cost-panel-head span { color: #82968b; }
.bi-template-select { width: 220px; margin-bottom: 10px; }
.bi-template-items { display: flex; flex-wrap: wrap; gap: 8px; }
.bi-template-item { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px; border: 1px solid #e0eae4; border-radius: 7px; background: #fff; font-size: 12px; }
.bi-template-item small { display: block; margin-top: 2px; color: #90a399; }
.bi-template-item label { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.bi-template-item .input { width: 76px; min-height: 32px; padding: 4px 7px; }
.bi-loss { width: 100px; margin-top: 10px; }
.bi-manual-cost { grid-template-columns: 140px 240px 240px 100px; }
.bi-cost-result { margin-top: 10px; color: #327c5e; font-size: 12px; font-weight: 600; }
.bi-template-warning { margin-bottom: 8px; color: #9a641e; font-size: 12px; }
@media (max-width: 700px) { .bi-import-grid .input, .bi-import-grid .select { font-size: 16px; } }

/* 导入表格：常用列优先，成本面板跟随可视区域 */
.bi-import-grid { width: 100%; min-width: 940px; }
.bi-import-grid.has-more { width: max-content; min-width: 1530px; }
.bi-import-grid .bi-col-name { width: 160px; }
.bi-import-grid .bi-col-number { width: 78px; }
.bi-import-grid .bi-col-category { width: 105px; }
.bi-import-grid .bi-cost-toggle { width: 140px; }
.bi-row-actions { white-space: nowrap; }
.bi-row-actions .btn { padding-left: 6px; padding-right: 6px; }
.bi-more-toggle[aria-pressed="true"] { color: #236c52; border-color: #94c7ad; background: #eaf5ee; }
.bi-scroll-hint { margin: 0 0 8px; color: #70877a; font-size: 12px; }
.bi-cost-panel { position: sticky; left: 0; box-sizing: border-box; width: min(850px, calc(100vw - 130px)); max-width: 100%; }
.bi-row-issue { position: sticky; left: 8px; width: fit-content; max-width: min(800px, calc(100vw - 130px)); }
.bi-manual-cost { display: grid; grid-template-columns: 120px minmax(150px, 1fr) minmax(150px, 1fr) 90px; }
@media (max-width: 700px) {
  .bi-cost-panel { width: calc(100vw - 90px); }
  .bi-manual-cost { grid-template-columns: 1fr; }
}

/* 批量导入：商品列表与当前商品设置 */
.bi-split-intro { margin: 2px 0 12px; color: #71887b; font-size: 12px; }
.bi-split-toolbar { margin-bottom: 10px; }
.bi-list-count { color: #29473d; font-size: 14px; font-weight: 700; }
.bi-list-count small { margin-left: 8px; color: #91a49a; font-size: 11px; font-weight: 400; }
.bi-split-workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 12px; align-items: start; }
.bi-list-pane, .bi-detail-pane { min-width: 0; border: 1px solid #dfeae3; border-radius: 10px; background: #fff; overflow: hidden; }
.bi-list-head, .bi-row-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(72px, .7fr) minmax(76px, .7fr); gap: 8px; align-items: center; }
.bi-list-head { padding: 10px 12px 8px 38px; color: #82958b; background: #f5f9f6; font-size: 11px; }
.bi-list-rows { max-height: 430px; overflow-y: auto; }
.bi-list-row { padding: 10px 12px; border-top: 1px solid #edf2ef; cursor: pointer; }
.bi-list-row.is-selected { background: #f1f8f4; box-shadow: inset 3px 0 #4b9d78; }
.bi-row-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bi-index { flex: none; width: 18px; text-align: center; color: #9aad9f; font-size: 11px; }
.bi-row-main .input { width: 100%; min-width: 0; height: 34px; min-height: 34px; padding: 5px 8px; font-size: 13px; }
.bi-list-row.is-bad .bi-row-main .input:first-of-type { border-color: #e1aaa3; }
.bi-row-meta { display: flex; align-items: center; gap: 9px; padding: 7px 1px 0 26px; color: #91a49a; font-size: 11px; }
.bi-row-error { color: #b6463e; }
.bi-row-link { border: 0; padding: 1px 2px; color: #6b8978; background: transparent; cursor: pointer; font-size: 11px; }
.bi-row-link:hover { color: #217b58; }
.bi-inline-error { display: block; margin: 5px 0 0 26px; padding: 0; border: 0; color: #b6463e; background: transparent; text-align: left; cursor: pointer; font-size: 11px; }
.bi-list-add { width: 100%; padding: 12px; border: 0; border-top: 1px dashed #d9e7dd; background: #fff; color: #448368; cursor: pointer; font-size: 12px; }
.bi-detail-title { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid #e8f0eb; background: #f8fbf9; }
.bi-detail-title span { color: #8a9d92; font-size: 11px; }
.bi-detail-title h3 { margin: 3px 0 0; color: #2b493c; font-size: 15px; }
.bi-detail-index { padding: 4px 7px; border-radius: 5px; background: #eaf3ed; }
.bi-detail-body { max-height: 460px; overflow-y: auto; padding: 0 16px 16px; }
.bi-detail-section { padding-top: 14px; margin-top: 14px; border-top: 1px solid #edf2ef; }
.bi-detail-section:first-child { border-top: 0; margin-top: 0; }
.bi-section-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; color: #375c4a; font-size: 13px; }
.bi-section-title span { color: #96a89d; font-size: 11px; }
.bi-detail-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.bi-span-all { grid-column: 1 / -1; }
.bi-detail-alert { margin-top: 12px; padding: 8px 10px; border-radius: 6px; color: #a13e34; background: #fff2ef; font-size: 11px; }
.bi-detail-alert.is-warning { color: #8c632b; background: #fff8ec; }
.bi-split-template-select { margin-bottom: 10px; }
.bi-split-template-items { display: grid; gap: 6px; }
.bi-split-template-item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid #e6eee9; border-radius: 7px; font-size: 11px; }
.bi-split-template-item > span { min-width: 58px; color: #456b58; }
.bi-split-template-item small { display: block; margin-top: 2px; color: #9aaca1; }
.bi-split-template-item label { display: flex; align-items: center; gap: 4px; color: #7e9387; white-space: nowrap; }
.bi-split-template-item .input { width: 66px; min-height: 32px; padding: 4px 6px; }
.bi-split-manual-cost { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.bi-split-manual-cost .bi-field:nth-child(2), .bi-split-manual-cost .bi-field:nth-child(3) { grid-column: 1 / -1; }
@media (max-width: 760px) { .bi-split-workspace { grid-template-columns: 1fr; } .bi-list-rows { max-height: 300px; } .bi-detail-body { max-height: none; } .bi-row-main .input, .bi-detail-pane .input, .bi-detail-pane .select { font-size: 16px; } }

/* 商品导入的统一成本明细编辑 */
.bi-cost-editor-hint { margin: 10px 0; color: #8a9d92; font-size: 11px; line-height: 1.5; }
.bi-cost-editor-head, .bi-cost-editor-row { display: grid; grid-template-columns: minmax(70px, 1fr) 65px 67px 72px 22px; align-items: center; gap: 5px; }
.bi-cost-editor-head { padding: 0 2px 5px; color: #91a39a; font-size: 10px; }
.bi-cost-editor-row { margin-bottom: 6px; }
.bi-cost-editor-row .input, .bi-cost-editor-row .select { width: 100%; min-width: 0; min-height: 32px; height: 32px; padding: 4px 5px; font-size: 12px; }
.bi-cost-editor-row .select { padding-right: 16px; }
.bi-cost-share-empty { color: #a0afa6; text-align: center; }
.bi-cost-remove { border: 0; background: transparent; color: #a2b0a7; cursor: pointer; font-size: 19px; }
.bi-cost-remove:hover { color: #b6453b; }
.bi-cost-add { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 9px; }
.bi-cost-add button { padding: 0; border: 0; background: transparent; color: #478569; cursor: pointer; font-size: 11px; }
@media (max-width: 420px) { .bi-cost-editor-head, .bi-cost-editor-row { grid-template-columns: minmax(60px,1fr) 62px 60px 65px 20px; gap: 3px; } }

/* 桌面批量导入：展开工作区，将当前商品设置平铺 */
@media (min-width: 1000px) {
  .product-import-sheet .sheet { width: calc(100vw - 48px); max-width: 1760px; max-height: calc(100dvh - 40px); }
  .product-import-sheet .sheet-head { padding: 13px 22px; }
  .product-import-sheet .sheet-body { padding: 10px 22px 14px; }
  .product-import-sheet .bi-workspace-head { margin: 0 0 7px; }
  .product-import-sheet .bi-workspace-head > div { flex-direction: row; align-items: baseline; gap: 10px; }
  .product-import-sheet .bi-rules { margin-bottom: 8px; }
  .product-import-sheet .bi-modes { margin-bottom: 8px; }
  .product-import-sheet .bi-split-intro { margin: 0 0 6px; }
  .product-import-sheet .bi-split-toolbar { margin-bottom: 8px; }
  .product-import-sheet .bi-list-rows { max-height: min(58vh, 620px); }
  .product-import-sheet .bi-detail-body { max-height: min(62vh, 700px); }
}
@media (min-width: 1200px) {
  .product-import-sheet .bi-split-workspace { grid-template-columns: minmax(360px, .75fr) minmax(660px, 1.25fr); }
  .product-import-sheet .bi-detail-body { display: grid; grid-template-columns: minmax(220px, .85fr) minmax(350px, 1.15fr); gap: 0 20px; align-items: start; }
  .product-import-sheet .bi-detail-alert { grid-column: 1 / -1; }
  .product-import-sheet .bi-classification { grid-column: 1; grid-row: 2; }
  .product-import-sheet .bi-other-section { grid-column: 1; grid-row: 3; }
  .product-import-sheet .bi-cost-section { grid-column: 2; grid-row: 2 / 4; border-top: 0; }
  .product-import-sheet .bi-classification, .product-import-sheet .bi-cost-section { margin-top: 0; border-top: 0; }
  .product-import-sheet .bi-detail-title { padding: 10px 16px; }
  .product-import-sheet .bi-detail-section { padding-top: 11px; }
}
@media (min-width: 1200px) {
  .product-import-sheet .sheet-body { position: relative; }
  .product-import-sheet .bi-workspace-head { position: absolute; top: 8px; right: 22px; margin: 0; }
  .product-import-sheet .bi-workspace-head > div { display: none; }
  .product-import-sheet .bi-rules { padding-right: 160px; min-height: 30px; align-items: center; }
  .product-import-sheet .bi-split-intro { display: none; }
  .product-import-sheet .bi-detail-alert { margin-top: 8px; padding: 6px 8px; }
}
@media (min-width: 1200px) {
  .product-import-sheet .bi-cost-editor-row { margin-bottom: 4px; }
  .product-import-sheet .bi-cost-editor-row .input, .product-import-sheet .bi-cost-editor-row .select { height: 29px; min-height: 29px; }
  .product-import-sheet .bi-cost-editor-hint { margin: 6px 0; }
  .product-import-sheet .bi-detail-body { padding-bottom: 10px; }
  .product-import-sheet .bi-sheet-stat, .product-import-sheet .bi-sheet-empty { margin-top: 6px; }
}

.bi-selected-file, .bi-file-empty { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 13px 15px; border: 1px solid #dce9e1; border-radius: 8px; background: #f5faf7; color: #496959; font-size: 12px; }
.bi-selected-file b, .bi-file-empty b { color: #305845; font-size: 13px; }
.bi-selected-file span { overflow-wrap: anywhere; }
.bi-selected-file small, .bi-file-empty span { color: #82998c; font-size: 12px; }
.bi-file-empty { border-style: dashed; }

.bi-import-photo { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf2ef; }
.bi-import-photo-thumb { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border: 1px solid #dce9e1; border-radius: 8px; background: #f3f8f5; color: #91a69a; font-size: 11px; overflow: hidden; }
.bi-import-photo-thumb img { width: 100%; height: 100%; object-fit: contain; }
.bi-import-photo b { color: #375c4a; font-size: 12px; }
.bi-import-photo small { color: #91a39a; font-size: 11px; }
.bi-import-photo-actions { display: flex; gap: 6px; margin: 4px 0; }
.bi-file-photo { display: inline-flex; align-items: center; gap: 5px; }
.bi-file-photo img { width: 32px; height: 32px; object-fit: contain; border: 1px solid #dce9e1; border-radius: 5px; }
.bi-file-photo button { padding: 0; border: 0; background: transparent; color: #5a806d; cursor: pointer; font-size: 11px; }
@media (min-width: 1200px) { .product-import-sheet .bi-import-photo { grid-column: 1 / -1; } }
@media (min-width: 1200px) {
  .product-import-sheet .bi-import-photo { grid-row: 1; }
  .product-import-sheet .bi-detail-alert { grid-row: 2; }
  .product-import-sheet .bi-classification { grid-row: 3; }
  .product-import-sheet .bi-other-section { grid-row: 4; }
  .product-import-sheet .bi-cost-section { grid-row: 3 / 5; }
}
.bi-detail-title .bi-import-photo { margin-left: auto; margin-right: 10px; padding: 0; border: 0; }
.bi-detail-title .bi-import-photo-thumb { width: 44px; height: 44px; }
.bi-detail-title .bi-import-photo-actions { margin: 2px 0 0; }
.bi-detail-title .bi-import-photo small { display: none; }
.bi-detail-title > div:first-child { min-width: 0; }
