/* 酒水回收 · 共用组件样式
   一套 HTML：.viewer 是查询容器，宽度 ≥900 出宽屏表格版，<900 出手持卡片版。
   PC 文件把 .viewer 铺满 1440，安卓文件把 .viewer 钉成 540×960，页面代码完全相同。 */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--text);
  background: #e9edf1;
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  color: inherit;
}
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
svg {
  display: block;
}

/* ---------- 舞台 / 容器 ---------- */
body.pc .viewer {
  width: 100%;
  min-height: 900px;
  container-type: inline-size;
  display: flex;
}
body.handset {
  background: #dfe4ea;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}
body.handset .viewer {
  width: 540px;
  height: 960px;
  flex: none;
  container-type: inline-size;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 24px 64px rgba(10, 30, 50, 0.28);
}

.app {
  position: relative;
  width: 100%;
  min-height: 900px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
body.handset .app {
  height: 100%;
  min-height: 0;
}

/* ---------- 顶栏（沿用酒水寄存截图的 #0099cc 蓝条） ---------- */
.topbar {
  flex: none;
  height: var(--topbar-h);
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-3) 0 var(--sp-1);
}
.topbar__back {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.topbar__back:hover {
  background: rgba(255, 255, 255, 0.16);
}
.topbar h1 {
  font-size: var(--fs-20);
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-2);
  white-space: nowrap;
}
.subbar__badge {
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-size: var(--fs-12);
}

/* ---------- 面包屑条 ---------- */
.subbar {
  flex: none;
  height: var(--subbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-6);
  font-size: var(--fs-13);
  color: var(--muted);
}
.subbar__sep {
  color: var(--muted);
}
.subbar b {
  color: var(--text);
  font-weight: 500;
}

/* ---------- 主滚动区 ---------- */
.app__scroll {
  flex: 1;
  min-height: 0;
}

/* ---------- 版式栅格 ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-w);
  grid-template-areas:
    "lines context"
    "extra context";
  align-items: start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6) var(--sp-3);
}
.card--context {
  grid-area: context;
}
.card--lines {
  grid-area: lines;
}
.card--extra {
  grid-area: extra;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.card__title {
  font-size: var(--fs-16);
  font-weight: 600;
}
.card__count {
  font-size: var(--fs-12);
  color: var(--muted);
}
.card__head .btn {
  margin-left: auto;
}
.card__body {
  padding: var(--sp-4);
}
.card__body--tight {
  padding: var(--sp-3) var(--sp-4);
}

/* ---------- 按钮 ---------- */
.btn {
  height: 36px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--fs-14);
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn--primary {
  background: var(--brand-solid);
  color: #fff;
}
.btn--primary:hover {
  background: var(--brand-solid-hover);
}
.btn--ghost {
  border-color: var(--line-input);
  color: var(--text-2);
}
.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn--sm {
  height: 30px;
  padding: 0 var(--sp-3);
  font-size: var(--fs-13);
}
.btn--ghost.btn--sm {
  padding: 0 10px;
}
.btn--lg {
  height: 40px;
  padding: 0 var(--sp-5);
}
.btn--dashed {
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
}
.btn--dashed:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
  background: var(--brand-tint-2);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn--icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--faint);
  border-radius: var(--r-sm);
}
.btn--icon:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ---------- 表单 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field + .field {
  margin-top: var(--sp-3);
}
.field__label {
  font-size: var(--fs-13);
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.field__label .req {
  color: var(--danger);
}
.field__hint {
  font-size: var(--fs-12);
  color: var(--faint);
}
.input,
.select,
.textarea {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-input);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: var(--fs-14);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}
.textarea {
  height: auto;
  min-height: 76px;
  padding: 8px 10px;
  line-height: 1.6;
  resize: none;
}
.input.is-err,
.select.is-err {
  border-color: var(--danger);
  background: #fffafa;
}
.err-msg {
  display: none;
  font-size: var(--fs-12);
  color: var(--danger);
}
.err-msg.is-on {
  display: block;
}

.input--bare {
  height: 34px;
  border-color: var(--line);
  font-size: var(--fs-13);
}

