:root {
  --bg: #e9dfd0;
  --paper: #fffbf6;
  --ink: #1c1612;
  --muted: #6a5e54;
  --line: #eadfce;
  --brand: #b42318;
  --brand-ink: #fff;
  --ok: #1f7a4d;
  --warn: #9a5b12;
  --err: #b42318;
  --fill: #efe6d8;
  --radius: 12px;
  --tabbar-h: 56px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html {
  margin: 0;
  background: #e9dfd0;
}
body {
  margin: 0;
  color: var(--ink);
  background-color: #e9dfd0;
  background-image:
    radial-gradient(120% 70% at 0% -10%, rgba(255, 247, 234, .95) 0%, transparent 58%),
    radial-gradient(90% 50% at 100% 0%, rgba(214, 168, 122, .22) 0%, transparent 52%),
    radial-gradient(80% 45% at 50% 110%, rgba(176, 122, 82, .14) 0%, transparent 55%);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .34 0 0 0 0 .24 0 0 0 .7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.hide { display: none !important; }
.side {
  width: 220px;
  background: var(--paper);
  color: var(--ink);
  padding: 28px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.brand strong { font-size: 15px; letter-spacing: -.02em; }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.logo.big { width: 56px; height: 56px; margin: 0 auto 12px; font-size: 22px; }
.side nav { display: grid; gap: 4px; }
.side nav a, .logout button {
  color: var(--ink); padding: 10px 12px; border-radius: 10px;
  background: transparent; border: 0; text-align: left; cursor: pointer; width: 100%;
  font-size: 15px;
}
.side nav a.on { background: var(--fill); color: var(--brand); font-weight: 650; }
.side nav a:hover { background: var(--fill); }
.logout { margin-top: auto; }
.logout button { color: var(--muted); }
.main { flex: 1; padding: 28px 32px 48px; max-width: 920px; width: 100%; }
.tabbar { display: none; }
.page-head, .hero, .panel-head, .row {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.row.tight { gap: 8px; justify-content: flex-start; }
.row form { margin: 0; }
h1 { font-size: 32px; margin: 0 0 4px; letter-spacing: -.04em; font-weight: 650; }
h2 { font-size: 17px; margin: 0 0 10px; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 17px; }
h3 a { color: inherit; }
.muted, .help { color: var(--muted); }
.help { font-size: 13px; line-height: 1.5; margin: 6px 0 0; }
.opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 12px; padding: 10px 14px; cursor: pointer; white-space: nowrap;
  min-height: 40px;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink); }
.btn.lg { padding: 14px 18px; font-size: 16px; width: 100%; min-height: 48px; font-weight: 650; }
.btn.danger { color: var(--err); border-color: var(--line); background: #fff; }
.btn.sm { padding: 6px 11px; font-size: 13px; min-height: 32px; }
.hero, .panel, .card, .form, .auth-card, .status-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.hero, .panel, .form { padding: 18px; margin: 16px 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 16px; }
.stats.mini { grid-template-columns: repeat(3, 1fr); }
.stats article {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.stats span { color: var(--muted); font-size: 13px; }
.stats strong { display: block; font-size: 26px; margin-top: 4px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats .warn { background: #fff6ee; }
.loss-hero {
  margin: 8px 0 14px;
  padding: 22px 20px 20px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(80, 48, 24, .06);
}
.loss-hero span { color: var(--muted); font-size: 13px; font-weight: 650; }
.loss-hero strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 34px;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}
.loss-hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.stats.loss-stats { grid-template-columns: repeat(3, 1fr); }
.stats.loss-stats em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.loss-range {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 4px 0 14px;
}
.loss-range label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.loss-range input[type="date"] { min-width: 140px; }
.loss-day { margin-top: 14px; }
.loss-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}
.loss-day-head h2 { margin: 0; font-size: 17px; }
.loss-day-head strong {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.loss-list { list-style: none; padding: 0; margin: 0; }
.loss-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.loss-list li:last-child { border-bottom: 0; }
.loss-name { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: baseline; }
.loss-src { font-size: 12px; font-weight: 700; flex-shrink: 0; }
.loss-src.writeoff { color: var(--err); }
.loss-src.count { color: var(--warn); }
.loss-yen { text-align: right; flex-shrink: 0; }
.loss-yen strong { font-variant-numeric: tabular-nums; }
.loss-yen em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.alert-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: #fdecec; color: var(--err); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px;
}
.alert-row p { margin: 0; flex: 1; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.grow { flex: 1; min-width: 0; }
.grow p, .card-body p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.qr-mini { width: 52px; height: 52px; border-radius: 8px; background: #fff; flex-shrink: 0; }
.tag {
  font-size: 13px; padding: 0; border-radius: 0; background: transparent;
  white-space: nowrap; font-weight: 650; flex-shrink: 0;
}
.flow { display: grid; gap: 12px; }
.flow-ticket { background: var(--fill); border-radius: 12px; padding: 10px 12px; }
.flow-head { display: flex; gap: 12px; align-items: center; }
.flow-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.flow-items { list-style: none; padding: 0; margin: 8px 0 0; }
.flow-items li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.flow-items p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.flow-dates { color: var(--muted); }
a.flow-dates { text-decoration: underline; text-underline-offset: 2px; }
.snap-shot { margin: 16px 0; }
.snap-shot img { width: 100%; border-radius: 12px; display: block; }
.snap-shot figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
.flow-items span { white-space: nowrap; font-size: 14px; font-variant-numeric: tabular-nums; }
.tag.synced { color: var(--ok); }
.tag.pending { color: var(--warn); }
.tag.failed, .tag.expired { color: var(--err); }
.tag.soon { color: var(--warn); }
.tag.watch { color: var(--warn); }
.tag.ok { color: var(--muted); font-weight: 500; }
.tag.unknown { color: var(--muted); font-weight: 500; }
.tag.near { color: var(--warn); }
.tag.approaching { color: var(--warn); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { overflow: hidden; position: relative; }
.card-check {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  margin: 0; background: rgba(255,255,255,.92); border-radius: 8px; padding: 4px 6px;
}
.thumb-link { display: block; }
.thumb { height: 150px; width: 100%; object-fit: cover; background: var(--fill); }
.thumb.placeholder { display: grid; place-items: center; color: var(--muted); height: 150px; }
.card-body { padding: 14px; }
.card-body .row { margin-top: 12px; }
.filters { display: flex; gap: 8px; margin: 12px 0 18px; flex-wrap: wrap; }
.filters input, .filters select { flex: 1; min-width: 140px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 12px; background: #fff; color: var(--ink);
}
label { display: block; margin: 14px 0 6px; font-weight: 650; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px 16px; margin: 0 0 18px; }
legend { padding: 0 6px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview { width: 180px; border-radius: 12px; margin: 8px 0; border: 1px solid var(--line); }
.preview.lg { width: min(100%, 320px); }
.preview.zoom, img.zoom { cursor: zoom-in; }
.check { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.check.tight { margin: 0; }
.check input { width: auto; }
.banner {
  display: block; background: #fff6ee; color: var(--warn);
  padding: 10px 14px; border-radius: 12px; margin-bottom: 12px;
}
.toast { padding: 10px 14px; border-radius: 12px; margin: 0 0 12px; }
.toast.ok { background: #e3f6ea; color: var(--ok); }
.toast.warn { background: #fff6ee; color: var(--warn); }
.toast.err { background: #fdecec; color: var(--err); }
a.toast-jump {
  display: block;
  text-decoration: none;
  font-weight: 650;
}
a.toast-jump strong {
  display: inline-block;
  margin-left: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.empty, .tips { background: var(--paper); border-radius: var(--radius); padding: 28px 20px; }
.empty.compact { padding: 16px; margin-top: 8px; background: transparent; }
.split { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.qr-box { text-align: center; }
.qr-box img { width: 220px; margin: 0 auto 12px; }
.err-text { color: var(--err); font-size: 13px; word-break: break-all; }
.table-wrap { overflow: auto; background: var(--paper); border-radius: var(--radius); padding: 8px 14px 16px; border: 1px solid var(--line); }
.sticky { position: sticky; top: 0; background: var(--bg); padding: 12px 0; z-index: 2; }
.mt { margin-top: 12px; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card { width: min(420px, 100%); padding: 28px; text-align: left; }
.auth-card h1 { text-align: center; font-size: 26px; }
.auth-card .muted { text-align: center; }
.auth-card .btn.lg { margin-top: 18px; }
.print-body { background: #fff; }
.print-bar { display: flex; gap: 12px; align-items: center; padding: 16px; }
.labels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px; }
.label {
  border: 1px solid #222; border-radius: 8px; padding: 10px;
  display: flex; gap: 10px; align-items: center; break-inside: avoid;
}
.label img { width: 96px; height: 96px; }
.label h2 { font-size: 16px; margin: 0; }
.label p { margin: 2px 0; font-size: 12px; }
.label .shop { font-weight: 700; }
.label .tiny { color: #666; font-size: 10px; }
.public-body { background: #fff; }
.public { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.public h1 { font-size: 26px; }
.public h2 { margin: 24px 0 8px; }
.public img { border-radius: 12px; }
.public .shop { color: var(--brand); font-weight: 700; }
.public .tiny { color: var(--muted); margin-top: 24px; }
.public-icp { margin: 28px 0 0; text-align: center; font-size: 12px; line-height: 1.6; }
.public-icp a { color: var(--muted); text-decoration: none; }
.public-icp a:hover { text-decoration: underline; }
.public .meta { padding: 0; list-style: none; color: var(--muted); }
.ticket .help { color: var(--muted); line-height: 1.5; }
.ticket-form { margin: 16px 0 20px; }
.ticket-form label { display: block; font-weight: 650; margin-bottom: 8px; }
.ticket-form input { width: 100%; }
.ticket-form .btn.lg { width: 100%; margin-top: 14px; }
.ticket-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}
.ticket-card h2 { margin: 0 0 12px; font-size: 18px; }
.ticket-card .dates { margin-bottom: 0; }
.ticket-card figure { margin: 12px 0 0; }
.ticket-card figcaption { color: var(--muted); font-size: 12px; margin-top: 6px; }
.form.simple { margin-top: 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; -webkit-overflow-scrolling: touch; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 12px; padding: 8px 12px; cursor: pointer;
}
.match-box {
  background: var(--paper);
  border-radius: 12px;
  padding: 4px 0 8px;
  margin: 0 0 16px;
}
.match-box p { margin: 0 0 10px; font-weight: 650; }
.match-card {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  border-radius: 0;
  padding: 10px 0;
  margin: 0;
  cursor: pointer;
}
.match-card:last-child { border-bottom: 0; }
.match-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--fill);
}
.match-card strong { display: block; font-size: 17px; }
.match-card small { color: var(--muted); }
.match-skip {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px;
  cursor: pointer;
}
a.match-card { color: inherit; }
#match-list { max-height: 55vh; overflow: auto; }
.fold {
  background: var(--fill);
  border-radius: 12px;
  padding: 2px 12px 10px;
  margin: 12px 0 16px;
}
.fold summary {
  cursor: pointer;
  font-weight: 650;
  padding: 12px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
  content: "展开";
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  flex-shrink: 0;
}
.fold[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.fold[open] summary::after { content: "收起"; }
.split-leg {
  background: var(--paper);
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 12px;
}
.split-leg > strong { display: block; margin: 0 0 8px; }
.split-leg .price-edit { margin: 0 0 8px; }
.split-hits { max-height: 40vh; overflow: auto; margin: 0 0 8px; }
.split-picked { margin: 8px 0; }
.split-picked .split-clear { margin-left: auto; flex-shrink: 0; }
.split-skus { display: grid; gap: 8px; margin: 8px 0 0; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.shot {
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--fill);
  cursor: pointer;
  padding: 12px;
  margin: 0;
  font-weight: 650;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: rgba(180, 35, 24, .12);
  touch-action: manipulation;
}
.shot.tall { min-height: 200px; margin: 8px 0 16px; }
.shot.has { border-style: solid; }
.shot input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
}
.shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}
.shot-title, .shot-sub {
  position: relative;
  z-index: 1;
  pointer-events: none;
}
.shot-title { font-weight: 650; }
.shot-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.shot.has .shot-title, .shot.has .shot-sub { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.stepper { display: flex; align-items: center; gap: 8px; max-width: 220px; }
.stepper input { text-align: center; }
.stepper .btn { width: 42px; padding: 8px 0; border-radius: 12px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input {
  font-size: 16px;
  -webkit-user-select: text;
  user-select: text;
}
.copy-row .btn {
  min-height: 44px;
  min-width: 72px;
  flex-shrink: 0;
}
.reprint { margin-top: 16px; text-align: left; }
.batch-cards { display: grid; gap: 10px; }
.batch-card {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.batch-card .actions { margin-left: auto; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 18px 0; color: var(--muted); }
.status-card { padding: 16px 18px; margin-bottom: 16px; }
.status-card p { margin: 6px 0 0; color: var(--muted); }
.status-card.ok { background: #e3f6ea; border-color: #c8e6d3; }
.status-card.warn { background: #fff6ee; border-color: #f0d9b8; }
.busy {
  position: fixed; inset: 0; background: rgba(20,20,20,.45);
  display: grid; place-items: center; z-index: 80;
}
.busy-card {
  background: #fff; color: var(--ink); border-radius: 12px; padding: 24px 28px; text-align: center;
}
.busy-card p { margin: 12px 0 4px; font-weight: 650; }
.busy-card small { color: var(--muted); }
.spinner {
  width: 28px; height: 28px; margin: 0 auto;
  border: 3px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.82);
  display: grid; place-items: center; z-index: 90; padding: 16px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 8px; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px;
}
.toolbar h1 { margin: 0; }
.toolbar .muted { margin: 4px 0 0; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar-actions form { margin: 0; }
.pick-list { display: grid; gap: 8px; margin: 0 0 16px; }
.pick {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); cursor: pointer;
  margin: 0; font-weight: 400;
}
.pick input {
  width: auto; height: 20px; margin: 2px 0 0; padding: 0;
  border: 0; border-radius: 0; flex-shrink: 0; accent-color: var(--brand);
}
.pick div { display: grid; gap: 4px; min-width: 0; flex: 1; }
.pick strong { font-size: 15px; }
.pick span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.pick.on { border-color: var(--brand); background: #fff5f4; }
.crumb { margin: 0 0 8px; font-size: 14px; }
.crumb a { color: var(--muted); }
.lead { color: var(--muted); margin: 0 0 16px; line-height: 1.45; font-size: 15px; }
.search-bar { margin: 0 0 8px; position: relative; }
.search-bar input {
  font-size: 16px; background: var(--paper); border: 0;
  padding: 13px 14px;
}
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% - 2px);
  z-index: 25; background: #fff; border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 260px; overflow: auto;
}
.suggest a {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px; color: inherit; border-bottom: 1px solid var(--line);
}
.suggest a:last-child { border-bottom: 0; }
.suggest img, .suggest .ph {
  width: 44px; height: 44px; border-radius: 10px; object-fit: cover;
  background: var(--fill); flex-shrink: 0;
}
.suggest .ph { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.suggest strong { font-size: 16px; }
.suggest .suggest-meta { min-width: 0; flex: 1; }
.suggest .suggest-meta small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.pills {
  display: flex; gap: 18px; overflow-x: auto; padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch; border-bottom: 1px solid var(--line); margin-bottom: 12px;
}
.pills.cats { padding-top: 0; border-bottom: 0; margin-bottom: 8px; }
.cat-pick { display: flex; gap: 8px; align-items: stretch; }
.cat-pick select { flex: 1; min-width: 0; font-size: 16px; }
.cat-pick .btn { flex: 0 0 auto; }
.cat-new { display: flex; gap: 8px; margin-top: 8px; }
.cat-new input { flex: 1; font-size: 16px; }
.cat-new .btn { flex: 0 0 auto; }
.life-pick { display: flex; gap: 8px; align-items: stretch; }
.life-pick input { flex: 1; min-width: 0; font-size: 16px; }
.life-pills { padding: 8px 0 0; }
.seg {
  display: flex; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff;
}
.seg button {
  border: 0; background: transparent; color: var(--ink);
  padding: 11px 14px; cursor: pointer; white-space: nowrap;
}
.seg button.on { background: var(--ink); color: #fff; }
.pill {
  flex: 0 0 auto; padding: 8px 0 10px; border-radius: 0;
  background: transparent; color: var(--muted); border: 0; font-size: 15px;
  box-shadow: inset 0 -2px 0 transparent;
}
.pill.on {
  background: transparent; color: var(--ink); font-weight: 650;
  box-shadow: inset 0 -2px 0 var(--brand); color: var(--ink);
}
.goods {
  display: grid; gap: 0;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
  padding: 2px 14px;
}
.good {
  display: flex; align-items: flex-start; gap: 12px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; padding: 12px 0; min-height: 0;
}
.good:last-child { border-bottom: 0; }
.good-main { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; color: inherit; }
.cover-swap-pic { cursor: pointer; }
.cover-swap-pic .good-img { pointer-events: none; }
.cover-swap-form .btn.disabled[disabled] { opacity: .4; pointer-events: none; }
.good-pic {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 10px;
}
.good-img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--fill); flex-shrink: 0; }
.good-pic .good-img { display: block; border-radius: 0; }
.good-img.ph { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.good.hot .good-pic::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  height: 48%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(28, 22, 18, .45), transparent);
}
.hot-mark {
  position: absolute;
  right: 5px;
  bottom: 4px;
  top: auto;
  left: auto;
  z-index: 1;
  margin: 0;
  padding: 0;
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1;
  color: rgba(255, 251, 246, .9);
  background: none;
  border-radius: 0;
  text-shadow: 0 1px 2px rgba(28, 22, 18, .45);
  pointer-events: none;
}
.hot-mark.lg {
  position: static;
  display: inline-block;
  padding: 0;
  font-size: 12px;
  letter-spacing: .18em;
  color: #a6865a;
  background: none;
  text-shadow: none;
}
.good-body { display: grid; gap: 4px; min-width: 0; flex: 1; padding-top: 2px; }
.good-body strong { font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.02em; line-height: 1.3; }
.good-body span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.good-body span:last-child { white-space: nowrap; }
.good-price {
  display: block;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
  letter-spacing: 0;
}
.good-price .yen {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-right: 1px;
}
.good-end {
  flex: 0 0 auto;
  min-width: 4.8em;
  text-align: right;
  padding-top: 3px;
  display: grid;
  gap: 4px;
  justify-items: end;
}
.good-qty {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}
.good-qty.low { color: var(--warn); }
.good-qty.neg { color: var(--err); font-weight: 650; }
.good-qty.stock {
  display: inline-block;
  background: var(--fill);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}
.good-qty.stock.low { background: #fff1de; color: var(--warn); }
.good-qty.stock.neg { background: #fdecea; color: var(--err); }
.pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 16px 0 8px;
}
.pager .btn.disabled, .btn.disabled {
  opacity: .4; pointer-events: none;
}
.kv {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px;
  margin: 0 0 16px;
}
.kv div { background: var(--fill); border-radius: 12px; padding: 10px 12px; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 4px 0 0; font-size: 15px; word-break: break-all; }
.kind-pills { padding-bottom: 8px; border-bottom: 0; }
.kind-pills .pill { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.kind-pills input { width: auto; margin: 0; accent-color: var(--brand); }
.kind-pills .pill.on { color: var(--brand); }
input[readonly] { background: var(--fill); color: var(--ink); }
.dates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 0 0 16px;
}
.dates div {
  background: var(--paper); border: 0; border-radius: 12px; padding: 12px;
}
.dates span { display: block; color: var(--muted); font-size: 12px; }
.dates strong { display: block; margin-top: 4px; font-size: 16px; letter-spacing: -.02em; }
.pd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pd-head h1 { font-size: 26px; }
.pd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pd-actions form { margin: 0; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.photo-grid figure { margin: 0; background: var(--paper); border-radius: 12px; overflow: hidden; }
.photo-grid img, .photo-grid .ph { width: 100%; height: 180px; object-fit: cover; background: var(--fill); }
.photo-grid .ph { display: grid; place-items: center; color: var(--muted); }
.photo-grid figcaption { padding: 8px 10px 10px; font-size: 12px; color: var(--muted); }
.code-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--paper); border-radius: 12px; padding: 14px; margin-bottom: 16px;
}
.code-card img { width: 120px; height: 120px; background: #fff; border-radius: 10px; flex-shrink: 0; }
.code-card p { margin: 8px 0 0; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; }
.hist a, .hist-row { display: flex; gap: 10px; align-items: center; padding: 12px 0; color: inherit; }
.hist-row.fail strong, .hist-row.fail span { color: var(--err); }
.hist img { width: 56px; height: 56px; border-radius: 10px; background: var(--fill); object-fit: cover; }
.hist .grow { display: grid; gap: 2px; }
.hist .grow span { color: var(--muted); font-size: 12px; }
.danger-zone { display: flex; gap: 16px; flex-wrap: wrap; margin: 28px 0 8px; }
.danger-zone form { margin: 0; }
.danger-zone.stack { display: grid; gap: 10px; }
.danger-zone.stack form { display: grid; gap: 8px; max-width: 420px; }
.link-quiet {
  background: none; border: 0; padding: 4px 0;
  color: var(--muted); font-size: 13px; cursor: pointer;
}
.form.sheet { margin-top: 8px; border: 0; background: transparent; padding: 0; }
.form-split { margin: 22px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-split h2 { margin-bottom: 6px; }
.form.tight { padding: 0; margin: 0; background: transparent; border: 0; }
.form.tight .btn { margin-top: 8px; }
.price-form { margin: 0 0 16px; }
.price-form:last-child { margin-bottom: 0; }
.price-name { margin: 12px 0 0; font-size: 14px; }
.price-edit { display: flex; gap: 8px; align-items: center; }
.price-edit input { flex: 1; min-width: 0; }
.price-edit .btn { flex-shrink: 0; margin-top: 0; }
.ops-day { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.ops-day:first-of-type { margin-top: 12px; padding-top: 0; border-top: 0; }
.ops-day h3 { margin: 0 0 4px; font-size: 17px; }
.ops-sum { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.ops-day h4 { margin: 12px 0 4px; font-size: 13px; color: var(--muted); font-weight: 650; }
.ops-fold { margin: 10px 0 0; }
.ops-fold summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
  padding: 8px 0;
}
.staff-ops { list-style: none; padding: 0; margin: 0; }
.ops-row {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.ops-row:last-child { border-bottom: 0; }
.ops-row em { color: var(--muted); font-size: 12px; font-style: normal; }
.ops-row div { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: baseline; }
.ops-act { font-size: 12px; font-weight: 700; color: var(--warn); flex-shrink: 0; }
.ops-act.sale { color: var(--err); }
.ops-act.sale.up { color: var(--ok); }
.ops-act.loss { color: var(--err); }
.ops-act.gain { color: var(--ok); }
.ops-act.price { color: var(--brand); }
.ops-act.count { color: var(--muted); }
.loss-list li.fail, .loss-list li.fail strong, .loss-list li.fail p { color: var(--err); }
.count-pend { list-style: none; padding: 0; margin: 12px 0; }
.count-pend li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.count-pend li:last-child { border-bottom: 0; }
.count-pend .grow { display: grid; gap: 2px; min-width: 0; }
.count-pend em { color: var(--muted); font-size: 12px; font-style: normal; }
.count-pend .loss { color: var(--err); font-size: 13px; }
.count-pend .gain { color: var(--ok); font-size: 13px; }
.count-pend .count { color: var(--muted); font-size: 13px; }
.label.check, label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}
.ops-row span { color: var(--muted); font-size: 13px; }
.ops-row.fail, .ops-row.fail strong, .ops-row.fail span { color: var(--err); }
.users { list-style: none; padding: 0; margin: 0 0 18px; }
.users li {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.users li:last-child { border-bottom: 0; }
.users .grow { display: grid; gap: 2px; }
.users .grow span { color: var(--muted); font-size: 13px; }
.perm-list { display: grid; gap: 10px; margin: 8px 0 14px; }
.perm { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.perm input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.advanced {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin: 16px 0;
}
.advanced summary { cursor: pointer; font-weight: 650; color: var(--warn); }
.advanced .form { margin-top: 12px; }
.dates strong span { font-weight: 400; color: var(--muted); font-size: 12px; display: inline; }
.more { margin: 16px 0; }
.more summary { cursor: pointer; color: var(--muted); font-weight: 650; }
.restock-ing {
  display: flex; gap: 12px; align-items: center; margin: 0 0 16px;
  background: var(--paper); border-radius: 12px; padding: 10px;
}
.restock-ing img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.restock-ing p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.restock-warn {
  background: #fdecec;
  color: var(--err);
  border: 2px solid #e8b4b0;
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
}
.restock-warn strong { font-size: 18px; }
.restock-warn p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.restock-warn .btn { width: 100%; min-height: 48px; font-weight: 650; }
.restock-warn form { margin: 0; }
.fold-warn {
  background: #fff6ee;
  box-shadow: inset 0 0 0 2px #f0d9b8;
}
.shots.one { grid-template-columns: 1fr; }
.shots.one .shot { min-height: 220px; }
.tick { display: grid; place-items: center; margin: 0; padding: 4px; }
.tick input { width: 20px; height: 20px; }
.dock {
  position: sticky;
  bottom: 8px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 16px;
}
.dock #sel-count { flex: 1; font-size: 13px; color: rgba(255,255,255,.65); }
.dock .tick { color: #fff; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dock .btn.primary { min-height: 40px; }
.scan-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; background: #000;
}
.scan-overlay video {
  flex: 1; width: 100%; object-fit: cover; background: #000;
}
.scan-frame {
  position: absolute; left: 8%; right: 8%; top: 28%;
  height: 24%;
  border: 2px solid #fff;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.32);
  overflow: hidden;
}
.scan-frame::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  background: #7cff9a;
  animation: scan-line 1.6s ease-in-out infinite;
}
@keyframes scan-line {
  0%, 100% { top: 10%; }
  50% { top: 88%; }
}
.scan-bar {
  position: relative; z-index: 1;
  display: flex; gap: 8px; align-items: center;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: #111; color: #fff;
}
.scan-bar p { flex: 1; margin: 0; font-size: 14px; }
.scan-bar .btn { background: #fff; }

.menu { margin: 16px 0 28px; background: var(--paper); border-radius: 12px; overflow: hidden; }
.menu form { margin: 0; }
.menu a, .menu button {
  display: grid; gap: 4px; width: 100%;
  padding: 16px; text-align: left; color: inherit;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  cursor: pointer; font: inherit;
}
.menu a:last-child, .menu form:last-child button, .menu > form:last-child button { border-bottom: 0; }
.menu strong { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.menu span { color: var(--muted); font-size: 13px; }
.more-logout { margin-top: 8px; }
.more-logout .btn { color: var(--muted); border-color: transparent; background: transparent; }

.tabbar svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
  display: block; margin: 0 auto 3px;
}
.tabbar svg circle { fill: currentColor; stroke: none; }
.tabbar a.on svg { stroke-width: 2; }
.nav-n, .tab-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  line-height: 1; font-style: normal; font-variant-numeric: tabular-nums;
}
.nav-n { margin-left: 8px; vertical-align: 1px; }
.nav-n[hidden], .tab-n[hidden] { display: none; }

@media (max-width: 860px) {
  .side { display: none; }
  .stats, .stats.mini, .grid2, .split { grid-template-columns: 1fr; }
  .main { padding: 18px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: #fffbf6; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(90, 60, 30, .1);
  }
  .tabbar a {
    color: var(--muted); text-align: center; font-size: 10px; padding: 4px 0 0;
    font-weight: 500; position: relative;
  }
  .tab-n { position: absolute; top: 0; left: calc(50% + 6px); box-shadow: 0 0 0 2px #fffbf6; }
  .tabbar a.on { color: var(--brand); font-weight: 650; }
  .list li, .batch-card { align-items: flex-start; }
  .batch-card .actions { margin-left: 0; width: 100%; }
  h1 { font-size: 28px; }
  .pd-head h1 { font-size: 24px; }
  .code-card { align-items: flex-start; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .photo-grid img, .photo-grid .ph { height: 140px; }
  .dates { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; }
  .item-head h1 { font-size: 22px; }
  .item-stats strong { font-size: 18px; }
  .item-cols { grid-template-columns: 1fr; }
  .item-page .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .item-page .photo-grid img, .item-page .photo-grid .ph { height: 110px; }
  .dock {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom));
    margin: 0;
  }
  .print-list { padding-bottom: 18px; }
  .toolbar-actions .btn { min-height: 40px; }
  .pills.cats { gap: 14px; }
}

.ymd-src {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}
.ymd {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 4px;
  position: relative;
  background: var(--fill);
  border-radius: 12px;
  margin: 0 0 10px;
  -webkit-user-select: none;
  user-select: none;
}
.ymd::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 48px;
  margin-top: -24px;
  background: #fff;
  border-radius: 10px;
  pointer-events: none;
  box-shadow: 0 0 0 1px var(--line);
}
.ymd-col { position: relative; z-index: 1; min-width: 0; }
.ymd-scroll {
  height: 240px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 96px 0;
  scrollbar-width: none;
  touch-action: pan-y;
}
.ymd-scroll::-webkit-scrollbar { display: none; }
.ymd-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
  scroll-snap-align: center;
  cursor: pointer;
  padding: 0;
}
.ymd-item.on { color: var(--ink); font-size: 22px; }
.ymd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ymd-trigger strong { font-size: 17px; font-weight: 700; }
.ymd-trigger span { color: var(--brand); font-weight: 650; flex: 0 0 auto; }
body.ymd-open { overflow: hidden; }
.ymd-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 16, 12, .45);
}
.ymd-sheet.hide { display: none; }
.ymd-sheet-card {
  width: 100%;
  max-width: 520px;
  background: var(--paper);
  border-radius: 16px 16px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
}
.ymd-sheet-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
.ymd-sheet .ymd { margin: 0 0 12px; }
.ymd-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.search-bar .price-edit { margin: 0; }
.search-bar .price-edit input { flex: 1; min-width: 0; }
.photo-grid figcaption a { color: var(--brand); }

.item-page { margin: 0; }
.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
.item-head h1 { font-size: 24px; line-height: 1.25; margin: 0; }
.item-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.item-meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.item-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}
.item-stats article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.item-stats span { display: block; color: var(--muted); font-size: 12px; }
.item-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  line-height: 1.25;
}
.item-stats strong.neg { color: var(--err); }
.item-stats strong.low { color: var(--warn); }
.item-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin: 14px 0;
}
.item-cols.one { grid-template-columns: 1fr; }
.item-cols .panel { margin: 0; }
.item-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 0;
}
.item-facts div { background: var(--fill); border-radius: 12px; padding: 10px 12px; }
.item-facts dt { color: var(--muted); font-size: 12px; }
.item-facts dd { margin: 4px 0 0; font-size: 15px; word-break: break-all; }
.item-page .fold { margin: 10px 0 0; }
.item-page > .panel { margin: 12px 0; }
.item-page .hist-row { padding: 10px 0; }
.item-page .photo-grid { margin-bottom: 0; }
.item-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 10px;
}
.item-label p { margin: 0; color: var(--muted); font-size: 13px; }
.pos-flow { padding-top: 8px; padding-bottom: 12px; }
.pos-flow > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -.02em;
  padding: 8px 0 10px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.pos-flow > summary::-webkit-details-marker { display: none; }
.pos-flow > summary::after {
  content: "展开";
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  flex-shrink: 0;
}
.pos-flow[open] > summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.pos-flow[open] > summary::after { content: "收起"; }
.pos-flow-box {
  max-height: min(70vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.pos-flow-sum { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.pos-flow-day { margin: 0 0 4px; }
.pos-flow-day h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 8px 0 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  background: var(--paper);
}
.pos-flow .hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pos-flow-qty {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pos-flow-qty.sell { color: var(--err); }
.pos-flow-qty.in { color: var(--ok); }
.pos-flow-qty.count { color: var(--warn); }
.pos-flow-qty.adjust, .pos-flow-qty.other { color: var(--muted); }

.mo-switch {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  margin: 16px 0; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: #fff;
}
.mo-switch button {
  height: 40px; border: 0; background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 650; cursor: pointer;
}
.mo-switch button + button { border-left: 1px solid var(--line); }
.mo-switch button.on { background: var(--ink); color: #fff; }
.mo-switch button b { margin-left: 4px; font-variant-numeric: tabular-nums; font-weight: 650; }
.mo-voice { min-height: 36px; padding: 0 12px; color: var(--muted); }
.mo-voice.is-on { color: var(--ok); }
.mo-tools { display: flex; gap: 8px; align-items: center; }
.mo-code {
  margin: 10px 0 0; font-size: 32px; line-height: 1.1; letter-spacing: .08em;
  font-variant-numeric: tabular-nums; font-weight: 650;
}
.mo-cards { display: grid; gap: 10px; }
.mo-card {
  display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; color: var(--ink);
}
.mo-card:active { background: var(--fill); }
.mo-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.mo-tags { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mo-way, .mo-state {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap;
}
.mo-way { background: var(--fill); color: var(--ink); }
.mo-way.is-express { background: #fff6ee; color: var(--warn); }
.mo-state.is-wait { background: #fff6ee; color: var(--warn); }
.mo-state.is-ok { background: #eef6f1; color: var(--ok); }
.mo-state.is-go { background: var(--fill); color: var(--ink); }
.mo-time { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mo-title {
  display: block; margin-top: 8px; font-size: 16px; line-height: 1.35;
  letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mo-no {
  display: block; margin-top: 2px; color: var(--muted); font-size: 12px;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mo-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: 8px; color: var(--muted); font-size: 13px;
}
.mo-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-foot b {
  flex: 0 0 auto; min-width: 72px; text-align: right;
  color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.mo-empty {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 36px 18px; text-align: center;
}
.mo-empty strong { display: block; font-size: 16px; }
.mo-empty p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.mo-head {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px;
}
.mo-head h1 { margin: 8px 0 0; font-size: 20px; letter-spacing: -.03em; }
.mo-sum { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.mo-sum b { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.mo-addr { margin: 8px 0 0; font-size: 14px; line-height: 1.45; }
.mo-lines { display: grid; gap: 10px; }
.mo-line {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px;
}
.mo-line input, .mo-tick {
  width: 22px; height: 22px; accent-color: var(--brand);
}
.mo-line img, .mo-ph {
  width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--fill);
}
.mo-line strong { display: block; font-size: 15px; line-height: 1.35; }
.mo-line p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.mo-yuan { color: var(--ink) !important; font-variant-numeric: tabular-nums; font-weight: 650; }
.mo-line.is-off { opacity: .55; }

/* 手机店内后台：跟商城后台同一套颜色和零件。只改样子，不改按钮和表单。 */
@media (max-width: 860px) {
  html:has(body.box) { background: #f5f7fa; }
  body.box {
    --bg: #f5f7fa;
    --paper: #fff;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --brand: #2e5bff;
    --brand-ink: #fff;
    --ok: #16a34a;
    --warn: #ea8a00;
    --err: #dc2626;
    --fill: #f3f4f6;
    --radius: 10px;
    color: #111827;
    background: #f5f7fa;
    background-image: none;
    font-size: 14px;
  }
  body.box::before { display: none; }
  body.box a { color: #2e5bff; }
  body.box h1 { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 4px; }
  body.box h2 { font-size: 16px; font-weight: 650; }
  body.box h3 { font-size: 15px; }
  body.box .main { padding: 16px 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); max-width: none; }
  body.box .hero,
  body.box .panel,
  body.box .card,
  body.box .form,
  body.box .auth-card,
  body.box .status-card,
  body.box .mo-card,
  body.box .mo-head,
  body.box .mo-line,
  body.box .mo-empty,
  body.box .mo-done,
  body.box .menu,
  body.box .empty,
  body.box .table-wrap,
  body.box .loss-hero,
  body.box .stats article,
  body.box .item-stats article {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: none;
  }
  body.box .hero, body.box .panel, body.box .form { padding: 16px; margin: 12px 0; }
  body.box .btn {
    min-height: 36px;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    border-color: #d1d5db;
    background: #fff;
    color: #111827;
    font-weight: 600;
    box-shadow: none;
  }
  body.box .btn.primary { background: #2e5bff; border-color: #2e5bff; color: #fff; }
  body.box .btn.primary:active { background: #1e45e0; }
  body.box .btn.ghost { background: transparent; border-color: transparent; color: #4b5563; }
  body.box .btn.danger { color: #dc2626; background: #fff; border-color: #fecaca; }
  body.box .btn.sm { height: 32px; min-height: 32px; padding: 0 10px; font-size: 13px; }
  body.box .btn.lg { height: 44px; min-height: 44px; width: 100%; border-radius: 10px; font-size: 16px; }
  body.box .btn:active { transform: scale(0.98); }
  body.box input,
  body.box select,
  body.box textarea {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
  }
  body.box input:focus,
  body.box select:focus,
  body.box textarea:focus {
    outline: none;
    border-color: #2e5bff;
    box-shadow: 0 0 0 3px rgba(46, 91, 255, 0.16);
  }
  body.box .search-bar input {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
  }
  body.box .tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
  }
  body.box .tag.synced,
  body.box .tag.ok { background: #ecfdf3; color: #16a34a; }
  body.box .tag.pending,
  body.box .tag.soon,
  body.box .tag.watch,
  body.box .tag.near,
  body.box .tag.approaching { background: #fff7ed; color: #c2410c; }
  body.box .tag.failed,
  body.box .tag.expired { background: #fef2f2; color: #dc2626; }
  body.box .tag.unknown { background: #f3f4f6; color: #6b7280; }
  body.box .toast { border-radius: 8px; }
  body.box .toast.ok { background: #ecfdf3; color: #16a34a; }
  body.box .toast.warn { background: #fff7ed; color: #c2410c; }
  body.box .toast.err { background: #fef2f2; color: #dc2626; }
  body.box .banner,
  body.box .fold-warn { background: #fff7ed; color: #c2410c; border-radius: 8px; }
  body.box .alert-row,
  body.box .restock-warn {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 10px;
  }
  body.box .mo-switch {
    background: #f3f4f6;
    border: 0;
    border-radius: 8px;
    padding: 3px;
  }
  body.box .mo-switch button { height: 32px; border-radius: 6px; color: #4b5563; font-weight: 600; }
  body.box .mo-switch button + button { border-left: 0; }
  body.box .mo-switch button.on { background: #fff; color: #111827; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08); }
  body.box .seg { border-radius: 8px; border-color: #e5e7eb; background: #f3f4f6; padding: 3px; }
  body.box .seg button { border-radius: 6px; padding: 8px 12px; }
  body.box .seg button.on { background: #fff; color: #111827; }
  body.box .pill.on { color: #2e5bff; box-shadow: inset 0 -2px 0 #2e5bff; }
  body.box .pick.on { border-color: #2e5bff; background: #eef2ff; }
  body.box .tabbar {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: none;
  }
  body.box .tabbar a { color: #9ca3af; font-size: 11px; }
  body.box .tabbar a.on { color: #2e5bff; font-weight: 650; }
  body.box .tab-n,
  body.box .nav-n { background: #dc2626; box-shadow: 0 0 0 2px #fff; }
  body.box .dock {
    background: #fff;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
  }
  body.box .dock #sel-count { color: #6b7280; }
  body.box .dock .tick { color: #111827; }
  body.box .loss-hero strong { color: #111827; }
  body.box .logo,
  body.box .logo.big { background: #2e5bff; border-radius: 10px; }
  body.box .auth-card { box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06); }
  body.box .auth-card h1 { font-size: 22px; }
  body.box .ymd { background: #f3f4f6; border-radius: 10px; }
  body.box .ymd-trigger { background: #f3f4f6; border-radius: 8px; }
  body.box .ymd-sheet { background: rgba(15, 23, 42, 0.45); }
  body.box .ymd-sheet-card { background: #fff; border-radius: 16px 16px 0 0; }
  body.box .stats strong { font-size: 22px; }
  body.box .mo-foot b { color: #111827; }
  body.box .mo-way.is-express,
  body.box .mo-state.is-wait { background: #fff7ed; color: #c2410c; }
  body.box .mo-state.is-ok { background: #ecfdf3; color: #16a34a; }
  body.box .mo-state.is-go,
  body.box .mo-way { background: #f3f4f6; color: #374151; }
}
.mo-line-act { align-self: center; }
.mo-line-act form { margin: 0; }
.mo-ship { margin-top: 16px; }
.mo-ship .btn.lg { margin-top: 8px; }
.mo-meta { margin: 6px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.mo-done {
  margin-top: 16px; padding: 14px 16px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; font-size: 14px;
}
