/* ============================================================
   Hakuba Grocery Delivery — Prototype stylesheet
   Static HTML prototype · no build step
   ============================================================ */

* { box-sizing: border-box; }

:root {
  --ink: #101a1f;
  --ink2: #3b4a52;
  --muted: #6c7a82;
  --line: #e4e9ec;
  --line2: #eff3f5;
  --bg: #f2f5f6;
  --surface: #fff;

  --brand: #14323e;
  --brand2: #1e4c5c;
  --accent: #dd5f2b;
  --accent-d: #b94a1d;

  --ok: #1b7a55;
  --okbg: #e8f5ef;
  --warn: #96650f;
  --warnbg: #fdf3e2;
  --danger: #ae3529;
  --dangbg: #fbebe9;
  --alco: #65459b;
  --alcobg: #f2edfa;

  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 26, 31, .05), 0 10px 28px rgba(16, 26, 31, .07);
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

html, body { margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
table { border-collapse: collapse; width: 100%; }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
.fieldgap { display: flex; flex-direction: column; gap: 12px; }

/* ---------- prototype chrome ---------- */
.proto-nav {
  position: fixed; right: 16px; bottom: 16px; z-index: 999;
  display: flex; gap: 8px; align-items: center;
}
.proto-nav a, .proto-nav button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: 999px;
  background: rgba(16, 26, 31, .88); color: #fff;
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 6px 18px rgba(16, 26, 31, .22);
  backdrop-filter: blur(6px);
  transition: transform .12s ease, background .12s ease;
}
.proto-nav a:hover, .proto-nav button:hover { transform: translateY(-1px); background: #101a1f; }
.proto-nav .alt { background: rgba(221, 95, 43, .92); }
.proto-nav .alt:hover { background: var(--accent-d); }

/* ---------- phone frame ---------- */
.stage {
  min-height: 100vh; display: flex; justify-content: center; align-items: flex-start;
  padding: 34px 16px 110px;
  background:
    radial-gradient(900px 420px at 50% -10%, #e7eef1, transparent 70%),
    var(--bg);
}
.phone {
  width: 390px; max-width: 100%; height: 812px; flex: 0 0 auto;
  background: #0b1418; border-radius: 42px; padding: 9px;
  box-shadow: 0 34px 64px -22px rgba(16, 26, 31, .38), 0 0 0 1px rgba(16, 26, 31, .1);
  position: relative;
}
.phone::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 15px; width: 120px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .28);
  pointer-events: none;
}
.screen {
  background: #fff; border-radius: 34px; height: 100%; overflow-y: auto; overflow-x: hidden;
  position: relative; scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

.sbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 22px 3px; font-size: 12px; font-weight: 700; color: var(--ink);
  background: #fff;
}
.sbar .r { display: flex; gap: 5px; align-items: center; color: var(--ink2); font-weight: 600; }