/* ---------- 分段控件（整瓶 / 散酒） ---------- */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: #f1f3f5;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.seg__btn {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-13);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}
.seg__btn:hover:not([disabled]) {
  color: var(--brand-ink);
}
.seg__btn.is-on {
  background: #fff;
  color: var(--brand-ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(16, 40, 64, 0.14);
}
.seg__btn[disabled] {
  color: #c2c9d2;
  cursor: not-allowed;
}

/* ---------- 数量：整瓶步进器 / 散酒滑块 ---------- */
.stepper {
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 1px solid var(--line-input);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #fff;
}
.stepper button {
  width: 32px;
  height: 100%;
  border: 0;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}
.stepper button:hover {
  background: var(--brand-tint);
  color: var(--brand-deep);
}
.stepper input {
  width: 44px;
  height: 100%;
  border: 0;
  text-align: center;
  font-family: var(--num);
  font-size: var(--fs-14);
  font-variant-numeric: tabular-nums;
}
.stepper input:focus {
  outline: none;
  background: var(--brand-tint-2);
}

.loose {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.loose__row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.loose input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.loose input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: linear-gradient(
    90deg,
    var(--brand) 0 var(--p, 40%),
    #e6e9ee var(--p, 40%) 100%
  );
}
.loose input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  box-shadow: 0 1px 4px rgba(16, 40, 64, 0.28);
}
.loose__num {
  width: 46px;
  height: 30px;
  flex: none;
  border: 1px solid var(--line-input);
  border-radius: var(--r-sm);
  text-align: center;
  font-family: var(--num);
  font-size: var(--fs-13);
}
.loose__num:focus {
  outline: none;
  border-color: var(--brand);
}
.loose__read {
  font-size: var(--fs-12);
  color: var(--muted);
  white-space: nowrap;
}
.loose__read b {
  font-family: var(--num);
  color: var(--text);
  font-weight: 500;
}

/* ---------- 商品明细 ---------- */
.lines__head,
.line {
  display: grid;
  align-items: center;
  gap: var(--sp-2) 10px;
}
.lines__head {
  grid-template-columns: minmax(0, 1fr) 112px 204px 124px 140px 30px;
  padding: 9px var(--sp-4);
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-12);
  color: var(--text-2);
}
.lines__head span:last-child {
  text-align: center;
}
.line {
  grid-template-areas: "goods type qty amount note del";
  grid-template-columns: minmax(0, 1fr) 112px 204px 124px 140px 30px;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.line:last-child {
  border-bottom: 0;
}
.line__goods {
  grid-area: goods;
  min-width: 0;
}
.line__type {
  grid-area: type;
}
.line__qty {
  grid-area: qty;
}
.line__amount {
  grid-area: amount;
}
.line__note {
  grid-area: note;
}
.line__del {
  grid-area: del;
  justify-self: end;
}
.goods__name {
  font-size: var(--fs-14);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goods__meta {
  margin-top: 2px;
  font-size: var(--fs-12);
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.line[data-mode="bottle"] .loose {
  display: none;
}
.line[data-mode="loose"] .stepper {
  display: none;
}
.amount {
  text-align: right;
  font-family: var(--num);
  font-size: var(--fs-16);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.amount--sub {
  display: block;
  font-family: var(--font);
  font-size: var(--fs-12);
  font-weight: 400;
  color: var(--faint);
  margin-top: 1px;
}
.mini-lbl {
  display: none;
  font-size: var(--fs-12);
  color: var(--muted);
  margin-bottom: 4px;
}

.lines__sum {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  font-size: var(--fs-13);
  color: var(--muted);
}
.lines__sum b {
  font-family: var(--num);
  color: var(--text);
  font-weight: 500;
}
.lines__sum .sum__total {
  margin-left: auto;
  color: var(--text-2);
  white-space: nowrap;
}
.lines__sum .sum__total b {
  font-size: var(--fs-16);
  font-weight: 600;
  margin-left: 4px;
}
.lines__empty {
  padding: 44px var(--sp-4);
  text-align: center;
  color: var(--faint);
  font-size: var(--fs-13);
}
.lines__empty[hidden] {
  display: none;
}

/* ---------- 右侧信息 ---------- */
.note {
  display: flex;
  gap: var(--sp-2);
  padding: 10px var(--sp-3);
  background: var(--brand-tint-2);
  border: 1px solid var(--brand-line);
  border-radius: var(--r-sm);
  font-size: var(--fs-12);
  line-height: 1.55;
  color: #0a6785;
}
.note svg {
  flex: none;
  margin-top: 2px;
}
.note b {
  font-weight: 600;
}
.kv {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: var(--fs-13);
}
.kv:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.kv__k {
  color: var(--muted);
  flex: none;
}
.kv__v {
  text-align: right;
  color: var(--text);
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  background: var(--idle-bg);
  color: var(--idle);
  font-size: var(--fs-12);
  white-space: nowrap;
}
.tag--brand {
  background: var(--brand-tint);
  color: var(--brand-deep);
}
.tag--ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.tag--warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.char-count {
  text-align: right;
  font-size: var(--fs-12);
  color: var(--faint);
  margin-top: 4px;
}

/* 间距工具：4 / 8 的倍数 */
.mt-2 {
  margin-top: var(--sp-2);
}
.mt-3 {
  margin-top: var(--sp-3);
}
.mt-4 {
  margin-top: var(--sp-4);
}

/* ---------- 照片 ---------- */
.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: var(--sp-2);
}
.photo {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #0d1a26;
}
.photo svg {
  width: 100%;
  height: 100%;
}
.photo__del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 16, 26, 0.6);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.photo:hover .photo__del {
  opacity: 1;
}
.photo--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  color: var(--faint);
  font-size: var(--fs-12);
  white-space: nowrap;
  cursor: pointer;
}
.photo--add:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-tint-2);
}

