:root {
  --bg: #f3efe6;
  --ink: #1c1917;
  --muted: #78716c;
  --accent: #b45309;
  --card: #fffdf8;
  --line: #e7e0d4;
  --ok: #15803d;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #fde68a55, transparent 40%),
    radial-gradient(circle at 90% 10%, #fdba7455, transparent 35%),
    var(--bg);
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 14px 10px;
}
.top h1 { margin: 0; font-size: 1.25rem; }
.muted { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.cart-btn, .primary, .ghost, .link, .tab, .ghost-pill {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ghost-pill {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  white-space: nowrap;
}
.cart-btn {
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  position: relative;
}
.badge {
  position: absolute;
  top: -6px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.badge.hidden, .hidden { display: none !important; }
.gate {
  margin: 20px 14px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
}
.shop {
  display: grid;
  grid-template-columns: 88px 1fr;
  height: calc(100vh - 78px);
  border-top: 1px solid var(--line);
  background: var(--card);
}
.cats {
  overflow-y: auto;
  background: #f8f4ec;
  border-right: 1px solid var(--line);
}
.cat {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 14px 8px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  border-left: 3px solid transparent;
}
.cat.active {
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  border-left-color: var(--accent);
}
.goods {
  overflow-y: auto;
  padding: 10px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  align-items: stretch;
  position: relative;
}
.card-body { min-width: 0; }
.card-add {
  align-self: end;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.card-add:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.card-qty-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #f5f5f4;
}
.thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}
.name { font-weight: 700; font-size: 0.95rem; margin: 0 0 4px; }
.meta { margin: 0; color: var(--muted); font-size: 0.78rem; }
.price { color: var(--danger); font-weight: 700; margin-top: 6px; }
.sheet { position: fixed; inset: 0; z-index: 45; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 14px 16px 20px;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-hd {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: start;
}
.sheet-cover {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #f5f5f4;
}
.sheet-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}
.sheet-close {
  border: 0;
  background: #f5f5f4;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.spec-list {
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.spec-row.soldout { opacity: 0.5; }
.spec-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.spec-qty {
  display: flex;
  align-items: center;
  gap: 10px;
}
.spec-qty button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
}
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-mask { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.drawer-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: 18px 18px 0 0;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.drawer-hd, .drawer-ft {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer-ft { border-bottom: 0; border-top: 1px solid var(--line); }
.cart-list { overflow-y: auto; padding: 8px 16px; flex: 1; }
.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.cart-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #f5f5f4;
  flex-shrink: 0;
}
.cart-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
}
.cart-info { flex: 1; min-width: 0; }
.link { background: transparent; color: var(--accent); }
.primary {
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
}
.primary.block, .ghost.block { width: 100%; }
.ghost {
  background: #f5f5f4;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 18px;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(28,25,23,.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 18px;
}
.modal-card h2 { margin: 0 0 12px; font-size: 1.15rem; }
.modal-card label { display: block; margin: 10px 0 6px; font-size: 0.86rem; }
.modal-card input[type=tel],
.modal-card input[type=text],
.modal-card input[type=file] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.modal-actions .primary, .modal-actions .ghost { flex: 1; }
.tabs { display: flex; gap: 8px; margin: 12px 0; }
.tab {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: #f5f5f4;
}
.tab.active { background: #fff7ed; color: var(--accent); font-weight: 700; }
.pay-box {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafaf9;
  border-radius: 12px;
  margin-bottom: 12px;
}
.pay-box img { max-width: 100%; max-height: 280px; }
.amount { font-size: 1.4rem; font-weight: 800; color: var(--danger); margin: 8px 0; }
.pay-timer {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.pay-timer.warn { color: var(--danger); }
.tip-sm { margin: -4px 0 12px; font-size: 0.8rem; }
.pay-actions { margin-top: 12px; }
.tip-modal {
  align-items: center;
  z-index: 80;
}
.tip-card {
  text-align: center;
}
.tip-card h2 {
  margin-bottom: 10px;
  color: var(--accent);
}
.tip-message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.status-page {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  overflow-y: auto;
  padding: 24px 16px;
}
.status-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 18px;
  padding: 22px;
  border: 1px solid var(--line);
}
.status-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.status-actions .ghost,
.status-actions .primary {
  flex: 1;
  border-radius: 12px;
  padding: 12px 10px;
}
.status-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff7ed;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.status-icon.ready { background: #dcfce7; color: var(--ok); }
.pickup {
  background: #ecfdf5;
  color: var(--ok);
  padding: 12px;
  border-radius: 12px;
  font-size: 1.1rem;
}
.st-items { padding-left: 18px; color: var(--muted); }
.mine-card { max-height: 85vh; overflow-y: auto; }
.mine-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.mine-item {
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.mine-item:active { background: #f8f4ec; }
.mine-item .row1 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
}
.mine-item .row2 {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}
.mine-empty { color: var(--muted); text-align: center; padding: 16px 0; }
@media (min-width: 860px) {
  .shop { grid-template-columns: 140px 1fr; max-width: 960px; margin: 0 auto; height: calc(100vh - 90px); border-radius: 16px; overflow: hidden; }
  .goods { grid-template-columns: repeat(2, 1fr); }
  .modal { align-items: center; }
}
