* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #ff7a00;
  --primary-dark: #e56a00;
  --yellow: #ffc53d;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a919f;
  --line: #eceef1;
  --green: #00b578;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--text); }
img { display: block; }

.wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }

/* 顶部 */
.topbar {
  background: linear-gradient(135deg, #ff9a2e, #ff7a00);
  color: #fff;
  padding: 22px 16px 14px;
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 8px rgba(255, 122, 0, .25);
}
.topbar .shop { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.topbar .sub { font-size: 12px; opacity: .9; margin-top: 4px; }

/* 分类 */
.cats { display: flex; overflow-x: auto; gap: 8px; padding: 12px 16px; background: var(--card); position: sticky; top: 66px; z-index: 15; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; background: #f1f3f5; color: #4b5563; font-size: 13px; }
.cat.on { background: var(--primary); color: #fff; font-weight: 600; }

/* 菜品列表 */
.dish-list { padding: 12px 12px 96px; }
.dish {
  background: var(--card); border-radius: 14px; padding: 12px;
  display: flex; gap: 12px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.dish .thumb {
  width: 96px; height: 96px; border-radius: 10px; object-fit: cover; flex: 0 0 auto;
  background: #f1f3f5;
}
.dish .thumb.placeholder { display: flex; align-items: center; justify-content: center; font-size: 40px; color: #c6ccd6; }
.dish .info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dish .name { font-size: 16px; font-weight: 600; }
.dish .kiss { color: var(--primary); font-weight: 700; font-size: 14px; margin: 4px 0; }
.dish .kiss .unit { font-size: 12px; }
.dish .desc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }

/* 加减数量 */
.stepper { display: flex; align-items: center; gap: 10px; }
.step-btn {
  width: 26px; height: 26px; border-radius: 50%; font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center; color: #fff; background: var(--primary);
}
.step-btn.minus { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.stepper .qty { min-width: 18px; text-align: center; font-weight: 700; font-size: 15px; }

/* 底部购物车 */
.cartbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px;
  background: #1f2329; color: #fff; display: flex; align-items: center;
  padding: 10px 14px; z-index: 30;
}
.cartbar .cart-icon { position: relative; width: 46px; height: 46px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; flex: 0 0 auto; }
.cartbar .badge {
  position: absolute; top: -4px; right: -4px; background: #ff4d4f; color: #fff;
  border-radius: 999px; min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; text-align: center; padding: 0 5px;
}
.cartbar .sum { flex: 1; padding: 0 12px; }
.cartbar .sum .total { font-size: 17px; font-weight: 700; color: var(--yellow); }
.cartbar .sum .hint { font-size: 11px; color: #9aa1ab; margin-top: 2px; }
.cartbar .submit { background: var(--primary); color: #fff; font-size: 16px; font-weight: 600; padding: 12px 22px; border-radius: 999px; }
.cartbar .submit.disabled { background: #3a4049; color: #7a818d; }

/* 下单弹层 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: none; }
.mask.show { display: block; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px;
  background: #fff; border-radius: 18px 18px 0 0; z-index: 50; padding: 18px 16px 26px; display: none;
}
.sheet.show { display: block; }
.sheet .title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.sheet .items { max-height: 32vh; overflow-y: auto; margin-bottom: 12px; }
.sheet .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; color: #4b5563; border-bottom: 1px dashed var(--line); }
.sheet .row .right { color: var(--primary); font-weight: 600; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fafbfc;
}
.field textarea { resize: none; height: 72px; }
.sheet .confirm { width: 100%; background: var(--primary); color: #fff; font-size: 17px; font-weight: 700; padding: 13px; border-radius: 12px; }

.toast {
  position: fixed; top: 46%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 12px 20px; border-radius: 10px; z-index: 99; display: none; font-size: 15px;
}
.toast.show { display: block; }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .emoji { font-size: 46px; }
