/* 饰品店收银系统样式。颜色、圆角等都定义成变量，改主题只需要改 :root。 */

:root {
  /* 配色参考小红书：浅灰底、白卡片、正红点缀、圆润的胶囊按钮。
     强调色比小红书的品牌红略深一点，保证白字在红底上看得清。 */
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --surface-muted: #F5F5F5;
  --border: #EEEEEE;
  --border-light: #F3F3F3;
  --ink: #222222;
  --muted: #666666;
  --placeholder: #BBBBBB;
  --accent: #E0123A;
  --accent-dark: #B80F30;
  --accent-tint: #FFF0F2;
  --accent-light: #FFC4CE;
  --danger: #C2410C;
  --danger-tint: #FFF1E6;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --font: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
}

/* ---------- 基础 ---------- */

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
h1, h2, h3 { margin: 0; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.danger { color: var(--danger); }
.right { text-align: right; }
.grow { flex: 1 1 auto; min-width: 0; }
.ink { color: var(--ink); }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 按钮 ---------- */

.btn {
  height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-weight: 500;
}
.btn:hover:not(:disabled) { border-color: var(--placeholder); }
.btn--primary { border-color: var(--accent); background: var(--accent); color: #FFFFFF; font-weight: 600; }
.btn--primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn--danger { border-color: var(--danger); color: var(--danger); font-weight: 600; }
.btn--danger:hover:not(:disabled) { background: var(--danger-tint); border-color: var(--danger); }
.btn--large { height: 60px; font-size: 18px; border-radius: 999px; }
.btn--text { height: 44px; padding: 0 8px; border: 0; background: transparent; color: var(--accent); }
.btn--text.muted { color: var(--muted); }
.btn--text.danger { color: var(--danger); }
.btn--selected { border: 1.5px solid var(--accent); background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; }

.chip {
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 14px;
}
.chip--active { border-color: var(--accent-tint); background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; }

.segmented { display: flex; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.segmented button { height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-size: 14px; }
.segmented button.is-active { background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; }
.segmented--small { padding: 2px; }
.segmented--small button { height: 36px; padding: 0 12px; font-size: 13px; }

/* ---------- 顶部导航 ---------- */

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px;
  padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar__brand { font-size: 18px; font-weight: 800; letter-spacing: .02em; color: var(--accent); }
.topbar__nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.topbar__nav a { padding: 10px 18px; border-radius: 999px; color: var(--muted); font-weight: 500; text-decoration: none; }
.topbar__nav a:hover { color: var(--ink); }
.topbar__nav a.is-active { background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; }
.topbar__user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.avatar {
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent); font-weight: 600;
}
.avatar--large { width: 52px; height: 52px; font-size: 20px; }

/* ---------- 页面骨架 ---------- */

.page { padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.page__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.columns { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.columns__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.columns__side { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-lg); padding: 24px; }
.card--flush { padding: 0; overflow-x: auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- 输入框 ---------- */

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.field__label { color: var(--muted); }
.field__hint { font-size: 12px; color: var(--muted); }
.input {
  height: 48px; width: 100%; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); outline: 0;
}
.input:focus { border-color: var(--accent); }
.input[readonly] { background: var(--surface-muted); color: var(--muted); cursor: not-allowed; }

/* 下拉选择（js/ui.js 的 createDropdown） */
.dropdown { position: relative; }
.dropdown__button {
  display: block; width: 100%; min-width: 132px; padding-right: 40px; text-align: left; white-space: nowrap; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B635B' stroke-width='2' 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 14px center;
}
.dropdown__button[aria-expanded='true'] { border-color: var(--accent); }
.dropdown__menu {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; min-width: 100%; max-height: 280px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .1);
}
.dropdown__option {
  flex: 0 0 auto; height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-sm);
  background: transparent; text-align: left; white-space: nowrap;
}
.dropdown__option:hover, .dropdown__option:focus-visible { background: var(--surface-muted); outline: 0; }
.dropdown__option.is-selected { background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; }
.dropdown__button.is-placeholder { color: var(--muted); }

/* 月历（js/ui.js 的 createMonthDayPicker） */
.date-panel { position: fixed; z-index: 100; width: 316px; min-width: 0; padding: 12px; gap: 8px; max-height: none; overflow: visible; }
.date-panel__header { display: flex; align-items: center; justify-content: space-between; }
.date-panel__header strong { font-size: 16px; }
.date-panel__nav { width: 44px; height: 44px; border: 0; border-radius: 999px; background: transparent; font-size: 22px; color: var(--ink); }
.date-panel__nav:hover { background: var(--surface-muted); }
.date-panel__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.date-panel__day { height: 40px; border: 0; border-radius: 999px; background: transparent; font-size: 14px; font-variant-numeric: tabular-nums; }
.date-panel__day:hover, .date-panel__day:focus-visible { background: var(--surface-muted); outline: 0; }
.date-panel__day.is-today { color: var(--accent); font-weight: 700; }
.date-panel__day.is-selected { background: var(--accent); color: #FFFFFF; font-weight: 600; }
.date-panel__day:disabled { color: var(--placeholder); background: transparent; cursor: default; }
.date-panel__nav:disabled { color: var(--placeholder); background: transparent; cursor: default; }
.date-panel__weekday { height: 28px; line-height: 28px; text-align: center; font-size: 12px; color: var(--muted); }
.date-panel__footer { display: flex; justify-content: flex-end; }
.field--check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; }
.field--check input { width: 20px; height: 20px; accent-color: var(--accent); }

.search {
  display: flex; align-items: center; gap: 10px; flex: 1 1 280px; max-width: 420px;
  height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; background: var(--surface);
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; }
.search--scan { max-width: none; height: 56px; border: 1.5px solid var(--accent); font-size: 16px; }

.input-group { display: flex; gap: 10px; }
.input-group .input { flex: 1 1 auto; min-width: 0; }
.input-group .btn { flex: 0 0 auto; }
.image-picker { display: flex; align-items: center; gap: 14px; }
.image-picker__preview {
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden;
  width: 84px; height: 84px; border-radius: var(--radius);
  border: 1px dashed var(--placeholder); background: var(--surface-muted); color: var(--muted); font-size: 12px;
}
.image-picker__preview img { width: 100%; height: 100%; object-fit: cover; }

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

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 16px 12px; text-align: left; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border-light); }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table th.right { text-align: right; }
.table tr.is-selected { background: var(--accent-tint); }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-muted td { color: var(--muted); }
.table tr.is-clickable:hover td { background: var(--surface-muted); }
/* 可以点开看订单的单号（库存流水里） */
.order-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-variant-numeric: tabular-nums; }
.order-items-cell { max-width: 320px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge--accent { background: var(--accent); color: #FFFFFF; }
.badge--danger { background: var(--danger-tint); color: var(--danger); }

.thumb {
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--surface-muted); color: var(--placeholder); font-size: 17px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb--lg { flex-basis: 56px; width: 56px; height: 56px; border-radius: 12px; font-size: 20px; }
/* 可以点击放大的缩略图（js/ui.js 的 productThumb） */
.zoomable { padding: 0; border: 0; cursor: zoom-in; }
.zoomable:hover img { opacity: .88; }

/* 图片放大查看（js/ui.js 的 openImageViewer） */
dialog.image-viewer {
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 24px; box-sizing: border-box;
  border-radius: 0; background: transparent; cursor: zoom-out;
}
dialog.image-viewer[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
dialog.image-viewer::backdrop { background: rgba(0, 0, 0, .86); }
.image-viewer__image { max-width: min(100%, 1280px); max-height: calc(100vh - 120px); border-radius: 12px; object-fit: contain; background: #FFFFFF; }
.image-viewer__caption { color: #FFFFFF; font-size: 16px; font-weight: 600; }
.image-viewer__close {
  position: fixed; top: 20px; right: 20px; width: 48px; height: 48px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #FFFFFF; font-size: 20px;
}

/* ---------- 收银台 ---------- */

.pos { padding: 24px 28px 28px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.pos__catalog { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
/* 订单栏：宽度随屏幕变化，高度撑满窗口（减去顶部导航和上下边距） */
.pos__order {
  flex: 0 1 clamp(400px, 30vw, 560px); min-width: 0; position: sticky; top: 16px;
  height: calc(100vh - 124px); min-height: 520px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 18px;
  padding: 24px; background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-lg);
}
.cart-lines { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.cart-lines--empty { display: flex; align-items: center; justify-content: center; }
/* 窄屏时订单栏排到商品下面，不再撑满高度 */
@media (max-width: 960px) {
  .pos__order { flex: 1 1 100%; position: static; height: auto; min-height: 0; }
  .cart-lines { overflow: visible; }
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.product-tile {
  display: flex; flex-direction: column; gap: 8px; padding: 0 0 14px; overflow: hidden; text-align: left;
  background: var(--surface); border: 0; border-radius: var(--radius);
}
.product-tile:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .06); }
.product-tile:active { background: var(--accent-tint); }
.product-tile__image {
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--surface-muted); color: var(--placeholder); font-size: 34px; font-weight: 500;
}
.product-tile__image img { width: 100%; height: 100%; object-fit: cover; }
.product-tile__name { padding: 2px 12px 0; font-size: 14px; font-weight: 500; line-height: 1.3; }
.product-tile__meta { display: flex; align-items: baseline; justify-content: space-between; padding: 0 12px; }
.product-tile__price { font-size: 16px; font-weight: 700; color: var(--accent); }
.product-tile__stock { font-size: 12px; color: var(--muted); }

.member-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-tint); color: var(--accent-dark); }
.member-strip__name { font-size: 15px; font-weight: 600; }
.member-strip__meta { margin-top: 4px; font-size: 13px; }
.member-strip--empty { background: var(--surface-muted); color: var(--muted); }

/* 订单行：外层裁掉超出部分，里面的 .cart-line 盖在"删除"按钮上，往左拖时露出按钮（见 js/swipe.js） */
.cart-line-swipe { position: relative; overflow: hidden; border-bottom: 1px solid var(--border-light); }
.cart-line {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; padding: 14px 0;
  background: var(--surface); transition: transform .22s ease; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.cart-line.is-dragging { transition: none; }
.cart-line__delete {
  position: absolute; top: 10px; right: 0; bottom: 10px; border: 0; border-radius: 12px;
  background: var(--accent); color: #FFFFFF; font-size: 15px; font-weight: 600;
}
.cart-line__image {
  display: flex; align-items: center; justify-content: center; flex: 0 0 64px; height: 64px; overflow: hidden;
  border-radius: 12px; background: var(--surface-muted); color: var(--placeholder); font-size: 22px; font-weight: 500;
}
.cart-line__image img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__info { flex: 1 1 auto; min-width: 0; }
.cart-line__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 16px; font-weight: 600; }
.cart-line__side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-line__price { margin-top: 3px; padding: 0; border: 0; background: transparent; font-size: 13px; color: var(--muted); text-decoration: underline dotted; }
.cart-line__total { font-size: 16px; font-weight: 700; }
.stepper--compact button { width: 40px; height: 40px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 18px; }
.stepper span { min-width: 22px; text-align: center; font-weight: 600; }

.totals { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.totals__row { display: flex; justify-content: space-between; color: var(--muted); }
.totals__row--accent { color: var(--accent); }
.totals__due { display: flex; align-items: baseline; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); }
.totals__due strong { font-size: 34px; font-weight: 700; letter-spacing: -.01em; }

/* ---------- 弹窗 ---------- */

dialog { padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
.dialog { width: 460px; max-width: 100%; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.dialog--wide { width: 920px; padding: 32px 36px; }
.dialog__header { display: flex; align-items: center; justify-content: space-between; }
.dialog__header h1 { font-size: 20px; }
.dialog__close { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--bg); font-size: 18px; }
.dialog__error { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--danger-tint); color: var(--danger); font-size: 14px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .field--full { grid-column: 1 / -1; }
.dialog--form-wide { width: 760px; }

/* 会员规则说明（js/pages/member-rules.js） */
.rules { display: flex; flex-direction: column; gap: 22px; max-height: min(64vh, 620px); overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.rules__section { display: flex; flex-direction: column; gap: 10px; }
.rules__section h2 { font-size: 15px; }
.rules__list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.6; color: var(--ink); }
.rules__list li::marker { color: var(--accent); }
.rules__table { border-radius: var(--radius); background: var(--surface-muted); overflow: hidden; }
.rules__table th, .rules__table td { padding: 12px 16px; }
.rules__table th:first-child, .rules__table td:first-child { padding-left: 16px; }
.rules__table th:last-child, .rules__table td:last-child { padding-right: 16px; }
.rules__table tr:last-child td { border-bottom: 0; }
/* 手机上表单一行只放一个字段 */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 结算 ---------- */

.checkout { display: flex; flex-wrap: wrap; gap: 36px; }
.checkout__summary { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.checkout__pad { flex: 1 1 300px; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
.checkout__due { font-size: 52px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.checkout__lines { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
/* 组合支付的一行：标签 + 收款方式 + 金额 */
.split-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--bg); }
.split-pay__label { flex: 0 0 auto; font-size: 13px; color: var(--muted); }
.split-pay .segmented { background: transparent; border: 0; padding: 0; }
.split-pay .segmented button { height: 40px; padding: 0 14px; background: var(--surface); margin-right: 6px; }
.split-pay .segmented button.is-active { background: var(--accent-tint); }
.split-pay__amount { margin-left: auto; font-size: 20px; font-weight: 700; }
.split-pay__amount.muted { font-size: 14px; font-weight: 400; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.amount-box { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--radius); background: var(--bg); }
.amount-box span { font-size: 13px; color: var(--muted); }
.amount-box strong { font-size: 26px; font-weight: 700; }
.stock-warning { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--danger-tint); color: var(--danger); font-size: 14px; }
.keypad button { height: 64px; border: 0; border-radius: var(--radius); background: var(--bg); font-size: 24px; font-weight: 500; }
.keypad button:active { background: var(--accent-tint); }
.pay-method { height: 56px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); font-size: 16px; font-weight: 500; }
.pay-method.btn--selected { border: 1.5px solid var(--accent); background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; }
.switch { display: flex; width: 44px; height: 26px; padding: 3px; border: 0; border-radius: 999px; background: #DDDDDD; }
.switch::after { content: ''; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; transition: transform .15s; }
.switch[aria-checked='true'] { background: var(--accent); }
.switch[aria-checked='true']::after { transform: translateX(18px); }

/* ---------- 勾选框 ---------- */

.checkbox { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.table th.table__check, .table td.table__check { width: 44px; padding-right: 0; }

/* ---------- 打印条码弹窗 ---------- */

.label-printer { display: flex; flex-wrap: wrap; gap: 28px; }
.label-printer__main { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.label-lines { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.label-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.label-line:last-child { border-bottom: 0; }
.stepper__input { width: 52px; height: 44px; padding: 0; border: 0; text-align: center; font-weight: 600; background: transparent; }
.label-preview { flex: 1 1 240px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; border-radius: var(--radius); background: var(--surface-muted); }
.label-preview__paper { padding: 6px; background: #FFFFFF; border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }

/* ---------- 订单详情 ---------- */

.order-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface-muted); }
.order-meta > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.order-meta span { font-size: 13px; color: var(--muted); }
.order-meta strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.order-lines { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; }
.order-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.refund-history { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--danger-tint); font-size: 14px; }
.refund-history__row { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.5; }

/* ---------- 报表 ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 22px; background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-lg); }
.kpi span { font-size: 14px; color: var(--muted); }
.kpi strong { font-size: 32px; font-weight: 700; letter-spacing: -.01em; }
.kpi small { font-size: 15px; font-weight: 400; color: var(--muted); }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; align-items: end; height: 220px; }
.bars__item { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; font-size: 13px; color: var(--muted); }
.bars__bar { width: 100%; max-width: 64px; min-height: 2px; border-radius: 8px 8px 2px 2px; background: var(--accent-light); }
.bars__item.is-today { color: var(--ink); font-weight: 600; }
.bars__item.is-today .bars__bar { background: var(--accent); }
.meter { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.meter__label { flex: 0 0 56px; }
.meter__track { flex: 1 1 auto; height: 10px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 999px; background: var(--accent); }
.meter__value { flex: 0 0 96px; text-align: right; font-weight: 600; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.list-row:last-child { border-bottom: 0; }
/* 一行提醒（比如"有商品没填进价"） */
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--danger-tint); color: var(--danger); font-size: 14px; }
.notice a { font-weight: 600; text-decoration: none; }
.notice--plain { background: var(--surface); color: var(--muted); }

/* ---------- 盘点、交班 ---------- */

/* 盘点页底部的汇总条，滚动时一直贴在窗口底部 */
.count-bar {
  position: sticky; bottom: 16px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 6px 24px rgba(0, 0, 0, .1); font-size: 15px;
}
.cash-diff { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); font-size: 14px; }
.cash-diff--ok { background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; font-size: 16px; }
.cash-diff--off { background: var(--danger-tint); color: var(--danger); font-weight: 700; font-size: 18px; }
.stock-link { height: auto; min-height: 44px; min-width: 44px; padding: 0 6px; color: var(--ink); font-weight: 500; text-decoration: underline dotted var(--placeholder); text-underline-offset: 4px; }

/* ---------- 登录和初始化 ---------- */

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth__card { width: 400px; max-width: 100%; display: flex; flex-direction: column; gap: 18px; padding: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }

/* ---------- 提示条 ---------- */

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 1000;
  padding: 14px 22px; border-radius: var(--radius); background: var(--ink); color: #FFFFFF;
  font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.toast--error { background: var(--danger); }