/* language switcher (FR-09.3): 仅商城首页 appbar 右侧显示，记忆选择存 localStorage */
.langseg { display: inline-flex; border: 1px solid var(--line2); border-radius: 999px; overflow: hidden; background: #fff; }
.langseg label { position: relative; }
.langseg input { position: absolute; opacity: 0; width: 0; height: 0; }
.langseg label span {
  display: block; padding: 4px 12px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; color: var(--ink2); cursor: pointer; user-select: none;
}
.langseg input:checked + span { background: var(--brand); color: #fff; }

/* ---------- app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 12px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line2);
}
.appbar h2 { font-size: 16px; flex: 1; }
.iconbtn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--ink2);
}
.iconbtn:hover { background: var(--line2); }

/* front-end: delivery-address selector + cart count + ship info */
.areabar {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 16px 0; padding: 9px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  cursor: pointer; width: calc(100% - 32px); text-align: left;
  appearance: none; -webkit-appearance: none; font: inherit; color: inherit;
}
.areabar:hover { border-color: #cfd8dc; }
.areabar .pin { color: var(--brand2); flex: 0 0 auto; }
.areabar-lbl { font-size: 12px; font-weight: 700; color: var(--ink2); flex: 0 0 auto; }
.areabar b { font-weight: 700; }
.areabar .chev { margin-left: auto; color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.tab-count {
  display: inline-block; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px;
  margin-left: 4px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 800; text-align: center; vertical-align: middle;
}
.ship-info { margin-bottom: 9px; display: flex; flex-direction: column; gap: 4px; }
.si-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; color: var(--muted); }
.si-row .num { font-weight: 700; color: var(--ink2); }
.si-row .num.ok { color: var(--ok); }
.back { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--ink2); }
.back:hover { background: var(--line2); }

/* ---------- delivery address modal ---------- */
.modal-mask {
  position: absolute; inset: 9px; z-index: 200;
  background: rgba(16, 26, 31, .45);
  border-radius: 34px; overflow: hidden;
  display: none; align-items: flex-end; justify-content: center;
  padding: 0 12px 14px;
}
.modal-mask.open { display: flex; }
.modal-card {
  width: 100%; max-height: 84%; display: flex; flex-direction: column;
  background: #fff; border-radius: 20px 20px 16px 16px; overflow: hidden;
  box-shadow: 0 -10px 34px rgba(0, 0, 0, .22);
  animation: sheetUp .18s ease;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .5; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 10px; }
.modal-head .mt { font-size: 15px; font-weight: 750; }
.x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 20px; line-height: 1; margin: -4px -4px -4px 0; }
.x:hover { background: var(--line2); }
.modal-body { padding: 0 16px 12px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; padding: 10px 16px 16px; border-top: 1px solid var(--line2); }
.addr-list { display: flex; flex-direction: column; gap: 7px; }
.addr-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; position: relative; }
.addr-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.addr-item.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.addr-item .radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #c3ced3; flex: 0 0 auto; display: grid; place-items: center; }
.addr-item.on .radio { border-color: var(--brand); }
.addr-item.on .radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.addr-item .ai-main { flex: 1; min-width: 0; }
.addr-item .ai-main b { font-size: 13.5px; font-weight: 700; display: block; }
.addr-item .ai-main i { font-size: 11px; color: var(--muted); font-style: normal; }
.form-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.form-field[hidden] { display: none; }
.form-field label { font-size: 12px; font-weight: 680; color: var(--ink2); }
.link-back {
  align-self: flex-start; margin-top: 2px; font-size: 12px; font-weight: 650;
  color: var(--brand2); cursor: pointer; user-select: none;
}
.link-back:hover { text-decoration: underline; }

