:root {
  --blue: #1768e8;
  --dark-blue: #0f3f7a;
  --bg: #eef1f5;
  --panel: #ffffff;
  --line: #dfe4ea;
  --muted: #7a8491;
  --text: #17212f;
  --danger: #e11d2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.pos-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #111827;
}

.pos-login-card {
  width: 360px;
  padding: 28px;
  border-radius: 12px;
  background: #fff;
  display: grid;
  gap: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.pos-login-card img {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
}

.pos-login-card h1 {
  margin: 0;
}

.pos-login-card label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.pos-login-card input,
.pos-login-card button {
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 12px;
}

.pos-login-card button {
  border: 0;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.pos-error {
  margin: 0;
  color: var(--danger);
}

.pos-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 56px auto 1fr;
}

.pos-topbar {
  height: 56px;
  background: #0f3b75;
  color: #dbeafe;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
}

.pos-top-left,
.pos-top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pos-top-actions {
  justify-content: flex-end;
}

.pos-top-btn-primary {
  padding: 7px 12px;
  border-radius: 6px;
  background: #16a34a;
  color: #fff;
  font-weight: 700;
}

.pos-top-btn-primary:hover { background: #15803d; }

.pos-title {
  color: #fff;
  font-size: 18px;
}

.pos-icon-btn,
.pos-top-btn {
  border: 0;
  background: transparent;
  color: inherit;
}

body:has(.pos-menu-overlay:not(.hidden)) {
  overflow: hidden;
}

.pos-menu-overlay {
  position: fixed;
  inset: 56px auto 0 0;
  z-index: 45;
  width: 100%;
  background: rgba(15, 23, 42, 0.28);
}

.pos-menu-drawer {
  width: 608px;
  max-width: calc(100vw - 24px);
  height: calc(100vh - 56px);
  background: #f5f7fb;
  box-shadow: 10px 0 28px rgba(15, 23, 42, 0.18);
  overflow: auto;
}

.pos-menu-head {
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.pos-menu-head strong {
  text-align: center;
  font-size: 22px;
  letter-spacing: 0;
}

.pos-menu-head button {
  border: 0;
  background: transparent;
  font-size: 30px;
  color: #475569;
}

.pos-menu-section {
  position: relative;
  margin: 16px 18px;
  padding: 16px 18px 18px;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 5px 18px rgb(15 23 42 / 4%);
}

.pos-menu-section h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  color: #172033;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .02em;
}

.pos-menu-section h3::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2563eb, #60a5fa);
  box-shadow: 0 2px 6px rgb(37 99 235 / 28%);
}

.pos-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 8px 10px;
}

.pos-menu-grid button {
  min-width: 0;
  min-height: 92px;
  padding: 9px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #263244;
  font: inherit;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.pos-menu-grid button:hover {
  transform: translateY(-2px);
  border-color: #dce7f5;
  background: #f7faff;
  box-shadow: 0 7px 16px rgb(30 64 175 / 8%);
}

.pos-menu-grid button:active {
  transform: translateY(0) scale(.98);
  box-shadow: none;
}

.pos-menu-grid button:focus-visible {
  outline: 3px solid rgb(59 130 246 / 24%);
  outline-offset: 2px;
  border-color: #93c5fd;
}

.pos-menu-icon {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--icon-start, #60a5fa), var(--icon-end, #2563eb));
  box-shadow: 0 8px 16px var(--icon-shadow, rgb(37 99 235 / 22%)), inset 0 1px 0 rgb(255 255 255 / 25%);
  overflow: hidden;
}

.pos-menu-icon::after {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 45%;
  border-radius: 14px 14px 50% 50%;
  background: linear-gradient(180deg, rgb(255 255 255 / 18%), transparent);
  pointer-events: none;
}

.pos-menu-icon svg {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pos-menu-label {
  color: #293548;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.pos-menu-icon.tone-red {
  --icon-start: #fb7185;
  --icon-end: #ef4444;
  --icon-shadow: rgb(239 68 68 / 24%);
}

.pos-menu-icon.tone-blue {
  --icon-start: #60a5fa;
  --icon-end: #2563eb;
  --icon-shadow: rgb(37 99 235 / 24%);
}

.pos-menu-icon.tone-indigo {
  --icon-start: #818cf8;
  --icon-end: #4f46e5;
  --icon-shadow: rgb(79 70 229 / 24%);
}

.pos-menu-icon.tone-green {
  --icon-start: #34d399;
  --icon-end: #059669;
  --icon-shadow: rgb(5 150 105 / 24%);
}

.pos-menu-icon.tone-orange {
  --icon-start: #fbbf24;
  --icon-end: #f97316;
  --icon-shadow: rgb(249 115 22 / 24%);
}

.pos-menu-icon.tone-slate {
  --icon-start: #64748b;
  --icon-end: #334155;
  --icon-shadow: rgb(51 65 85 / 24%);
}

.pos-menu-foot {
  margin: 24px 18px;
  color: #64748b;
  text-align: center;
}

.pos-icon-btn {
  font-size: 22px;
}

.pos-top-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.pos-count-button {
  position: relative;
}

.pos-action-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 7px;
  padding: 0 6px;
  border-radius: 10px;
  color: #fff;
  background: #e11d48;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pos-action-count[hidden] {
  display: none !important;
}

.pos-modal-card.module-writing {
  position: relative;
  cursor: progress;
}

.pos-modal-card.module-writing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 90;
  border-radius: inherit;
  background: rgb(248 250 252 / 76%);
  backdrop-filter: blur(1px);
}

.pos-modal-card.module-writing::after {
  content: "处理中…";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 91;
  transform: translate(-50%, -50%);
  padding: 11px 18px;
  border-radius: 6px;
  color: #fff;
  background: #0f172a;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgb(15 23 42 / 24%);
}

.pos-merge-choice-card {
  width: min(560px, calc(100vw - 32px));
  grid-template-rows: auto 1fr auto;
}

.pos-merge-choice-body {
  padding: 22px;
  overflow: auto;
}

.pos-merge-choice-body > p {
  margin: 0 0 14px;
  color: #475569;
  line-height: 1.7;
}

.pos-merge-choice-list {
  display: grid;
  gap: 8px;
}

.pos-merge-choice-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 12px;
  border: 1px solid #dfe4ea;
  border-radius: 6px;
  background: #f8fafc;
}

.pos-merge-choice-item strong:last-child {
  white-space: nowrap;
}

.pos-terminal-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.pos-terminal-bar label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.pos-terminal-bar select {
  flex: 1;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 10px;
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 430px;
  min-height: 0;
}

.pos-left,
.pos-right {
  min-height: 0;
  background: #fff;
}

.pos-left {
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: start;
  overflow: hidden;
}

.pos-search-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  padding: 12px 16px;
}

.pos-search-row input,
.pos-search-row button {
  border: 1px solid var(--line);
  border-radius: 4px;
  height: 48px;
  padding: 0 14px;
}

.pos-linked-seat-guard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 16px 10px;
  padding: 10px 12px;
  border: 1px solid #93c5fd;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.45;
}

.pos-linked-seat-guard strong {
  font-size: 14px;
}

.pos-linked-seat-guard.is-error {
  border-color: #fca5a5;
  border-left-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

.pos-cart-table tr.is-required-game {
  background: #f0fdf4;
}

.pos-cart-table button:disabled,
.pos-cart-table input:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.pos-search-row button {
  background: #fff;
  color: #1f4f91;
  font-weight: 800;
}

.pos-cart-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  align-self: start;
}