/* ---------- 底栏 ---------- */
.actionbar {
  flex: none;
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px rgba(16, 40, 64, 0.06);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-6);
  min-height: var(--actionbar-h);
}
.actionbar__sum {
  font-size: var(--fs-13);
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.actionbar__sum .money {
  font-family: var(--num);
  font-size: var(--fs-20);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.actionbar__label {
  font-size: var(--fs-12);
  letter-spacing: 0.04em;
}
.actionbar__sub {
  font-size: var(--fs-12);
  color: var(--muted);
}
.actionbar__sub b {
  font-family: var(--num);
  color: var(--text-2);
  font-weight: 500;
}
.actionbar__btns {
  margin-left: auto;
  display: flex;
  gap: var(--sp-2);
}

/* ---------- 成功提示条 ---------- */
.banner {
  display: none;
  align-items: center;
  gap: 10px;
  margin: var(--sp-3) var(--sp-6) 0;
  padding: 10px var(--sp-4);
  border: 1px solid var(--ok-line);
  border-radius: var(--r-md);
  background: var(--ok-bg);
  color: #0a6b3e;
  font-size: var(--fs-13);
}
.banner.is-on {
  display: flex;
}
.banner--danger {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: var(--danger);
}
.banner--muted {
  background: var(--idle-bg);
  border-color: var(--line);
  color: var(--text-2);
}
.banner b {
  font-family: var(--num);
}

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  background: rgba(10, 26, 42, 0.46);
}
.overlay.is-open {
  display: flex;
}
.modal {
  width: min(720px, 100%);
  max-height: min(640px, 88vh);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.modal__head {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.modal__title {
  font-size: var(--fs-16);
  font-weight: 600;
}
.modal__close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.modal__close:hover {
  background: var(--idle-bg);
}
.modal__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
}
.modal__foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.modal__foot .btn--primary {
  margin-left: auto;
}
.searchwrap {
  position: relative;
  margin-bottom: var(--sp-3);
}
.searchwrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
}
.searchwrap .input {
  padding-left: 32px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--sp-2);
}
.chip {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line-input);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--text-2);
  font-size: var(--fs-13);
  cursor: pointer;
}
.chip:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}
.chip.is-on {
  background: var(--brand-tint);
  border-color: var(--brand);
  color: var(--brand-deep);
  font-weight: 500;
}
.cat-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-2);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.cat-row:hover {
  background: var(--brand-tint-2);
}
.cat-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--brand);
  cursor: pointer;
}
.cat-goods {
  min-width: 0;
  flex: 1;
}
.cat-name {
  display: block;
  font-size: var(--fs-14);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-meta {
  display: block;
  font-size: var(--fs-12);
  color: var(--faint);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 10px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-4);
  border-radius: var(--r-pill);
  background: rgba(14, 30, 46, 0.94);
  color: #fff;
  font-size: var(--fs-13);
  box-shadow: 0 8px 24px rgba(10, 26, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s,
    transform 0.18s;
  max-width: calc(100% - 32px);
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast svg {
  flex: none;
}

/* ============================================================
   窄画幅（安卓手持 540×960）：单列卡片版
   ============================================================ */
@container (max-width: 899px) {
  .app {
    --topbar-h: 52px;
    --subbar-h: 40px;
    background: var(--bg);
  }
  .topbar {
    padding: 0 var(--sp-2) 0 var(--sp-1);
    gap: 0;
  }
  .topbar h1 {
    font-size: var(--fs-20);
  }
  .subbar {
    padding: 0 var(--sp-3);
    font-size: var(--fs-12);
  }
  .subbar__right > .subbar__store {
    display: none;
  }
  .app__scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "context"
      "lines"
      "extra";
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-3) var(--sp-4);
  }
  .banner {
    margin: var(--sp-3) var(--sp-3) 0;
  }
  .card__head {
    padding: 10px var(--sp-3);
  }
  .card__body {
    padding: var(--sp-3);
  }
  .card__body--tight {
    padding: 10px var(--sp-3);
  }
  .lines__head {
    display: none;
  }
  .lines__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px var(--sp-3) var(--sp-3);
  }
  .line {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-areas:
      "goods goods del"
      "type qty qty"
      "amount note note";
    padding: 10px var(--sp-3) var(--sp-3);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
    gap: 8px 10px;
  }
  .line:last-child {
    border-bottom: 1px solid var(--line);
  }
  .line__qty {
    justify-self: stretch;
  }
  .line__qty .stepper {
    width: 100%;
  }
  .line__qty .stepper input {
    flex: 1;
  }
  .line__note .input {
    height: 34px;
  }
  .mini-lbl {
    display: block;
  }
  .amount {
    text-align: left;
    font-size: var(--fs-16);
  }
  .lines__sum {
    flex-wrap: wrap;
    gap: 6px var(--sp-3);
    padding: 10px var(--sp-3);
  }
  .lines__sum .sum__total {
    margin-left: 0;
    width: 100%;
  }
  .actionbar {
    padding: 10px var(--sp-3);
    min-height: 68px;
  }
  .actionbar__sum {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .actionbar__sum .money {
    font-size: var(--fs-20);
  }
  .actionbar__sub {
    display: none;
  }
  .actionbar__sub.list-sum {
    display: block;
    font-size: var(--fs-12);
    line-height: 1.5;
  }
  .actionbar__btns .btn {
    height: 44px;
    padding: 0 var(--sp-4);
  }
  .actionbar__btns .actionbar__cancel {
    display: none;
  }
  /* 列表页：表格转单列卡片 */
  .listbody {
    padding: var(--sp-3);
  }
  .table-wrap {
    border: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }
  .rows__head {
    display: none;
  }
  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "time status"
      "goods goods"
      "amount stock"
      "desk applicant"
      "ops ops";
    min-width: 0;
    margin-bottom: 10px;
    padding: 12px;
    gap: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
  }
  .row:last-child {
    border-bottom: 1px solid var(--line);
  }
  .c-time {
    grid-area: time;
  }
  .c-status {
    grid-area: status;
    justify-self: end;
  }
  .c-goods {
    grid-area: goods;
  }
  .c-qty {
    display: none;
  }
  .c-amount {
    grid-area: amount;
    font-size: var(--fs-16);
  }
  .c-desk {
    grid-area: desk;
  }
  .c-applicant {
    grid-area: applicant;
    justify-self: end;
    text-align: right;
  }
  .c-ops {
    grid-area: ops;
    padding-top: var(--sp-2);
    border-top: 1px solid var(--line);
  }
  .c-ops .btn {
    flex: 1;
    height: 36px;
    font-size: var(--fs-13);
  }
  .c-photo,
  .c-reviewer {
    display: none;
  }
  .c-stock {
    grid-area: stock;
    justify-self: end;
  }
  .c-amount {
    justify-self: start;
  }
  .pagetools {
    flex-wrap: wrap;
    padding: 10px var(--sp-3);
    gap: var(--sp-2);
  }
  .tabs {
    width: 100%;
    overflow-x: auto;
  }
  .tab {
    flex: 1;
    padding: 0 10px;
  }
  .pagetools__right {
    width: 100%;
    justify-content: flex-end;
  }
  .filters {
    padding: 10px var(--sp-3);
    gap: 10px;
  }
  .filter--w180,
  .filter--w150,
  .filter--w130 {
    width: calc(50% - 5px);
  }
  .filters__btns {
    width: 100%;
    margin-left: 0;
  }
  .filters__btns .btn {
    flex: 1;
    height: 36px;
  }
  .drawer__panel {
    width: 100%;
  }
  .listbody .actionbar__sum {
    max-width: 100%;
  }
  /* 弹层在手持端变成全屏页 */
  .overlay {
    position: absolute;
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .modal {
    width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
  }
  .modal__head {
    padding: var(--sp-3) var(--sp-3);
  }
  .modal__body {
    padding: var(--sp-2) var(--sp-3) var(--sp-3);
  }
  .modal__foot {
    padding: 10px var(--sp-3);
  }
  .cat-row {
    padding: 10px 0;
    gap: 10px;
  }
  .toast {
    bottom: 84px;
  }
  .photo__del {
    opacity: 1;
  }
}