/* ---------- help / faq ---------- */
.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.faq summary { list-style: none; cursor: pointer; padding: 13px 14px; font-size: 13.5px; font-weight: 680; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { transition: transform .15s ease; color: var(--muted); flex: 0 0 auto; transform: rotate(0deg); }
.faq[open] summary .chev { transform: rotate(180deg); }
.faq .fa { padding: 0 14px 14px; font-size: 12.5px; color: var(--ink2); line-height: 1.65; }

/* ---------- generic ---------- */
.pad { padding: 0 16px; }
.section { padding: 18px 16px 0; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px;
}
.card.tight { padding: 12px 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 650; }
.h1 { font-size: 23px; font-weight: 780; letter-spacing: -.025em; }
.h2 { font-size: 17px; font-weight: 720; }
.h3 { font-size: 14.5px; font-weight: 700; }
.divider { height: 1px; background: var(--line2); margin: 12px 0; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.b-ok { background: var(--okbg); color: var(--ok); }
.b-warn { background: var(--warnbg); color: var(--warn); }
.b-danger { background: var(--dangbg); color: var(--danger); }
.b-alco { background: var(--alcobg); color: var(--alco); }
.b-mute { background: var(--line2); color: var(--ink2); }
.b-info { background: #e9f1f5; color: var(--brand2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 12px;
  font-size: 15px; font-weight: 700; width: 100%;
  background: var(--line2); color: var(--ink);
  transition: background .12s ease, transform .12s ease;
}
.btn:active { transform: scale(.995); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px rgba(221, 95, 43, .7); }
.btn-primary:hover { background: var(--accent-d); }
.btn-dark { background: var(--brand); color: #fff; }
.btn-dark:hover { background: var(--brand2); }
.btn-ghost { background: #fff; border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--line2); }
.btn[disabled], .btn.is-disabled {
  background: var(--line2); color: #9aa8af; box-shadow: none; cursor: not-allowed; pointer-events: none;
}
.btn-sm { height: 36px; font-size: 13px; border-radius: 9px; width: auto; padding: 0 14px; }

.notice {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 12px; border-radius: 11px; font-size: 12.5px; line-height: 1.5;
}
.notice b { font-weight: 700; }
.n-info { background: #eef5f8; color: var(--brand2); }
.n-warn { background: var(--warnbg); color: var(--warn); }
.n-ok { background: var(--okbg); color: var(--ok); }
.n-danger { background: var(--dangbg); color: var(--danger); }
.n-alco { background: var(--alcobg); color: var(--alco); }

/* ---------- shop ---------- */
.hero {
  margin: 4px 16px 0; padding: 16px; border-radius: 18px;
  background: linear-gradient(150deg, #16323e 0%, #1d4d5d 62%, #2a6b74 100%);
  color: #fff; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -30px; width: 180px; height: 180px;
  border-radius: 50%; background: rgba(255, 255, 255, .07);
}
.hero .k { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .72; }
.hero h1 { font-size: 21px; margin-top: 6px; letter-spacing: -.02em; }
.hero p { font-size: 12.5px; opacity: .82; margin-top: 6px; line-height: 1.5; }

.status-strip {
  margin: 10px 16px 0; display: flex; gap: 8px; align-items: center;
  padding: 9px 12px; border-radius: 11px; background: var(--warnbg); color: var(--warn);
  font-size: 12px; font-weight: 650;
}

.cats {
  display: flex; gap: 7px; overflow-x: auto; padding: 14px 16px 4px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 auto; height: 32px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 650; color: var(--ink2);
}
.cat.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.search {
  margin: 12px 16px 0; display: flex; align-items: center; gap: 9px;
  height: 42px; padding: 0 13px; border-radius: 11px; background: var(--line2);
  color: var(--muted); font-size: 13.5px;
}

.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 16px 0; }
.prod {
  border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff;
  display: flex; flex-direction: column;
}
.prod:hover { border-color: #cfd8dc; }
.thumb {
  height: 96px; display: grid; place-items: center; position: relative;
}
.thumb span {
  font-size: 26px; font-weight: 800; letter-spacing: .08em;
  color: rgba(16, 26, 31, .17);
}
.thumb .tag { position: absolute; top: 7px; left: 7px; }
.t-dairy { background: linear-gradient(140deg, #e8f2f8, #cfe3ee); }
.t-prod { background: linear-gradient(140deg, #eaf4ea, #d3e8d7); }
.t-pantry { background: linear-gradient(140deg, #fbf0e0, #f0ddc0); }
.t-alco { background: linear-gradient(140deg, #f3eefa, #e0d6f1); }
.t-bakery { background: linear-gradient(140deg, #f9efe7, #eddcc9); }
.t-chill { background: linear-gradient(140deg, #e9f1f6, #d7e4ec); }
.pbody { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.pbody h4 { font-size: 12.5px; font-weight: 680; line-height: 1.35; }
.pbody .meta { font-size: 10.5px; color: var(--muted); }
.prow { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.price { font-size: 14.5px; font-weight: 760; letter-spacing: -.01em; }
.addbtn {
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 16px; font-weight: 600; line-height: 1;
}
.addbtn:hover { background: var(--brand2); }

.tabbar {
  position: sticky; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line2); padding: 7px 0 20px;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 650; color: var(--muted);
}
.tab.on { color: var(--brand); }
.tab i { width: 20px; height: 20px; display: block; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 680; color: var(--ink2); }
.field .req { color: var(--accent); }
.input {
  height: 44px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px;
  font-size: 14px; background: #fff; color: var(--ink); width: 100%;
  font-family: inherit;
}
.input:focus { outline: 2px solid #cfe0e6; border-color: var(--brand2); }
select.input { appearance: none; background-image: none; }
textarea.input { height: auto; padding: 10px 12px; resize: none; line-height: 1.5; }
.help { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.err { font-size: 11.5px; color: var(--danger); font-weight: 600; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; }
.box {
  flex: 0 0 auto; width: 19px; height: 19px; border-radius: 5px; border: 1.5px solid #c3ced3;
  display: grid; place-items: center; margin-top: 1px; background: #fff;
}
.box.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- slots ---------- */
.dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.dates::-webkit-scrollbar { display: none; }
.date {
  flex: 0 0 auto; min-width: 92px; padding: 9px 11px; border-radius: 11px;
  border: 1px solid var(--line); background: #fff; text-align: left;
}
.date .d { font-size: 12.5px; font-weight: 720; }
.date .s { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.date.on { border-color: var(--brand); background: #f2f7f8; box-shadow: inset 0 0 0 1px var(--brand); }
.date.off { background: #f7f9fa; color: #a9b5bb; border-style: dashed; }
.date.off .d { font-weight: 650; }

.slots { display: grid; gap: 8px; margin-top: 8px; }
.slot {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px;
  background: #fff; font-size: 13px; font-weight: 650;
}
.slot.on { border-color: var(--brand); background: #f2f7f8; box-shadow: inset 0 0 0 1px var(--brand); }
.slot .cap { font-size: 11px; font-weight: 600; color: var(--muted); }
.slot.on .cap { color: var(--ok); }

/* ---------- summary ---------- */
.sum { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.sum .li { display: flex; justify-content: space-between; color: var(--ink2); }
.sum .li.total { font-size: 16px; font-weight: 780; color: var(--ink); padding-top: 9px; border-top: 1px solid var(--line2); }

.lineitem { display: flex; gap: 11px; align-items: flex-start; }
.lineitem .mini-thumb {
  width: 54px; height: 54px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; letter-spacing: .05em; color: rgba(16, 26, 31, .18);
}
.stepper {
  display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; height: 28px;
}
.stepper button { width: 27px; height: 100%; display: grid; place-items: center; color: var(--ink2); font-size: 14px; }
.stepper button:hover { background: var(--line2); }
.stepper span { min-width: 24px; text-align: center; font-size: 12.5px; font-weight: 700; }

.progress { height: 6px; border-radius: 6px; background: var(--line2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* ---------- timeline ---------- */
.tl { display: flex; flex-direction: column; gap: 0; }
.tl .step { display: grid; grid-template-columns: 26px 1fr; gap: 11px; }
.tl .rail { display: flex; flex-direction: column; align-items: center; }
.tl .dot {
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid #cfd8dc; background: #fff;
  margin-top: 3px; flex: 0 0 auto;
}
.tl .step.done .dot { background: var(--ok); border-color: var(--ok); }
.tl .step.now .dot { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(221, 95, 43, .14); }
.tl .bar { width: 2px; background: var(--line); flex: 1; margin: 3px 0; }
.tl .step.done .bar { background: var(--ok); }
.tl .body { padding-bottom: 16px; }
.tl .step:last-child .body { padding-bottom: 0; }
.tl .t { font-size: 13px; font-weight: 700; }
.tl .d { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin { display: flex; min-height: 100vh; background: var(--bg); }
.side {
  width: 214px; flex: 0 0 214px; background: var(--brand); color: #cfdde3;
  padding: 16px 11px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px;
}
.side .brand { padding: 6px 10px 16px; color: #fff; }
.side .brand b { font-size: 14.5px; letter-spacing: .02em; display: block; }
.side .brand span { font-size: 10.5px; color: #8fa8b2; letter-spacing: .08em; text-transform: uppercase; }
.side .grp { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #6d8b96; padding: 14px 10px 6px; }
.side a {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: #b6c9d1;
}
.side a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side a.on { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 650; }
.side .foot { margin-top: auto; padding: 10px; font-size: 11px; color: #7f9aa4; }

.main { flex: 1; padding: 20px 26px 70px; max-width: 1220px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.topbar h1 { font-size: 21px; font-weight: 760; letter-spacing: -.02em; }
.topbar .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tb-actions { display: flex; gap: 8px; align-items: center; }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 11px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.kpi .k { font-size: 11px; color: var(--muted); font-weight: 650; }
.kpi b { font-size: 21px; font-weight: 760; letter-spacing: -.02em; display: block; margin-top: 3px; }
.kpi.warn b { color: var(--warn); }
.kpi.danger b { color: var(--danger); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.panel > header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 15px; border-bottom: 1px solid var(--line2);
}
.panel > header h3 { font-size: 13.5px; font-weight: 720; }
.panel > .body { padding: 14px 15px; }
.dtable { font-size: 12.5px; }
.dtable th {
  text-align: left; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: #fafcfc; white-space: nowrap;
}
.dtable td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.dtable tr:last-child td { border-bottom: none; }
.dtable tbody tr:hover { background: #fbfdfd; }
.dtable .ord { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.dtable .r { text-align: right; }

.chipstatus {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px;
  border-radius: 5px; font-size: 10.5px; font-weight: 700;
}
.dot-s { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* new-order toast */
.toast {
  position: fixed; top: 18px; right: 20px; z-index: 500; width: 320px;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 12px; box-shadow: 0 18px 40px -14px rgba(16, 26, 31, .3);
  padding: 13px 14px;
}
.toast .tt { font-size: 12.5px; font-weight: 750; display: flex; align-items: center; gap: 7px; }
.toast .tm { font-size: 12px; color: var(--ink2); margin-top: 5px; line-height: 1.5; }
.toast .ta { display: flex; gap: 7px; margin-top: 10px; }
.ping {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative;
}
.ping::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: .5; animation: ping 1.6s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .6; } 100% { transform: scale(1.5); opacity: 0; } }

.range { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink2); }
.range input[type="range"] { flex: 1; accent-color: var(--accent); }

.switch {
  width: 38px; height: 22px; border-radius: 999px; background: #d4dde1; position: relative;
  flex: 0 0 auto; transition: background .15s ease;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .15s ease;
}
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(16px); }

.split { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 108px 1fr; gap: 7px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* receipt */
.receipt-wrap { display: flex; justify-content: center; padding: 30px 16px 90px; }
.rcpt {
  width: 302px; background: #fff; padding: 22px 18px 26px;
  box-shadow: 0 10px 30px -12px rgba(16, 26, 31, .22);
  font-family: var(--mono); font-size: 11px; line-height: 1.5; color: #101a1f;
  border-top: 3px dashed #d5dee2;
}
.rcpt hr { border: none; border-top: 1px dashed #b9c6cd; margin: 9px 0; }
.rcpt .c { text-align: center; }
.rcpt .b { font-weight: 700; }
.rcpt .l { display: flex; justify-content: space-between; gap: 8px; }
.rcpt .xl { font-size: 14px; font-weight: 700; }
.rcpt .sm { font-size: 10px; color: #4a5a63; }

/* ---------- admin 整屏弹层（后台页面共用） ---------- */
.am-mask { position: fixed; inset: 0; z-index: 600; background: rgba(16, 26, 31, .45);
  display: none; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.am-mask.open { display: flex; }
.am-card { width: 620px; max-width: 100%; display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; box-shadow: 0 26px 64px -18px rgba(16, 26, 31, .5); overflow: hidden; }
.am-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px 11px; border-bottom: 1px solid var(--line2); }
.am-head .mt { font-size: 15.5px; font-weight: 750; }
.am-head .x { margin-left: auto; font-size: 19px; line-height: 1; color: var(--muted); width: 28px; height: 28px;
  border-radius: 8px; display: grid; place-items: center; }
.am-head .x:hover { background: var(--line2); color: var(--ink); }
.am-body { padding: 14px 18px 16px; }
.am-foot { display: flex; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--line2); background: #fcfdfd; }
.am-foot .btn { flex: 1; }
.am-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.am-grid .full { grid-column: 1 / -1; }

/* 图片上传区 */
.upz { display: flex; gap: 12px; align-items: flex-start; }
.upz-box { width: 104px; height: 104px; flex: 0 0 auto; border: 1px dashed #c3d0d7; border-radius: 11px;
  background: #fafbfc; overflow: hidden; position: relative; display: grid; place-items: center; cursor: pointer; }
.upz-box:hover { border-color: var(--brand2); background: #f4f8fa; }
.upz-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upz-box .ph { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.5; padding: 0 6px; }
.upz-slot { width: 104px; height: 104px; flex: 0 0 auto; border: 1px solid var(--line2); border-radius: 11px;
  overflow: hidden; position: relative; background: var(--line2); }
.upz-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upz-slot .rm { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(16, 26, 31, .62); color: #fff; font-size: 13px; line-height: 1; display: grid; place-items: center; }
.upz-slot .rm:hover { background: var(--danger); }

/* 库存预警（商品列表） */
.dtable tbody tr.st-low { background: #fff8f4; }
.dtable tbody tr.st-out { background: #fdf3f2; }
.dtable tbody tr.st-low td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.dtable tbody tr.st-out td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.stock-n { font-variant-numeric: tabular-nums; font-weight: 750; }
.stock-n.low { color: var(--warn); }
.stock-n.out { color: var(--danger); }

/* 列表缩略图 */
.pthumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line2);
  display: block; background: var(--line2); }
.pthumb.ph { display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: rgba(16, 26, 31, .34); }
.pcell { display: flex; align-items: center; gap: 9px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .split, .split-2 { grid-template-columns: 1fr; }
}