.pos-cart-table col:nth-child(1) {
  width: 48px;
}

.pos-cart-table col:nth-child(2) {
  width: 34%;
}

.pos-cart-table col:nth-child(3) {
  width: 150px;
}

.pos-cart-table col:nth-child(4),
.pos-cart-table col:nth-child(5),
.pos-cart-table col:nth-child(6) {
  width: 116px;
}

.pos-cart-table col:nth-child(7) {
  width: 82px;
}

.pos-cart-table th {
  background: #f4f6f8;
  color: #3f4b5a;
  text-align: left;
  padding: 10px 8px;
  font-weight: 700;
}

.pos-cart-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  height: 68px;
}

.pos-cart-name strong,
.pos-product-main strong {
  display: block;
  font-weight: 800;
}

.pos-cart-name small,
.pos-product-main small,
.pos-member-info,
.pos-held-meta {
  color: var(--muted);
}

.pos-cart-name strong {
  line-height: 1.28;
  max-height: 40px;
  overflow: hidden;
}

.pos-cart-name small {
  display: block;
  margin-top: 4px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-qty {
  display: inline-grid;
  grid-template-columns: 28px 54px 28px;
  height: 30px;
}

.pos-qty button,
.pos-remove-btn {
  border: 1px solid var(--line);
  background: #fff;
}

.pos-qty input {
  border: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  text-align: center;
}

.pos-remove-btn {
  border-radius: 50%;
  color: var(--danger);
  width: 24px;
  height: 24px;
}

.pos-row-actions {
  white-space: nowrap;
}

.pos-edit-btn {
  width: 28px;
  height: 24px;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  color: #1768e8;
  background: #eff6ff;
  margin-right: 4px;
  font-weight: 800;
}

.pos-badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  margin-right: 6px;
}

.pos-badge.gift {
  background: #ef4444;
}

.pos-badge.discount {
  background: #f97316;
}

.pos-badge.required {
  width: auto;
  padding: 0 5px;
  background: #16803c;
  font-size: 11px;
}

.pos-cart-table tr.is-gift {
  background: #fff7ed;
}

/* The member area is a compact card, not a fixed-height full-width footer. */
.pos-member-strip {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}
.pos-member-strip > button,
.pos-action-row button,
.pos-secondary-wide {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  height: 42px;
  color: #1f4f91;
  font-weight: 800;
}
.pos-member-strip > button {
  padding: 0 18px;
}
.pos-action-row button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pos-member-strip.has-member > button,
.pos-member-info.empty {
  display: none;
}
.pos-member-info.selected {
  width: min(100%, 630px);
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-areas: "avatar main actions" "stats stats stats";
  align-items: start;
  gap: 6px 12px;
  padding: 10px 12px;
  border: 1px solid #dce6f3;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(18, 44, 78, .05);
}

.pos-member-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f6ae1b;
  color: #fff;
  font-size: 0;
  position: relative;
  grid-area: avatar;
}

.pos-member-avatar::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  position: absolute;
  top: 9px;
}

.pos-member-avatar::after {
  content: "";
  width: 24px;
  height: 13px;
  border: 2px solid #fff;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  position: absolute;
  bottom: 8px;
}