/* ============================================================
   列表页：页签 / 筛选 / 表格 / 状态 / 抽屉
   ============================================================ */
.pagetools {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-6);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.tabs {
  display: inline-flex;
  gap: var(--sp-1);
  padding: 3px;
  background: #f1f3f5;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.tab {
  height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-13);
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover {
  color: var(--brand-ink);
}
.tab.is-on {
  background: #fff;
  color: var(--brand-ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(16, 40, 64, 0.14);
}
.tab__n {
  margin-left: 4px;
  font-family: var(--num);
  font-size: var(--fs-12);
  color: var(--text-2);
}
.tab.is-on .tab__n {
  color: var(--brand-ink);
}
.pagetools__right {
  margin-left: auto;
  display: flex;
  gap: var(--sp-2);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-6);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter > label {
  font-size: var(--fs-12);
  color: var(--muted);
}
.filter .input,
.filter .select {
  height: 34px;
  font-size: var(--fs-13);
}
.filter--w180 {
  width: 180px;
}
.filter--w150 {
  width: 150px;
}
.filter--w130 {
  width: 130px;
}
.filters__btns {
  display: flex;
  gap: var(--sp-2);
  margin-left: auto;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.rows__head,
.row {
  display: grid;
  grid-template-columns:
    156px 88px minmax(0, 1fr) 100px 68px 140px 68px 84px 76px 150px;
  align-items: center;
  gap: var(--sp-2);
  min-width: 1120px;
}
.rows__head {
  padding: 9px var(--sp-4);
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-12);
  color: var(--text-2);
}
.row {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s;
}
.row:hover {
  background: var(--brand-tint-2);
}
.row:last-child {
  border-bottom: 0;
}
.row--empty {
  display: block;
  padding: 56px var(--sp-4);
  text-align: center;
  color: var(--faint);
  font-size: var(--fs-13);
  cursor: default;
}
.row--empty:hover {
  background: none;
}
.c-time {
  font-size: var(--fs-13);
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
}
.c-time small {
  display: block;
  font-family: var(--font);
  font-size: var(--fs-12);
  color: var(--muted);
}
.c-user {
  font-size: var(--fs-13);
}
.c-user small {
  display: block;
  font-size: var(--fs-12);
  color: var(--muted);
  font-family: var(--num);
}
.c-goods {
  min-width: 0;
}
.c-goods .g1 {
  font-size: var(--fs-13);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-goods .g2 {
  font-size: var(--fs-12);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-qty {
  font-size: var(--fs-13);
  font-variant-numeric: tabular-nums;
}
.c-qty small {
  display: block;
  font-size: var(--fs-12);
  color: var(--muted);
}
.c-amount {
  text-align: right;
  font-family: var(--num);
  font-size: var(--fs-14);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.thumbs {
  display: flex;
}
.thumbs .t {
  width: 26px;
  height: 26px;
  border-radius: var(--r-xs);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-left: -6px;
  background: #0d1a26;
}
.thumbs .t:first-child {
  margin-left: 0;
}
.thumbs .t svg {
  width: 100%;
  height: 100%;
}
.thumbs .more {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: -6px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--idle-bg);
  font-size: var(--fs-12);
  color: var(--text-2);
  font-family: var(--num);
}
.c-desk {
  font-size: var(--fs-13);
}
.c-desk small {
  display: block;
  font-size: var(--fs-12);
  color: var(--muted);
  font-family: var(--num);
  white-space: nowrap;
}
.c-status {
  justify-self: start;
}
.c-ops {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}
.c-ops .btn {
  height: 28px;
  padding: 0 8px;
  font-size: var(--fs-12);
  border-radius: var(--r-xs);
}
.c-ops .btn--ghost {
  border-color: var(--line);
}

/* 状态标签 */
.st {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  font-size: var(--fs-12);
  white-space: nowrap;
}
.st::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.st--pending {
  background: var(--warn-bg);
  color: var(--warn);
}
.st--done {
  background: var(--ok-bg);
  color: var(--ok);
}
.st--rejected {
  background: var(--danger-bg);
  color: var(--danger);
}
.st--void {
  background: var(--idle-bg);
  color: var(--idle);
}

/* 抽屉 */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  justify-content: flex-end;
  background: rgba(10, 26, 42, 0.42);
}
.drawer.is-open {
  display: flex;
}
.drawer__panel {
  width: min(520px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.drawer__head {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.drawer__head h2 {
  font-size: var(--fs-16);
  font-weight: 600;
}
.drawer__head .sub {
  margin-top: 2px;
  font-size: var(--fs-12);
  color: var(--muted);
  font-family: var(--num);
}
.drawer__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--sp-4) var(--sp-5);
}
.drawer__foot {
  flex: none;
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.drawer__foot .btn {
  flex: 1;
}
.dn {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: var(--sp-3);
  padding: 8px 0;
  font-size: var(--fs-13);
  border-bottom: 1px dashed var(--line);
}
.dn__k {
  color: var(--muted);
}
.dn:last-of-type {
  border-bottom: 0;
}
.dsec {
  margin: var(--sp-4) 0 var(--sp-2);
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--text-2);
}
.warnbox {
  display: flex;
  gap: var(--sp-2);
  padding: 10px var(--sp-3);
  border: 1px solid var(--danger-line);
  border-radius: var(--r-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: var(--fs-12);
  line-height: 1.55;
}
.okbox {
  display: flex;
  gap: var(--sp-2);
  padding: 10px var(--sp-3);
  border: 1px solid var(--ok-line);
  border-radius: var(--r-sm);
  background: var(--ok-bg);
  color: var(--ok);
  font-size: var(--fs-12);
  line-height: 1.55;
}
.stockline {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 7px 0;
  font-size: var(--fs-13);
  color: var(--text-2);
  border-bottom: 1px dashed var(--line);
}
.stockline b {
  font-family: var(--num);
  color: var(--text);
}

/* 弹窗表单 */
.modal--sm {
  width: min(480px, 100%);
}
.radio-row {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-input);
  border-radius: var(--r-sm);
  font-size: var(--fs-13);
  cursor: pointer;
}
.radio-row input {
  accent-color: var(--brand);
}

.topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: #fff;
}
.topbar__who {
  font-size: var(--fs-13);
}
.topbar__id {
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--brand-ink);
  font-size: var(--fs-12);
  font-weight: 500;
}
.listbody {
  padding: var(--sp-4) var(--sp-6);
}

/* ============================================================
   审核详情页
   ============================================================ */
.a-lgrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas: "main side";
  align-items: start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6) var(--sp-3);
}
.a-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 0;
}
.a-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.arow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 108px 108px;
  gap: var(--sp-2);
  align-items: center;
  padding: 11px var(--sp-4);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-13);
}
.arow:last-child {
  border-bottom: 0;
}
.arow--head {
  padding: 9px var(--sp-4);
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-12);
  color: var(--text-2);
}
.arow__name {
  min-width: 0;
}
.arow__name b {
  display: block;
  font-weight: 500;
  font-size: var(--fs-14);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arow__name span {
  font-size: var(--fs-12);
  color: var(--muted);
}
.arow__type,
.arow__qty {
  font-size: var(--fs-13);
  white-space: nowrap;
}
.arow__amount {
  text-align: right;
  font-family: var(--num);
  font-size: var(--fs-14);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.photos--lg {
  grid-template-columns: repeat(auto-fill, 88px);
}
.statusbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-4);
  background: var(--warn-bg);
  border-bottom: 1px solid #f0dcb8;
  font-size: var(--fs-13);
  color: var(--warn);
}
.statusbar.is-done {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}
.statusbar.is-rejected {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: var(--danger);
}
.statusbar.is-void {
  background: var(--idle-bg);
  border-color: var(--line);
  color: var(--idle);
}
.tl {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tl li {
  position: relative;
  padding: 0 0 16px 18px;
  font-size: var(--fs-13);
  color: var(--text-2);
}
.tl li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}
.tl li::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl li:last-child {
  padding-bottom: 0;
}
.tl li:last-child::after {
  display: none;
}
.tl li.is-now::before {
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.tl time {
  display: block;
  font-family: var(--num);
  font-size: var(--fs-12);
  color: var(--muted);
  margin-bottom: 1px;
}

@container (max-width: 899px) {
  .a-lgrid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "side" "main";
    padding: var(--sp-3);
    gap: var(--sp-3);
  }
  .arow {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name amount" "type qty";
    gap: 2px var(--sp-2);
  }
  .arow__name {
    grid-area: name;
  }
  .arow__amount {
    grid-area: amount;
  }
  .arow__type {
    grid-area: type;
  }
  .arow__qty {
    grid-area: qty;
    text-align: right;
  }
  .arow--head {
    display: none;
  }
  .photos--lg {
    grid-template-columns: repeat(auto-fill, 76px);
  }
}

/* 商品明细行（列表/明细共用） */
.gi {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-right: 8px;
  font-size: var(--fs-12);
  line-height: 1.75;
}
.gi__n {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.gi__q {
  flex: none;
  color: var(--text-2);
}
.gi__a {
  flex: none;
  width: 76px;
  text-align: right;
  font-family: var(--num);
  color: var(--text-2);
}
.gi--more {
  color: var(--muted);
  padding-top: 2px;
}

.list-sum b {
  font-family: var(--num);
  color: var(--text);
  font-weight: 600;
}

/* 窄画幅覆盖：必须放在宽屏表格规则之后，否则被 grid-template-columns 盖掉 */
@container (max-width: 899px) {
  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "time status"
      "goods goods"
      "amount stock"
      "desk applicant"
      "ops ops";
    min-width: 0;
  }
}

/* 列表分页：宽屏用页码，窄幅用加载更多 */
.load-more {
  display: none;
  width: 100%;
  height: 44px;
  margin-top: var(--sp-2);
}
@container (max-width: 899px) {
  .load-more {
    display: flex;
  }
  .load-more[hidden] {
    display: none;
  }
  .pager-controls {
    display: none;
  }
}
