:root {
  --paper: #f4efe4;
  --ink: #241c16;
  --ink-soft: #6d6258;
  --line: rgba(36, 28, 22, 0.12);
  --seal: #9c2f2b;
  --leaf: #2f6a4a;
  --card: #fffaf3;
  --shadow: 0 24px 60px rgba(60, 40, 20, 0.12);
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --num: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 650; letter-spacing: -0.03em; margin: 0; }
p { line-height: 1.55; }
a { color: inherit; }
::selection { background: #f0c2b4; }
::placeholder { color: #9a8d80; }

.eyebrow {
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}
.muted, .hint, .hostline, .address { color: var(--ink-soft); }
.hint { font-size: 12px; margin: 6px 0 0; }
.form-error { color: var(--seal); margin: 0; font-size: 13px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

.seal {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: var(--seal);
  border: 2px solid var(--seal);
  border-radius: 8px;
  box-shadow: inset 0 0 0 4px rgba(156, 47, 43, 0.28);
  font-family: var(--serif);
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  transform: rotate(-8deg);
}
.seal.sm { width: 46px; height: 46px; font-size: 13px; box-shadow: inset 0 0 0 3px rgba(156, 47, 43, 0.28); }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--seal);
  color: #fffaf3;
}
.btn.ink { background: var(--ink); }
.btn.green { background: #07c160; color: #062816; font-weight: 700; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.slim { padding: 8px 12px; font-size: 13px; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.textbtn { border: 0; background: transparent; color: var(--seal); padding: 8px 0; }
.sheet > .textbtn { display: block; width: 100%; text-align: center; }
.textbtn.danger { color: var(--ink-soft); }

label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 16px;
}
textarea { min-height: 72px; resize: vertical; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.paid, .badge.need { color: var(--seal); background: rgba(156, 47, 43, 0.08); border-color: rgba(156, 47, 43, 0.3); }
.badge.ship { color: #8a5a12; background: rgba(138, 90, 18, 0.1); border-color: rgba(138, 90, 18, 0.35); }
.badge.sent, .badge.completed { color: var(--leaf); background: rgba(47, 106, 74, 0.08); border-color: rgba(47, 106, 74, 0.28); }
.badge.refunded { color: var(--ink-soft); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 8px);
  background: #241c16;
  color: #f4efe4;
  padding: 10px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 30;
  font-size: 14px;
  max-width: min(420px, calc(100% - 32px));
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

body.home {
  background:
    radial-gradient(ellipse at 0% 0%, rgba(156, 47, 43, 0.08), transparent 42%),
    radial-gradient(ellipse at 100% 100%, rgba(47, 106, 74, 0.12), transparent 46%),
    var(--paper);
}
.poster {
  width: min(1080px, calc(100% - 40px));
  margin: 28px auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
  min-height: calc(100dvh - 72px);
}
.hero { display: grid; justify-items: start; gap: 8px; }
.wordmark { font-family: var(--serif); letter-spacing: 0.22em; margin: 8px 0 0; }
.hero h1 { font-size: clamp(52px, 7vw, 92px); line-height: 0.98; margin-top: 6px; }
.markline {
  background-image: linear-gradient(#f0b2a4, #f0b2a4);
  background-repeat: no-repeat;
  background-size: 100% 0.32em;
  background-position: 0 88%;
}
.lede { font-size: 17px; max-width: 36em; margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: center; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font-family: var(--num);
  flex: none;
}
.garland { display: flex; gap: 8px; margin-top: 18px; }
.garland span {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.72);
  display: grid;
  place-items: center;
}
.garland svg { width: 48px; height: 48px; }
.codes { display: grid; gap: 14px; }
.qrcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 18px 18px 16px;
  display: grid;
  justify-items: center;
  text-align: center;
  box-shadow: var(--shadow);
}
.qrcard h2 { font-size: 28px; }
.qrcard-kicker { letter-spacing: 0.22em; font-size: 12px; color: var(--seal); margin: 0; }
.qrwrap { width: min(220px, 100%); aspect-ratio: 1; }
.qrwrap img { width: 100%; height: 100%; background: #fff; border-radius: 12px; display: block; object-fit: contain; }
.qrcard a { color: var(--seal); }
.admin-entry { justify-self: center; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.hostline, .foot { text-align: center; font-size: 13px; }
.foot { padding: 0 16px 22px; }

body.mp {
  background:
    radial-gradient(ellipse at 50% 0%, #6d5646, transparent 55%),
    #2a211c;
}
.stage { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.phone {
  width: 390px;
  height: min(844px, calc(100dvh - 32px));
  background: var(--paper);
  border: 10px solid #1a1613;
  border-radius: 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
}
.phone::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 118px;
  height: 22px;
  transform: translateX(-50%);
  background: #1a1613;
  border-radius: 0 0 14px 14px;
  z-index: 4;
}
#app { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.phone #toast { position: absolute; bottom: 84px; }
.statusfake {
  height: 42px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 18px 6px;
  font-size: 12px;
  font-weight: 700;
}
.mp-nav { height: 42px; display: grid; place-items: center; position: relative; }
.mp-nav strong { font-family: var(--serif); font-weight: 650; }
.capsule {
  position: absolute;
  right: 10px;
  top: 6px;
  width: 74px;
  height: 28px;
  border: 1px solid rgba(36, 28, 22, 0.16);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  background: rgba(255, 250, 243, 0.8);
}
.capsule .dots { width: 16px; height: 4px; background: radial-gradient(circle, var(--ink) 1.2px, transparent 1.4px); background-size: 5px 4px; }
.capsule i { width: 14px; height: 14px; border: 1.5px solid var(--ink); border-radius: 50%; }
.screen { flex: 1; min-height: 0; overflow: auto; padding: 0 16px 12px; }
.screen::-webkit-scrollbar, .chips::-webkit-scrollbar { width: 0; height: 0; }
.splash, .empty { margin: auto; text-align: center; display: grid; justify-items: center; gap: 12px; padding: 24px; color: var(--ink-soft); }
.board-head, .order-top, .sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.board-head h1 { font-size: 32px; margin-top: 4px; }
.notice, .banner {
  margin: 10px 0 12px;
  padding: 12px 14px;
  background: rgba(255, 250, 243, 0.86);
  border-left: 3px solid var(--seal);
  color: var(--ink-soft);
  font-size: 14px;
}
.updated { margin: 0; color: var(--leaf); font-size: 12px; }
.chips, .filters { display: flex; gap: 8px; overflow: auto; padding: 4px 0 10px; }
.chip {
  border: 1px dashed rgba(36, 28, 22, 0.28);
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
  color: var(--ink-soft);
}
.chip.on { border-style: solid; background: var(--ink); color: var(--paper); }
.bloom { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bloom-open {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.bloom-open strong { font-size: 18px; font-weight: 650; }
.bloom-desc { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 13px; }
.price-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.bloom-art {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--petal) 18%, #fffaf3);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.bloom-art.lg { width: 100%; height: 180px; margin-bottom: 10px; }
.bloom-art.lg svg { width: 120px; height: 120px; }
.bloom-art .cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-tag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-style: normal;
  font-size: 10px;
  line-height: 1.4;
  background: rgba(36, 28, 22, 0.72);
  color: #fffaf3;
  border-radius: 999px;
  padding: 1px 5px;
}
.bloom-art svg { width: 58px; height: 58px; }
.bloom h3 { font-size: 18px; }
.bloom p, .yest { margin: 2px 0 8px; color: var(--ink-soft); font-size: 13px; }
.bloom-row, .price-inputs { display: flex; align-items: center; gap: 8px; }
.bloom-row { margin: 8px 0 0 88px; }
.price { font-family: var(--num); font-size: 28px; line-height: 1; font-weight: 560; }
.price small { font-size: 14px; margin-right: 1px; }
.stock { color: var(--ink-soft); font-size: 12px; }
.stock.low { color: var(--seal); }
.add {
  margin-left: auto;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}
.incart { font-style: normal; font-family: var(--num); min-width: 18px; text-align: center; }
.price-inputs { display: grid; grid-template-columns: 1fr 1fr; }
.price-main { min-width: 0; }
.publish-dock {
  padding: 8px 16px 10px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 12px 8px;
  padding: 10px 12px 10px 16px;
  background: #241c16;
  color: #f4efe4;
  border-radius: 18px;
}
.dock b { font-family: var(--num); font-size: 20px; font-weight: 560; }
.tabbar {
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 11px;
  padding: 4px 0;
}
.tabbar button.on { color: var(--seal); }
.tabbar svg { width: 22px; height: 22px; }
.tabbar .dot {
  font-style: normal;
  background: var(--seal);
  color: white;
  border-radius: 99px;
  padding: 0 5px;
  margin-left: 3px;
}
.mask {
  position: absolute;
  inset: 0;
  background: rgba(28, 22, 16, 0.46);
  display: flex;
  align-items: flex-end;
  z-index: 6;
}
.sheet {
  width: 100%;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 16px 16px 22px;
  max-height: 92%;
  overflow: auto;
}
.sheet h2 { font-size: 24px; }
.lines, .cart-list { list-style: none; padding: 0; margin: 8px 0; }
.lines li, .cart-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.cart-list small { display: block; color: var(--ink-soft); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
}
.wx-label { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; margin: 0; }
.wx-label span {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #07c160;
  color: white;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.pay-to { text-align: center; margin: 8px 0 0; }
.pay-amount { text-align: center; font-family: var(--num); font-size: 48px; margin: 4px 0 8px; line-height: 1; }
.pay-amount small { font-size: 22px; }
.paydots { display: flex; justify-content: center; gap: 10px; margin: 8px 0; }
.paydots i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--ink); display: block; }
.paydots i.on { background: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.keypad button, .keypad span { height: 48px; }
.keypad button { border: 0; border-radius: 12px; background: #f3eadc; font-family: var(--num); font-size: 22px; }
.pickup { text-align: center; margin: 8px 0; }
.pickup span { display: block; letter-spacing: 0.2em; font-size: 12px; color: var(--ink-soft); }
.pickup strong { font-family: var(--num); font-size: 64px; font-weight: 560; letter-spacing: 0.08em; line-height: 1; }
.ok { text-align: center; color: var(--leaf); letter-spacing: 0.22em; margin: 0; }
.order { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.order-hit { width: 100%; text-align: left; border: 0; background: transparent; padding: 0; display: grid; gap: 6px; }
.code-line { margin: 0; font-family: var(--num); letter-spacing: 0.12em; }
.me { display: grid; justify-items: center; gap: 8px; padding-top: 18px; }
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 28px;
}
.role { letter-spacing: 0.16em; font-size: 12px; color: var(--seal); margin: 0; }
.me label, .me .btn, .stats.mini { width: 100%; }
.stats.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.stats.mini div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 8px; text-align: center; }
.stats.mini b { display: block; font-family: var(--num); font-size: 18px; }
.stats.mini span { color: var(--ink-soft); font-size: 12px; }

body.desk { background: #efe6d4; }
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: start;
  gap: 12px;
}
.login-card h1 { font-size: 40px; }
.login-card label, .login-card .btn { width: 100%; }
.admin-shell { min-height: 100dvh; display: grid; grid-template-columns: 232px 1fr; }
.sider {
  background: #241c16;
  color: #f4efe4;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 8px; }
.brand small { display: block; color: rgba(244, 239, 228, 0.62); letter-spacing: 0.14em; }
.sider nav { display: grid; gap: 4px; }
.sider button { text-align: left; background: transparent; color: inherit; border: 0; border-radius: 12px; padding: 10px 12px; }
.sider button.on { background: rgba(244, 239, 228, 0.12); }
.main { padding: 28px 32px 64px; max-width: 1100px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.topbar h1 { font-size: 34px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.stat span { color: var(--ink-soft); font-size: 13px; }
.stat b { display: block; margin-top: 8px; font-family: var(--num); font-size: 30px; font-weight: 560; }
.stat small { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 12px; }
.sheet label { margin-top: 10px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.choice button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 14px;
  padding: 10px 8px;
  line-height: 1.3;
}
.choice button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.choice small { display: block; font-size: 12px; opacity: 0.72; }
.addr {
  margin: 8px 0;
  padding: 10px 12px;
  background: rgba(255, 250, 243, 0.9);
  border-radius: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.thumbs { display: flex; gap: 8px; overflow: auto; padding: 8px 0; }
.thumbs figure { position: relative; margin: 0; flex: none; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; background: #efe6d8; display: block; }
.thumbs .x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 99px;
  background: rgba(36, 28, 22, 0.72);
  color: #fffaf3;
  line-height: 1;
}
.gallery { display: flex; gap: 8px; overflow: auto; margin: 8px 0 12px; }
.gallery img { width: min(100%, 280px); height: 220px; object-fit: cover; border-radius: 16px; flex: none; background: #efe6d8; }
.marks { margin-top: 8px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; margin-top: 16px; }
.bars { height: 180px; display: flex; align-items: stretch; gap: 10px; margin-top: 16px; }
.bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.bar i { display: block; width: 100%; height: var(--h); background: var(--seal); border-radius: 8px 8px 2px 2px; }
.bar em, .bar span { font-style: normal; font-size: 11px; color: var(--ink-soft); }
.bar em { font-family: var(--num); margin-bottom: 6px; }
.bar span { margin-top: 6px; }
.rank { display: grid; gap: 8px; margin-top: 12px; }
.rank div { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--ink-soft); font-size: 12px; letter-spacing: 0.06em; padding: 8px; }
td { border-top: 1px solid var(--line); padding: 12px 8px; vertical-align: middle; }
td.num, th.num { text-align: right; font-family: var(--num); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wide { grid-column: 1 / -1; }
.marks { display: flex; flex-wrap: wrap; gap: 8px; }
.markpick {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0;
  display: grid;
  place-items: center;
}
.markpick svg { width: 40px; height: 40px; }
.markpick.on { border-color: var(--seal); box-shadow: inset 0 0 0 1px var(--seal); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.keybox { font-family: var(--num); font-size: 28px; letter-spacing: 0.08em; margin: 4px 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 860px) {
  .poster { grid-template-columns: 1fr; min-height: auto; }
  .stats, .split, .form-grid { grid-template-columns: 1fr 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .sider { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sider nav { display: flex; flex-wrap: wrap; }
  .main { padding: 20px 16px 48px; }
}
@media (max-width: 720px) {
  body.mp { background: var(--paper); }
  .stage { padding: 0; }
  .phone { width: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .phone::before, .statusfake { display: none; }
  .stats, .form-grid, .split { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