.pos-member-main {
  grid-area: main;
  display: grid;
  gap: 3px;
  min-width: 0;
}
.pos-member-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
  min-width: 0;
}
.pos-member-name-row strong {
  font-size: 16px;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* 等级做成徽标，跟标签区分开：等级只有一个且不可点，标签可能有很多个。 */
.pos-level-badge {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: #fff3d9;
  color: #d97706;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 18px;
  white-space: nowrap;
}

.pos-member-phone {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* 新余额口径只含本金；括号里保留原系统含赠金的余额供对账。 */
.pos-member-balance-line {
  color: #3f4a5a;
  font-size: 12px;
  font-weight: 700;
}

.pos-member-discount-line {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.pos-member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.pos-member-tags.is-empty {
  color: #aab4c0;
  font-size: 12px;
}

.pos-tag-chip {
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  overflow-wrap: anywhere;
}

.pos-member-stats {
  grid-area: stats;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 6px 0 0 54px;
  border-top: 1px solid #eef2f7;
}
.pos-member-stat { display: flex; align-items: baseline; gap: 6px; color: #64748b; }
.pos-member-stat small { font-size: 12px; }
.pos-member-stat strong { color: var(--text); font-size: 14px; white-space: nowrap; }

.pos-right {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 12px;
}

.pos-action-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.pos-summary {
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.pos-summary div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-summary span {
  color: var(--muted);
}

.pos-summary strong {
  font-size: 20px;
}

.pos-payable strong {
  color: var(--danger);
  font-size: 28px;
}

.pos-pay-btn {
  height: 68px;
  border: 0;
  border-radius: 6px;
  background: #1f64f2;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.pos-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.48);
}

.pos-modal-card,
.pos-pay-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
}

.pos-modal-card {
  width: min(900px, calc(100vw - 80px));
  max-height: calc(100vh - 80px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.pos-product-modal-card {
  width: min(1120px, calc(100vw - 48px));
  height: min(820px, calc(100vh - 48px));
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.pos-module-card {
  width: min(1120px, calc(100vw - 40px));
  height: min(780px, calc(100vh - 40px));
  grid-template-rows: auto 1fr;
  background: #f6f8fb;
}

.pos-order-detail-card {
  width: min(1120px, calc(100vw - 40px));
  height: min(760px, calc(100vh - 40px));
  grid-template-rows: auto 1fr;
  background: #f6f8fb;
}

.pos-held-modal-card {
  width: min(1280px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 32px));
  grid-template-rows: auto 1fr auto;
  background: #f6f8fb;
}

.pos-modal-head {
  height: 58px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.pos-modal-head button {
  border: 0;
  background: transparent;
  font-size: 26px;
}

.pos-modal-search {
  height: 56px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  font-size: 18px;
}

.pos-product-list,
.pos-member-list,
.pos-held-list {
  overflow: auto;
  max-height: 560px;
}

.pos-product-list {
  max-height: none;
  align-self: stretch;
  background: #fff;
  display: grid;
  /* 卡片宽度改成自适应：固定 260px 时窄屏右侧会留一条空白，宽屏又挤不下更多列。
     minmax(230px, 1fr) 让卡片跟着容器伸缩，配合卡片内部的截断规则，文字不会再溢出边框。 */
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-auto-rows: minmax(118px, auto);
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.pos-held-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 360px 1fr;
  background: #fff;
}

.pos-held-left {
  min-width: 0;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fbfcfe;
}

.pos-held-left .pos-modal-search {
  height: 48px;
  margin: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f3f5f8;
  font-size: 15px;
}

.pos-held-detail {
  min-width: 0;
  overflow: auto;
  padding: 18px 22px;
  background: #fff;
}

.pos-held-empty {
  height: 100%;
  min-height: 360px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  border: 1px dashed #d4dde8;
  background: #fbfdff;
}

.pos-product-item,
.pos-member-item,
.pos-held-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

/* 选品卡片：固定的四行结构（名称 / 条码 / 编号·品牌·型号 / 库存+价格）。
   关键是 min-width: 0 —— grid 子项默认 min-width:auto，长商品名会把轨道撑宽，
   文字就从边框里挤出去了。所有会变长的行都单独限宽并截断。 */
.pos-product-item {
  min-height: 118px;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 4px;
  border: 1px solid #e4eaf1;
  border-radius: 8px;
  padding: 12px;
}

.pos-product-item > span {
  min-width: 0;
}

/* 商品名最多两行，超出打省略号；完整名称挂在 title 上，鼠标悬停可看。 */
.pos-product-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #1f2937;
  word-break: break-all;
}

.pos-product-barcode,
.pos-product-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.4;
  color: #7a8491;
}

.pos-product-barcode {
  color: #4a5568;
  font-variant-numeric: tabular-nums;
}

.pos-product-barcode i {
  color: #b0b8c4;
  font-style: normal;
}

.pos-product-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.pos-product-stock {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #7a8491;
}

.pos-product-foot .pos-product-price {
  flex: none;
  font-size: 15px;
  white-space: nowrap;
}

/* 缺货商品：列出来让收银员能确认系统里有这个商品，但点不动。
   禁用样式必须一眼可见，否则店员会以为是点击没生效而反复戳。 */
.pos-product-item.is-out-of-stock {
  background: #f5f7fa;
  border-color: #e8ecf1;
  color: #9aa4b1;
  cursor: not-allowed;
}

.pos-product-item.is-out-of-stock .pos-product-price {
  color: #9aa4b1;
}

.pos-product-item.is-seat-service {
  border-color: #fdba74;
  background: #fffaf3;
}

.pos-product-item.is-seat-service::before { background: #f97316; opacity: 1; }

.pos-product-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 10px;
  background: #fdecec;
  color: #d14343;
  font-size: 12px;
  font-weight: 500;
  vertical-align: middle;
}

.pos-product-badge.seat-service {
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fed7aa;
}

/* 换货时的「退回商品」区，压在购物车上方，和换出商品明确分开。 */
.pos-exchange-box {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #f0c9a0;
  border-radius: 8px;
  background: #fff8ef;
}

.pos-exchange-box.hidden {
  display: none;
}

.pos-exchange-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.pos-exchange-head button {
  padding: 4px 12px;
  border: 1px solid #d9a066;
  border-radius: 6px;
  background: #fff;
  color: #a35d10;
  cursor: pointer;
}

.pos-exchange-line {
  display: grid;
  grid-template-columns: 1fr 74px 110px 32px;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px dashed #ecd4b6;
  font-size: 13px;
}

.pos-exchange-line small {
  display: block;
  color: #8a7a68;
}

.pos-exchange-line input {
  width: 100%;
  padding: 3px 6px;
  border: 1px solid #ddd;
  border-radius: 5px;
  text-align: center;
}

.pos-exchange-line strong {
  text-align: right;
}

.pos-exchange-line button {
  border: none;
  background: transparent;
  color: #c0392b;
  font-size: 16px;
  cursor: pointer;
}

.pos-exchange-empty {
  padding: 10px 0;
  color: #9a8a78;
  font-size: 13px;
}

.pos-exchange-foot {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #ecd4b6;
  font-size: 13px;
}

.pos-exchange-foot strong {
  color: #a35d10;
}

.pos-product-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px 10px;
  color: #5a6473;
  font-size: 14px;
  cursor: pointer;
}

.pos-module-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.pos-client-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}

.pos-client-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pos-client-toolbar input,
.pos-client-toolbar select,
.pos-form-grid input,
.pos-form-grid select,
.pos-form-grid textarea {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
}

.pos-client-toolbar input {
  min-width: 260px;
  flex: 1;
}

.pos-client-toolbar button,
.pos-module-primary,
.pos-module-secondary {
  height: 42px;
  border-radius: 6px;
  padding: 0 18px;
  font-weight: 800;
}

.pos-client-toolbar button,
.pos-module-primary {
  border: 0;
  color: #fff;
  background: var(--blue);
}

.pos-module-secondary {
  border: 1px solid var(--line);
  color: #1f4f91;
  background: #fff;
}

.pos-client-cards {
  display: grid;
  gap: 10px;
}

.pos-client-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.pos-client-card strong {
  display: block;
  font-size: 17px;
  margin-bottom: 6px;
}

.pos-client-card small,
.pos-client-muted {
  color: var(--muted);
}

.pos-client-card em {
  display: inline-block;
  margin-top: 8px;
  color: #64748b;
  font-style: normal;
}

.pos-client-card-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.pos-client-amount {
  color: var(--danger);
  font-weight: 900;
  font-size: 18px;
  white-space: nowrap;
}

.pos-client-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.pos-client-table th,
.pos-client-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

.pos-client-table th {
  background: #eef4fb;
  color: #334155;
}

.pos-order-detail-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.pos-order-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.pos-order-detail-field,
.pos-order-payments,
.pos-order-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.pos-order-detail-field span,
.pos-order-payments span,
.pos-order-note span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.pos-order-detail-field strong {
  font-size: 16px;
}

.pos-order-payments,
.pos-order-note {
  margin-top: 12px;
}

.pos-order-payment-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  line-height: 28px;
}

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

.pos-form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: #334155;
}

.pos-form-grid label.wide {
  grid-column: 1 / -1;
}

.pos-form-grid textarea {
  min-height: 88px;
  padding-top: 10px;
  resize: vertical;
}

.pos-module-empty {
  padding: 42px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  background: #f8fafc;
}

/* 扫到未知条码时的「绑定商品」列表。和选品弹窗分开做：这里一行一个商品，
   要看清现有条码，不需要图片和库存，所以是紧凑的单列清单。 */
.pos-bind-list {
  margin-top: 10px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pos-bind-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.pos-bind-item:last-child {
  border-bottom: none;
}

.pos-bind-item:hover {
  background: #f3f7ff;
}

.pos-bind-item > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pos-bind-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: #1f2937;
}

.pos-bind-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #7a8491;
}

.pos-bind-price {
  flex: none;
  color: var(--danger);
  font-weight: 900;
  white-space: nowrap;
}

/* 交接班对账清单：一行一项，右侧金额右对齐，方便和手点的现金逐条核。 */
.pos-shift-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.pos-shift-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  font-size: 14px;
  border-bottom: 1px solid #eef2f7;
}

.pos-shift-row:last-child {
  border-bottom: none;
}

.pos-shift-row span {
  color: #475569;
}

.pos-shift-row strong {
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.pos-module-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.pos-return-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.pos-return-order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 6px;
  text-align: left;
}

.pos-return-order-card:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.pos-return-order-card strong {
  color: var(--text);
}

.pos-return-order-card span {
  color: var(--danger);
  font-weight: 900;
}

.pos-return-order-card small,
.pos-return-order-card em {
  color: var(--muted);
  font-style: normal;
}

.pos-held-item.active {
  background: #dfeafe;
  box-shadow: inset 4px 0 0 #3b73ff;
}

.pos-held-main {
  min-width: 0;
}

.pos-held-main strong {
  display: block;
  margin-bottom: 4px;
}

