* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --ink: #111;
  --ink-soft: #333;
  --muted: #999;
  --line: #eee;
  --bg: #f6f6f7;
  --brand: #e8501e;
  --brand-soft: #fff1eb;
  --card: #fff;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(0,0,0,.06);
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  padding-bottom: 78px;
  overflow-x: hidden;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shop-logo {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: #fff2; border-radius: 12px; font-size: 22px;
}
.shop-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.shop-sub { font-size: 11px; color: #ffffffa8; margin-top: 1px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.table-btn {
  background: #fff2; color: #fff; border: none; border-radius: 20px;
  padding: 7px 12px; font-size: 12.5px; cursor: pointer;
}
.table-btn b { color: #ffd24a; }
.phone-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff2; color: #fff; text-decoration: none; font-size: 15px;
}

.spicy-row { display: flex; align-items: center; gap: 10px; padding: 12px 2px 12px; }
.spicy-label { font-size: 12px; color: #ffffff9c; }
.spicy-group { display: flex; gap: 6px; }
.spicy-group button {
  background: #ffffff1f; color: #ffffffc9; border: none;
  border-radius: 20px; padding: 5px 14px; font-size: 12.5px; cursor: pointer;
  transition: .18s;
}
.spicy-group button.on { background: var(--brand); color: #fff; font-weight: 600; }

/* ---------- 布局 ---------- */
.layout { display: flex; align-items: flex-start; }

.cats {
  width: 84px; flex: none;
  position: sticky; top: 122px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  background: #ececee;
  padding: 6px 0;
}
.cats::-webkit-scrollbar { width: 0; }
.cat {
  display: block; width: 100%; text-align: center;
  background: none; border: none; cursor: pointer;
  padding: 14px 4px; font-size: 13px; color: var(--ink-soft);
  position: relative; line-height: 1.25;
}
.cat .cat-icon { display: block; font-size: 17px; margin-bottom: 3px; opacity: .8; }
.cat.on { background: #fff; font-weight: 700; color: var(--ink); }
.cat.on::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; background: var(--brand); border-radius: 0 4px 4px 0;
}

.dishes { flex: 1; min-width: 0; padding: 10px 12px 8px; background: #fff; }
.cat-head {
  font-size: 13px; font-weight: 700; color: var(--ink);
  padding: 12px 2px 8px; display: flex; align-items: center; gap: 6px;
}
.cat-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 菜品卡片 ---------- */
.dish {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.dish:last-child { border-bottom: none; }
.dish-img {
  width: 96px; height: 96px; flex: none;
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #fafafa, #eee);
  position: relative;
}
.dish-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dish-img .ph {
  position: absolute; inset: 0;
  display: grid; place-items: center; font-size: 30px; color: #cfcfcf;
}
.dish-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish-name { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.dish-desc { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.dish-bottom { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; }
.dish-price { color: var(--brand); font-weight: 700; font-size: 17px; }
.dish-price small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.dish-price .yen { font-size: 12px; }

/* 加减控件 */
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--brand); background: #fff; color: var(--brand);
  font-size: 17px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding: 0; transition: .15s;
}
.stepper button.plus { background: var(--brand); color: #fff; }
.stepper button:active { transform: scale(.9); }
.stepper .qty { min-width: 18px; text-align: center; font-size: 14px; font-weight: 600; }

/* ---------- 底部购物车 ---------- */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: 60px; background: #1c1c1c; color: #fff;
  display: flex; align-items: center;
  padding-left: 14px;
  box-shadow: 0 -2px 14px rgba(0,0,0,.25);
}
.cart-left { flex: 1; display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; }
.cart-icon { position: relative; font-size: 24px; }
.badge {
  position: absolute; top: -6px; right: -10px;
  background: var(--brand); color: #fff;
  font-size: 11px; font-style: normal; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: grid; place-items: center; padding: 0 5px;
}
.cart-icon .badge.hide { display: none; }
.cart-total { font-size: 13px; }
.cart-total b { font-size: 20px; font-weight: 700; }
.cart-hint { font-size: 11.5px; color: #ffffff80; }
.cart-submit {
  height: 100%; width: 118px; border: none; cursor: pointer;
  background: #4a4a4a; color: #ffffff9c; font-size: 16px; font-weight: 600;
}
.cart-submit.on { background: var(--brand); color: #fff; }

/* ---------- 抽屉 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50;
  opacity: 0; pointer-events: none; transition: .25s;
}
.mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #fff; border-radius: 18px 18px 0 0;
  transform: translateY(102%); transition: .28s cubic-bezier(.4,0,.2,1);
  max-height: 72vh; display: flex; flex-direction: column;
}
.drawer.show { transform: translateY(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
}
.drawer-title { font-size: 16px; font-weight: 700; }
.drawer-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.drawer-sub b { color: var(--brand); }
.clear-btn { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.drawer-body { overflow-y: auto; padding: 6px 18px; flex: 1; }
.drawer-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.drawer-item .di-name { flex: 1; font-size: 14.5px; }
.drawer-item .di-price { font-size: 12.5px; color: var(--muted); margin-left: 6px; }
.drawer-item .di-sum { width: 58px; text-align: right; font-weight: 700; color: var(--brand); font-size: 14px; }
.drawer-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; }
.drawer-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.foot-total { font-size: 14px; }
.foot-total b { font-size: 22px; color: var(--brand); }
.checkout {
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  border-radius: 24px; padding: 12px 34px; font-size: 15.5px; font-weight: 600;
}

/* ---------- 小票 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal.show { display: flex; }
.receipt {
  background: #fff; width: 100%; max-width: 340px;
  border-radius: 16px; padding: 24px 22px;
  font-family: "SF Mono", Consolas, monospace;
  animation: pop .3s cubic-bezier(.3,1.4,.5,1);
  max-height: 86vh; overflow-y: auto;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rc-title { text-align: center; font-size: 18px; font-weight: 700; letter-spacing: 2px; }
.rc-shop { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.rc-dash { border-top: 1px dashed #ccc; margin: 14px 0; }
.rc-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.rc-row .rc-r { color: var(--ink-soft); }
.rc-item { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.rc-item .rc-n { flex: 1; }
.rc-total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; margin-top: 6px; }
.rc-total .rc-r { color: var(--brand); font-size: 19px; }
.rc-tip { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 16px; line-height: 1.7; }
.rc-close {
  display: block; width: 100%; margin-top: 18px;
  background: var(--ink); color: #fff; border: none; cursor: pointer;
  border-radius: 24px; padding: 12px; font-size: 15px; font-weight: 600;
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.82); color: #fff; font-size: 13.5px;
  padding: 10px 18px; border-radius: 22px; z-index: 90;
  opacity: 0; transition: .25s; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 640px) {
  body { max-width: 480px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,.1); background: #fff; }
  .cartbar { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .drawer { max-width: 480px; left: 50%; transform: translateX(-50%) translateY(102%); }
  .drawer.show { transform: translateX(-50%) translateY(0); }
  .cats { top: 122px; }
  .mask.show { }
}


/* ---------- 必选项（餐具） ---------- */
.req-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 10.5px; font-weight: 600; line-height: 1.5;
  color: #fff; background: var(--brand); border-radius: 4px;
  vertical-align: middle;
}
.stepper .req-qty { font-size: 12px; color: var(--brand); font-weight: 600; }
.dish-req-hint { font-size: 11px; color: var(--brand); margin-top: 5px; }
.drawer-item.req { background: var(--brand-soft); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 8px; }