.pos-held-main em {
  display: block;
  margin-top: 6px;
  color: #334155;
  font-style: normal;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-held-main em.muted {
  color: #a0a7b2;
}

.pos-held-side {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.pos-held-side b {
  padding: 2px 7px;
  border: 1px solid #2f75ff;
  border-radius: 4px;
  color: #2f75ff;
  font-size: 13px;
}

.pos-product-item:hover,
.pos-member-item:hover,
.pos-held-item:hover {
  background: #f3f7ff;
}

.pos-product-price,
.pos-member-balance,
.pos-held-amount {
  color: var(--danger);
  font-weight: 900;
}

.pos-held-info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 4px 0 18px;
}

.pos-held-info h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.pos-held-info h3 span {
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid #ef4444;
  color: #ef4444;
  border-radius: 4px;
  font-size: 13px;
  vertical-align: middle;
}

.pos-held-info p {
  margin: 5px 0;
  color: #334155;
}

.pos-held-total {
  align-self: start;
  color: var(--danger);
  font-size: 22px;
}

.pos-seat-payment-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.pos-seat-payment {
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  background: #eff6ff;
  padding: 12px 14px;
}

.pos-seat-payment > div:first-child,
.pos-seat-payment-amounts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pos-seat-payment > div:first-child span,
.pos-seat-payment p {
  color: #475569;
  font-size: 13px;
}

.pos-seat-payment-amounts {
  margin-top: 8px;
}

.pos-seat-payment-amounts b {
  color: #b91c1c;
  font-size: 17px;
}

.pos-seat-payment p {
  margin: 7px 0 0;
}

.pos-seat-payment p.warn {
  color: #b45309;
  font-weight: 700;
}

.pos-held-delete-guard {
  display: grid;
  gap: 4px;
  margin: -8px 0 18px;
  padding: 11px 14px;
  border: 1px solid #fdba74;
  border-left: 4px solid #ea580c;
  border-radius: 6px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.55;
}

.pos-held-delete-guard strong {
  font-size: 14px;
}
.pos-order-seat-summary{margin-top:16px}
.pos-order-seat-summary .pos-seat-payment-list{margin-top:8px}

.pos-held-section-title {
  margin: 0 0 10px;
  font-size: 18px;
}

.pos-held-section-title small {
  color: #64748b;
  font-weight: 500;
}

.pos-held-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.pos-held-table th {
  background: #f1f3f6;
  color: #334155;
  font-weight: 700;
}

.pos-held-table th,
.pos-held-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.pos-held-table th:nth-child(n+2),
.pos-held-table td:nth-child(n+2) {
  text-align: right;
  white-space: nowrap;
}

.pos-held-table small {
  display: block;
  margin-top: 4px;
  color: #64748b;
}

.pos-held-actions {
  height: 72px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.pos-held-actions button {
  min-width: 130px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  font-size: 16px;
  font-weight: 800;
}

.pos-held-actions button.primary {
  border: 0;
  color: #fff;
  background: #2663f6;
}

.pos-held-actions button:disabled {
  opacity: .45;
}

.pos-secondary-wide {
  margin: 14px;
}

.pos-pay-panel {
  width: min(1000px, calc(100vw - 40px));
  height: min(690px, calc(100vh - 40px));
  position: relative;
  display: grid;
  grid-template-columns: 320px 1fr;
  overflow: hidden;
}

/* 面板整体 overflow:hidden，所以右栏必须自己能滚，否则内容超出就彻底够不着。 */
.pos-pay-panel > .pos-pay-right {
  min-height: 0;
}

.pos-pay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  color: #1f2937;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.pos-pay-close:hover {
  background: rgba(37, 99, 235, 0.14);
  color: var(--blue);
}

.pos-pay-left {
  background: rgba(0, 0, 0, 0.55);
}

/* 业务员 / 支付方式 / 数字键盘 / 结算底栏。中间三块可滚，底栏常驻，
   这样窗口再窄也不会出现「找不到确定键」。 */
.pos-pay-right {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  background: #f2f4f7;
}

.pos-pay-right > .pos-salesman-row,
.pos-pay-right > .pos-seat-customer-section,
.pos-pay-right > .pos-payment-section,
.pos-pay-right > .pos-keypad {
  flex: 0 0 auto;
}

.pos-pay-foot {
  position: sticky;
  bottom: -10px;
  z-index: 4;
  margin-top: auto;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  padding: 10px 0;
  background: #f2f4f7;
  box-shadow: 0 -10px 18px rgba(242, 244, 247, 0.95);
}

.pos-pay-foot button {
  border: 0;
  border-radius: 6px;
  min-height: 66px;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.pos-pay-note {
  background: #fff;
}

#posConfirmPayAmount {
  font-size: 22px;
  opacity: 0.92;
}

.pos-salesman-row,
.pos-seat-customer-section,
.pos-payment-section {
  background: #fff;
  border-radius: 6px;
  padding: 10px 18px;
}

.pos-seat-customer-section small{color:#64748b;font-weight:700}
.pos-seat-customer-row{display:grid;grid-template-columns:minmax(130px,1fr) 1.15fr 1.15fr;gap:10px;align-items:center;padding:9px 0;border-top:1px solid #e5e7eb}
.pos-seat-customer-row:first-child{margin-top:8px}
.pos-seat-customer-row>div{display:flex;align-items:center;gap:6px}
.pos-seat-customer-row>div>span{color:#64748b;font-size:13px;margin-right:2px}
.pos-seat-customer-row button{border:1px solid #d7dde5;background:#f8fafc;border-radius:5px;padding:7px 12px;cursor:pointer;font-weight:700}
.pos-seat-customer-row button.active{border-color:#3b73ff;background:#edf3ff;color:#174ca9}

.pos-salesman-row {
  display: grid;
  grid-template-columns: 110px 260px;
  align-items: center;
  font-size: 20px;
  font-weight: 800;
}

.pos-salesman-row select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
}

.pos-payment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-payment-methods {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 0;
}

.pos-payment-method {
  min-width: 150px;
  height: 68px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f5f6f8;
  font-size: 18px;
  display: grid;
  place-items: center;
  gap: 2px;
}

.pos-payment-method small {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.pos-payment-method.active {
  background: #edf3ff;
  border-color: #3b73ff;
  color: #174ca9;
}

/* 组合支付下「已经用上、但当前不在输入」的方式。
   主高亮（.active）只有一个——正在键盘上输金额的那一行；已经加到支付行里的其他方式
   用这个次级样式亮起来，否则收银员点了团购支付再点现金，会以为团购支付被取消了。
   mark 2026-10-12：「点击多个支付方式只有一个显示选中」。
   角标用 ✓ 而不是只靠颜色，色盲或单色屏也看得出。 */
.pos-payment-method.is-used {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
  position: relative;
}

.pos-payment-method.is-used::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: #16a34a;
}

.pos-pay-line {
  border: 1px solid #cfd5de;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 16px;
  font-size: 22px;
  background: #fff;
  flex-wrap: wrap;
}

.pos-pay-line.active {
  border-color: #3b73ff;
  box-shadow: inset 3px 0 0 #3b73ff;
}

.pos-pay-line button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #ef4444;
  font-size: 16px;
}

.pos-payment-lines {
  display: grid;
  gap: 8px;
}

.pos-pay-voucher {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 -4px 10px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 800;
}
.pos-pay-voucher b{color:#dc2626;font-size:11px}
.pos-voucher-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.pos-voucher-grid label{display:grid;grid-template-columns:58px minmax(0,1fr);align-items:center;gap:6px;font-weight:600}
.pos-voucher-grid small{color:#9a3412;font-size:11px;white-space:nowrap}
.pos-pay-voucher input{
  width: 100%;
  min-height: 38px;
  border: 1px solid #fdba74;
  border-radius: 5px;
  padding: 7px 9px;
  color: #172033;
  background: #fff;
  font: 600 14px/1.4 inherit;
  box-sizing: border-box;
}
.pos-pay-voucher input:focus{outline:2px solid #fb923c;outline-offset:1px}
@media(max-width:720px){.pos-pay-voucher{grid-template-columns:1fr}.pos-voucher-grid{grid-template-columns:1fr}}
.pos-order-payment-line strong small{display:block;margin-top:3px;color:#9a3412;font-size:11px;font-weight:700}

.pos-pay-remain {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  color: #64748b;
  font-weight: 800;
}

.pos-pay-remain strong {
  color: #e11d2e;
}

.pos-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.pos-keypad button {
  border: 0;
  border-radius: 6px;
  background: #fff;
  min-height: 66px;
  font-size: 26px;
  font-weight: 900;
}

.pos-confirm-pay {
  background: #2362f2 !important;
  color: #fff;
}

.pos-confirm-pay:disabled {
  background: #9db4e6 !important;
  cursor: not-allowed;
}

.pos-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(20, 29, 42, 0.92);
  color: #fff;
  padding: 12px 18px;
  border-radius: 6px;
  z-index: 80;
  /* 报错信息以前是一整条 Cloudflare 错误页（几千字符的 HTML），toast 又是单行不换行，
     于是它被拉成横贯整屏的一条，把界面糊住（mark 2026-10-12 的图1）。
     现在限宽 + 换行 + 最多露 4 行，长文本不会再涂屏；真正的长文由控制台看。 */
  max-width: min(560px, calc(100vw - 48px));
  max-height: 40vh;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: left;
  line-height: 1.45;
  font-size: 14px;
}

.pos-line-editor {
  width: min(520px, calc(100vw - 40px));
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
}

.pos-line-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px;
}

.pos-line-edit-grid label {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  border: 1px solid var(--line);
  min-height: 48px;
  padding: 0 10px;
}

.pos-line-edit-grid label.wide {
  grid-column: 1 / -1;
}

.pos-line-edit-grid span {
  font-weight: 800;
  color: #3f4b5a;
}

.pos-line-edit-grid input {
  border: 0;
  min-width: 0;
  height: 42px;
  text-align: right;
}

.pos-gift-toggle input {
  justify-self: end;
  width: 24px;
  height: 24px;
}

.pos-line-warning {
  color: #ef4444;
  padding: 0 18px;
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
}

.pos-modal-foot {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.pos-modal-foot button {
  min-width: 108px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  font-weight: 800;
}

.pos-modal-foot button.primary {
  border: 0;
  color: #fff;
  background: #3b73ff;
}

@media (max-width: 900px) {
  .pos-shell {
    height: auto;
    min-height: 100vh;
  }

  .pos-topbar,
  .pos-layout,
  .pos-terminal-bar,
  .pos-pay-panel,
  .pos-held-layout {
    grid-template-columns: 1fr;
  }

  /* 单列后左边那块空的深色区还占一行，会把右栏挤出可视范围，直接收掉。 */
  .pos-pay-left {
    display: none;
  }

  .pos-seat-customer-row {
    grid-template-columns: 1fr;
  }

  .pos-pay-panel {
    grid-template-rows: 1fr;
  }

  /* 窄屏把「50/100/200」这类快捷金额收进第 4 列即可，键盘不再横向溢出。 */
  .pos-keypad button {
    min-height: 56px;
    font-size: 22px;
  }

  .pos-pay-foot {
    grid-template-columns: 110px 1fr;
  }

  .pos-pay-foot button {
    min-height: 58px;
    font-size: 22px;
  }

  .pos-menu-overlay {
    inset: 0;
  }

  .pos-menu-drawer {
    width: 100%;
    max-width: none;
    height: 100vh;
  }

  .pos-menu-grid {
    grid-template-columns: repeat(3, minmax(88px, 1fr));
  }

  .pos-held-modal-card {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .pos-held-left {
    max-height: 280px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pos-layout {
    display: block;
  }

  .pos-left,
  .pos-right {
    display: block;
  }
}

/* Shared searchable member selection: editable forms and cashier terminal. */
.member-search-choices { max-height: 180px; overflow-y: auto; border: 1px solid #dde3eb; border-radius: 8px; margin-top: 6px; }
.member-search-choice { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:8px 10px; border:0; border-bottom:1px solid #edf0f4; background:#fff; text-align:left; cursor:pointer; color:#283548; }
.member-search-choice small { display:block; color:#778397; font-size:12px; }
.member-search-choice.selected { background:#eaf3ff; box-shadow:inset 3px 0 #4285e8; }
.member-search-choice strong { white-space:nowrap; font-size:13px; }
.member-tag-choices { display:flex; flex-wrap:wrap; gap:6px; padding-top:6px; }
.member-tag-choices label { display:flex !important; flex-direction:row !important; align-items:center; gap:5px; padding:5px 9px; border:1px solid #dce4ef; border-radius:6px; font-size:13px; }
.member-tag-choices input { width:16px !important; height:16px !important; margin:0; }
.pos-member-actions { grid-area:actions; display:flex; align-items:center; gap:6px; }
.pos-member-edit { border:0; padding:5px; background:transparent; color:#376b9e; cursor:pointer; white-space:nowrap; }
.pos-member-cancel { flex:0 0 auto; width:30px; height:30px; border:1px solid #e2e7ee; border-radius:50%; background:#fff; color:#8b95a3; font-size:17px; line-height:1; cursor:pointer; display:grid; place-items:center; }
.pos-member-cancel:hover { border-color:#f0b4ba; background:#fff5f6; color:#d93848; }
.pos-member-item-main { display:grid; gap:3px; min-width:0; }
.pos-member-item-top { display:flex; align-items:center; gap:8px; min-width:0; }
.pos-member-item-tags { display:flex; flex-wrap:wrap; gap:4px; }

@media (max-width: 900px) {
  .pos-left { overflow: visible; }
  .pos-member-strip { padding: 10px; }
}
@media (max-width: 430px) {
  .pos-member-info.selected { grid-template-columns: 34px minmax(0,1fr) auto; gap: 6px; padding: 9px; }
  .pos-member-avatar { width: 34px; height: 34px; }
  .pos-member-stats { padding-left: 0; }
  .pos-member-actions { gap: 2px; }
}

/* Selection browser: a scrollable category tree and independently scrollable product cards. */
.pos-product-browser { display:grid; grid-template-columns:190px minmax(0,1fr); min-height:0; overflow:hidden; }
.pos-product-categories { overflow-y:auto; min-height:0; padding:8px; border-right:1px solid var(--line); background:#f8fafc; }
.pos-category-option { display:block; width:100%; padding:8px 6px 8px calc(9px + var(--depth, 0) * 12px); text-align:left; border:0; border-radius:6px; background:transparent; color:#475569; cursor:pointer; overflow-wrap:anywhere; }
.pos-category-option:hover, .pos-category-option.active { background:#e7f0ff; color:#1455a0; font-weight:700; }
.pos-product-browser .pos-product-list { min-height:0; overflow-y:auto; grid-auto-rows:max-content; }
/* Explicit rows prevent the barcode label from painting on top of a two-line name. */
.pos-product-item { grid-template-rows:minmax(40px,auto) auto auto 1fr; }
.pos-product-name { min-height:40px; }
@media(max-width:680px) {
 .pos-product-browser { grid-template-columns:110px minmax(0,1fr); }
 .pos-product-categories { padding:4px; }
 .pos-product-browser .pos-product-list { grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); }
}

/* Member-card action: use one explicit, quiet button style instead of UA borders. */
.pos-member-strip .pos-member-cancel {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: #64748b;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}
.pos-member-strip .pos-member-cancel:hover { background: #eef2f7; color: #334155; }
.pos-member-strip .pos-member-cancel:focus-visible { outline: 2px solid #4382dc; outline-offset: 2px; }

/* 收银会员选择：搜索、资料和余额分层展示，避免姓名/电话/标签挤在一行。 */
.pos-member-modal-card {
  height: min(720px, calc(100dvh - 40px));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.pos-member-search-area { padding: 14px 18px 10px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.pos-member-search-area .pos-modal-search {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid #d6e0ed; border-radius: 8px;
  outline: none; background: #fff; font-size: 15px;
}
.pos-member-search-area .pos-modal-search:focus { border-color: #3e80e8; box-shadow: 0 0 0 3px #3e80e81c; }
.pos-member-search-status { display: block; min-height: 20px; padding-top: 7px; color: #718096; font-size: 12px; }
.pos-member-modal-card .pos-member-list { min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
/* 刷新中：旧内容先变淡并暂时不可点，等新数据回来再换，避免点中正在被替换的行。 */
.pos-member-list.is-loading { opacity: 0.45; pointer-events: none; transition: opacity 0.12s ease; }
.pos-member-modal-card .pos-member-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 12px; padding: 12px 20px;
  cursor: pointer;
}
.pos-member-modal-card .pos-member-item:focus-visible { outline: 2px solid #3e80e8; outline-offset: -2px; }
.pos-member-modal-card .pos-member-item-main { gap: 5px; }
.pos-member-modal-card .pos-member-item-top strong { font-size: 15px; color: #263548; overflow-wrap: anywhere; }
.pos-member-item-phone { color: #64748b; font-size: 13px; }
.pos-member-modal-card .pos-member-item-tags { gap: 5px; }
.pos-member-item-asset { display: grid; gap: 3px; justify-items: end; white-space: nowrap; }
.pos-member-item-asset small { color: #8491a2; font-size: 11px; }
.pos-member-item-asset strong { color: #d72c43; font-size: 16px; font-variant-numeric: tabular-nums; }
.pos-member-empty { padding: 52px 18px; text-align: center; color: #7c8a9c; }
.pos-member-modal-foot { border-top: 1px solid var(--line); padding: 12px 18px; background: #fff; }
.pos-member-modal-foot .pos-secondary-wide { width: 100%; margin: 0; cursor: pointer; }
@media (max-width: 600px) {
  .pos-member-modal-card { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: none; }
  .pos-member-modal-card .pos-member-item { padding: 11px 13px; }
  .pos-member-search-area { padding: 10px 12px 8px; }
  .pos-member-item-asset strong { font-size: 14px; }
}

/* 2026-09-30 收银选品：一级分类默认收起，多选后统一加入。 */
.pos-product-modal-card {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.pos-product-categories {
  padding: 10px 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #f3f6fa 100%);
}

.pos-category-all,
.pos-category-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  margin-bottom: 3px;
  border-radius: 7px;
}

.pos-category-all {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dfe6ef;
  border-radius: 0;
}

.pos-category-branch[data-depth="0"] + .pos-category-branch[data-depth="0"] {
  margin-top: 2px;
}

.pos-category-children {
  position: relative;
  margin-left: 12px;
  padding-left: 8px;
  border-left: 1px solid #d8e1ec;
}

.pos-category-children.hidden {
  display: none;
}

.pos-category-toggle {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #718096;
  display: grid;
  place-items: center;
  font-size: 13px;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}

.pos-category-toggle:hover {
  background: #e5edf8;
  color: #1657a6;
}

.pos-category-toggle.expanded {
  transform: rotate(90deg);
}

.pos-category-toggle.placeholder {
  pointer-events: none;
  opacity: .25;
}

.pos-category-option {
  min-width: 0;
  padding: 7px 8px;
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-category-branch[data-depth="0"] > .pos-category-row > .pos-category-option {
  color: #263b55;
  font-weight: 750;
}

.pos-category-branch[data-depth="1"] > .pos-category-row > .pos-category-option {
  color: #4c6179;
  font-size: 13px;
  font-weight: 650;
}

.pos-category-branch[data-depth="2"] > .pos-category-row > .pos-category-option,
.pos-category-branch[data-depth="3"] > .pos-category-row > .pos-category-option {
  color: #718096;
  font-size: 12.5px;
  font-weight: 500;
}

.pos-category-option.active {
  background: linear-gradient(90deg, #dfeeff 0%, #edf5ff 100%);
  color: #0e5db5 !important;
  box-shadow: inset 3px 0 0 #2376d8;
}

.pos-product-item {
  position: relative;
  padding-left: 42px;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.pos-product-item::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 14px;
  width: 18px;
  height: 18px;
  border: 1.5px solid #b7c3d1;
  border-radius: 5px;
  background: #fff;
}

.pos-product-item.selected {
  border-color: #4c8fe8;
  background: #f5f9ff;
  box-shadow: 0 0 0 2px rgba(37, 118, 216, .1);
}

.pos-product-item.selected::before {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: #2476d8;
  background: #2476d8;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.pos-product-item.is-out-of-stock::before {
  background: #eef1f5;
  border-color: #d8dee7;
}

.pos-product-selection-bar {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid #dce4ee;
  background: #fff;
  box-shadow: 0 -8px 24px rgba(35, 58, 88, .06);
}

.pos-product-selection-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.pos-selection-count {
  white-space: nowrap;
  color: #526174;
  font-size: 13px;
}

.pos-selection-count b {
  color: #1768e8;
  font-size: 20px;
  margin-right: 3px;
}

.pos-product-selection-list {
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.pos-selection-empty {
  color: #98a3b1;
  font-size: 13px;
  white-space: nowrap;
}

.pos-selection-chip {
  flex: none;
  max-width: 210px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 7px 0 10px;
  border: 1px solid #d8e6f7;
  border-radius: 999px;
  background: #f4f8fd;
  color: #334a66;
  font-size: 12px;
}

.pos-selection-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-selection-chip button {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #dce8f6;
  color: #52677f;
  line-height: 1;
}

.pos-selection-clear,
.pos-selection-confirm {
  height: 40px;
  padding: 0 18px;
  border-radius: 7px;
  font-weight: 800;
}

.pos-selection-clear {
  border: 1px solid #d8e0ea;
  background: #fff;
  color: #556273;
}

.pos-selection-confirm {
  min-width: 112px;
  border: 0;
  background: #1768e8;
  color: #fff;
}

.pos-selection-clear:disabled,
.pos-selection-confirm:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.pos-cart-table tbody tr[data-edit-row] {
  cursor: default;
}

.pos-cart-table tbody tr[data-edit-row]:hover {
  background: #f7faff;
}

.pos-edit-btn {
  width: auto;
  min-width: 42px;
  padding: 0 7px;
}

@media (max-width: 680px) {
  .pos-product-selection-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .pos-product-selection-summary { grid-column: 1 / -1; }
  .pos-selection-clear { justify-self: end; }
}

/* 订单查询：状态与业务类型分开筛选，卡片用颜色建立稳定的视觉语义。 */
.pos-order-query-panel {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff 0%, #f7faff 100%);
  box-shadow: 0 5px 18px rgba(39, 65, 98, .05);
}

.pos-order-search-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1f6;
}

.pos-order-search-row input {
  height: 42px;
  padding: 0 13px;
  border: 1px solid #ccd7e5;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  outline: none;
}

.pos-order-search-row input:focus {
  border-color: #5692e8;
  box-shadow: 0 0 0 3px rgba(52, 120, 220, .11);
}

.pos-order-search-row button {
  min-width: 104px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #2574dc, #165fc8);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(31, 103, 204, .18);
}

.pos-order-filter-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 11px;
}

.pos-order-filter-label {
  color: #66758a;
  font-size: 13px;
  font-weight: 800;
}

.pos-order-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pos-order-filter-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid #dce3ec;
  border-radius: 999px;
  background: #fff;
  color: #526174;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s ease;
}

.pos-order-filter-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.pos-order-filter-chip small {
  color: #8a96a7;
  font-size: 11px;
  font-weight: 500;
}

.pos-order-filter-chip:hover {
  border-color: #9dbce4;
  background: #f6f9fe;
}

.pos-order-filter-chip.active {
  border-color: #4b82d1;
  background: #eaf3ff;
  color: #175fae;
  box-shadow: inset 0 0 0 1px rgba(55, 119, 207, .08);
}

.pos-order-filter-chip.status-completed i { background: #18a66a; }
.pos-order-filter-chip.status-draft i { background: #e99a19; }
.pos-order-filter-chip.status-cancelled i { background: #dc2626; }
.pos-order-filter-chip.type-sale i { background: #2778dc; }
.pos-order-filter-chip.type-return i { background: #e35b55; }
.pos-order-filter-chip.type-exchange i { background: #8a62d7; }

.pos-order-query-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin: 0 2px 10px;
  color: #607086;
  font-size: 13px;
}

.pos-order-query-summary strong {
  color: #1d2c40;
  font-size: 18px;
}

.pos-order-query-summary span {
  margin-left: 7px;
  color: #8a96a7;
}

.pos-order-query-pager {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.pos-order-query-pager span { margin: 0; font-size: 12px; }
.pos-order-query-pager button {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #d6deea;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}
.pos-order-query-pager button:disabled { opacity: .4; cursor: default; }

.pos-order-card-list {
  display: grid;
  gap: 10px;
}

.pos-order-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 15px 16px 15px 18px;
  overflow: hidden;
  border: 1px solid #dfe6ef;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(35, 54, 78, .045);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.pos-order-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #347bd4;
}

.pos-order-card.type-return::before { background: #e35b55; }
.pos-order-card.type-exchange::before { background: #8a62d7; }

.pos-order-card:hover {
  border-color: #bfd1e7;
  box-shadow: 0 8px 24px rgba(36, 61, 93, .08);
  transform: translateY(-1px);
}

.pos-order-card-main { min-width: 0; }

.pos-order-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pos-order-card-title > strong {
  color: #172437;
  font-size: 16px;
  letter-spacing: .15px;
}

.pos-order-card-badges,
.pos-order-detail-badges {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pos-order-badge {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.pos-order-badge.type-sale { border-color: #c8dcf7; background: #edf5ff; color: #2468bd; }
.pos-order-badge.type-return { border-color: #f3cbc8; background: #fff0ef; color: #c94740; }
.pos-order-badge.type-exchange { border-color: #dacdf3; background: #f5f0ff; color: #7449c2; }
.pos-order-badge.status-completed { border-color: #bee7d3; background: #ecfbf4; color: #168256; }
.pos-order-badge.status-draft { border-color: #f0d6a4; background: #fff7e7; color: #b46d08; }
.pos-order-badge.status-cancelled { border-color: #fecaca; background: #fff1f2; color: #b91c1c; }
.pos-order-badge.type-other,
.pos-order-badge.status-other { border-color: #d8dee8; background: #f3f5f8; color: #637083; }

.pos-order-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 10px;
  color: #8590a0;
  font-size: 12px;
}

.pos-order-card-meta b {
  margin-left: 3px;
  color: #526174;
  font-weight: 700;
}

.pos-order-card-note {
  max-width: 760px;
  margin-top: 9px;
  overflow: hidden;
  color: #526174;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-order-card-note.is-empty { color: #a0a9b5; }

.pos-order-card-side {
  min-width: 255px;
  display: grid;
  justify-items: end;
  align-content: start;
}

.pos-order-card-side > small {
  color: #8a96a7;
  font-size: 11px;
}

.pos-order-card-amount {
  margin: 2px 0 10px;
  color: #d84c45;
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.pos-order-card-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.pos-order-action {
  height: 32px;
  padding: 0 11px;
  border: 1px solid #d6deea;
  border-radius: 7px;
  background: #fff;
  color: #4b5e75;
  font-size: 12px;
  font-weight: 800;
}

.pos-order-action:hover { background: #f5f8fc; }
.pos-order-action.primary { border-color: #2671d4; background: #2671d4; color: #fff; }
.pos-order-action.return { border-color: #efc0bc; background: #fff5f4; color: #c9453e; }
.pos-order-action.exchange { border-color: #d4c5ee; background: #f8f4ff; color: #7146bb; }

@media (max-width: 820px) {
  .pos-order-card { grid-template-columns: 1fr; gap: 12px; }
  .pos-order-card-side { min-width: 0; justify-items: start; }
  .pos-order-card-actions { justify-content: flex-start; }
}

@media (max-width: 580px) {
  .pos-order-search-row { grid-template-columns: 1fr; }
  .pos-order-filter-row { grid-template-columns: 1fr; gap: 6px; }
  .pos-order-filter-chip { padding: 0 10px; }
  .pos-order-filter-chip small { display: none; }
}


/* 2026-10-03 正式试用反馈：折扣结果与实体键盘输入反馈。 */
.pos-pay-panel:focus { outline: none; }
.pos-pay-panel:focus-visible { box-shadow: 0 0 0 3px rgba(59, 115, 255, .24), 0 30px 80px rgba(0, 0, 0, .24); }
.pos-cart-price small,
.pos-discount-rate {
  display: block;
  margin-top: 3px;
  color: #ea580c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.pos-price-original { color: #64748b; text-decoration: line-through; }
.pos-discount-value { color: #ea580c; white-space: nowrap; }
.pos-line-discount-hint {
  margin: -4px 18px 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 13px;
  font-weight: 800;
}
.pos-line-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 18px 12px;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
}
.pos-line-preview span { display: grid; gap: 5px; color: #64748b; font-size: 12px; }
.pos-line-preview strong { color: #172033; font-size: 16px; }
.pos-line-preview .total { padding-left: 10px; border-left: 1px solid #dbe4f0; }
.pos-line-preview .total strong { color: #dc2626; font-size: 19px; }
@media (max-width: 560px) {
  .pos-line-preview { grid-template-columns: 1fr; }
  .pos-line-preview .total { padding: 8px 0 0; border-left: 0; border-top: 1px solid #dbe4f0; }
}

.pos-keyboard-hint {
  margin: -4px 2px 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

/* 2026-10-03 收款金额编辑反馈：不使用蓝底或文字提示，仅保留当前行边框与输入光标。 */
.pos-pay-line-method {
  flex: 0 1 auto;
  font-weight: 800;
}
.pos-pay-amount-wrap {
  display: grid;
  justify-items: end;
  align-content: center;
  min-width: 132px;
  margin-left: auto;
}
.pos-pay-amount {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 96px;
  min-height: 32px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #172033;
  background: transparent;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pos-pay-amount.is-selected,
.pos-pay-amount.is-editing {
  color: #174ca9;
  background: #fff;
  border-color: #60a5fa;
  box-shadow: inset 0 -2px 0 #2563eb;
}
.pos-pay-caret {
  flex: 0 0 auto;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  border-radius: 2px;
  background: #2563eb;
  animation: pos-pay-caret-blink 1s steps(1, end) infinite;
}
@keyframes pos-pay-caret-blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}
.pos-pay-line > button[data-remove-pay] {
  flex: 0 0 auto;
  margin-left: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .pos-pay-caret { animation: none; }
}
@media (max-width: 620px) {
  .pos-pay-amount-wrap { min-width: 120px; }
}


/* 2026-10-03 收银触控与大商品库性能优化。 */
button,
[role="button"],
select,
input[type="checkbox"],
input[type="radio"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.pos-product-load-more {
  grid-column: 1 / -1;
  min-height: 48px;
  border: 1px dashed #93b6df;
  border-radius: 8px;
  background: #f4f8fd;
  color: #245e99;
  font-weight: 800;
  cursor: pointer;
}
.pos-product-load-more:hover { background: #eaf3fe; }
.pos-product-empty,
.pos-product-limit-hint {
  grid-column: 1 / -1;
  padding: 32px 16px;
  color: #7a8491;
  font-size: 13px;
  text-align: center;
}

/* 2026-10-04 POS 订单查询：左侧订单、右侧详情；窄屏自动上下排列。 */
.pos-module-card:has(.pos-order-workspace) {
  width: min(1480px, calc(100vw - 28px));
  height: min(880px, calc(100vh - 28px));
}

.pos-module-body:has(.pos-order-workspace) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-module-body:has(.pos-order-workspace) .pos-order-query-panel {
  flex: 0 0 auto;
  margin-bottom: 12px;
}

.pos-order-workspace {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(35, 54, 78, .06);
}

.pos-order-list-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
}

.pos-order-list-pane .pos-order-query-summary {
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.pos-order-compact-list {
  min-height: 0;
  overflow: auto;
  padding: 6px;
}

.pos-order-list-item {
  position: relative;
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 12px 13px 12px 16px;
  overflow: hidden;
  border: 1px solid transparent;
  border-bottom-color: #e5eaf1;
  border-radius: 8px;
  background: transparent;
  color: #253247;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.pos-order-list-item::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #347bd4;
  opacity: 0;
}

.pos-order-list-item.type-return::before { background: #e35b55; }
.pos-order-list-item.type-exchange::before { background: #8a62d7; }
.pos-order-list-item:hover { background: #f1f6fd; }
.pos-order-list-item.active {
  border-color: #b7d0f1;
  background: #eaf3ff;
  box-shadow: 0 3px 10px rgba(46, 102, 177, .09);
}
.pos-order-list-item.active::before { opacity: 1; }

.pos-order-list-top,
.pos-order-list-middle,
.pos-order-list-bottom {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.pos-order-list-top { justify-content: space-between; }
.pos-order-list-top strong {
  min-width: 0;
  overflow: hidden;
  color: #162337;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pos-order-list-top b {
  flex: 0 0 auto;
  color: #d6453e;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.pos-order-list-middle em {
  margin-left: auto;
  color: #748197;
  font-size: 11px;
  font-style: normal;
}
.pos-order-list-bottom {
  justify-content: space-between;
  color: #657389;
  font-size: 12px;
}
.pos-order-list-bottom time { color: #8a96a7; font-size: 11px; }
.pos-order-list-note {
  overflow: hidden;
  color: #526174;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pos-order-list-note.muted { color: #9aa4b2; }
.pos-order-seat-tag {
  display: inline-flex;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 4px;
  color: #166534;
  background: #dcfce7;
  font-size: 11px;
  font-weight: 700;
}

.pos-order-inline-detail {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #f7f9fc;
}

.pos-order-detail-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: #8b97a8;
  font-size: 14px;
}

.pos-order-detail-sheet { padding: 16px; }
.pos-order-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.pos-order-detail-kicker {
  display: block;
  margin-bottom: 4px;
  color: #718096;
  font-size: 12px;
  font-weight: 700;
}
.pos-order-detail-heading h3 {
  margin: 0;
  color: #172437;
  font-size: 19px;
  line-height: 1.3;
}
.pos-order-detail-field small {
  display: block;
  margin-top: 5px;
  color: #8290a3;
  font-size: 12px;
}
.pos-order-detail-field.amount strong { color: #1d4f91; }
.pos-order-detail-field.discount strong { color: #d97706; }
.pos-order-detail-field.total {
  border-color: #bcd3f4;
  background: #eef5ff;
}
.pos-order-detail-field.total strong { color: #d6453e; font-size: 20px; }

.pos-order-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 8px;
}
.pos-order-items-head strong { color: #26354a; font-size: 15px; }
.pos-order-items-head span { margin-left: 8px; color: #8793a4; font-size: 12px; }
.pos-order-table-wrap {
  overflow: auto;
  border: 1px solid #dce4ef;
  border-radius: 9px;
  background: #fff;
}
.pos-order-detail-table { min-width: 800px; }
.pos-order-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.pos-order-detail-table td { vertical-align: middle; white-space: nowrap; }
.pos-order-discount-cell strong { display: block; color: #b45309; }
.pos-order-discount-cell small { display: block; margin-top: 2px; color: #b45309; }
.pos-order-member-discount-cell strong { display: block; color: #1d4ed8; }
.pos-order-member-discount-cell small { display: block; margin-top: 2px; color: #1d4ed8; }
.pos-order-product-cell { min-width: 230px; white-space: normal !important; }
.pos-order-product-cell strong { display: block; color: #26354a; }
.pos-order-product-cell small { display: block; margin-top: 4px; color: #8490a1; }
.pos-current-price { color: #1768c4; }
.pos-order-detail-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.pos-order-detail-actions {
  position: sticky;
  bottom: -16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 14px -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid #dce4ef;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -6px 18px rgba(36, 61, 93, .06);
}

@media (max-width: 980px) {
  .pos-module-body:has(.pos-order-workspace) { overflow: auto; }
  .pos-order-workspace {
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .pos-order-list-pane {
    max-height: 360px;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }
  .pos-order-inline-detail { overflow: visible; }
}

@media (max-width: 640px) {
  .pos-module-card:has(.pos-order-workspace) {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
  }
  .pos-module-body:has(.pos-order-workspace) { padding: 8px; }
  .pos-order-detail-sheet { padding: 12px; }
  .pos-order-detail-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pos-order-detail-lower { grid-template-columns: 1fr; }
  .pos-order-detail-heading { display: grid; }
  .pos-order-list-bottom { align-items: flex-start; }
  .pos-order-list-bottom time { text-align: right; }
}
.pos-shared-reuse {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}
.pos-shared-reuse.active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
  font-weight: 700;
}
