:root {
  --blue: #2f7dff;
  --blue-dark: #1b5fe0;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #7b8494;
  --red: #e23c3c;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif; }
button, input, textarea, select { font: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f7f9fc; position: relative; padding-bottom: 78px; }
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; height: 48px; display: flex; align-items: center; justify-content: center; font-weight: 700; border-bottom: 1px solid #eef2f6; }
.page { display: none; }
.page.active { display: block; }

.hero { width: 100%; height: 168px; object-fit: cover; background: #d9e7ff; }
.store-card { background: #fff; margin: -22px 12px 12px; border-radius: 16px; padding: 14px; box-shadow: 0 8px 24px rgba(31, 76, 160, .08); position: relative; }
.store-name { font-size: 16px; font-weight: 700; }
.store-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.switch { position: absolute; right: 12px; top: 14px; color: var(--blue); font-size: 13px; }
.modes { display: flex; background: #eef3fb; border-radius: 999px; padding: 4px; margin-top: 12px; }
.modes button { flex: 1; border: 0; background: transparent; height: 32px; border-radius: 999px; color: #5b6573; }
.modes button.on { background: var(--blue); color: #fff; font-weight: 600; }
.search { margin: 0 12px 12px; background: #fff; border-radius: 12px; height: 40px; display: flex; align-items: center; padding: 0 12px; color: var(--muted); gap: 8px; }
.search input { border: 0; outline: none; flex: 1; background: transparent; }

.promo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 12px; }
.promo-card { border-radius: 14px; padding: 12px; color: #fff; min-height: 86px; }
.promo-card.a { background: linear-gradient(135deg, #1e5fff, #6ea2ff); }
.promo-card.b { background: linear-gradient(135deg, #16a34a, #86efac); color: #14532d; }
.promo-card h4 { margin: 0 0 6px; font-size: 14px; }
.promo-card p { margin: 0; font-size: 12px; opacity: .9; }

.section { padding: 16px 12px 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 10px; }
.section-title span { color: var(--muted); font-size: 12px; font-weight: 400; }
.hots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hot { text-align: center; }
.hot img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.hot .n { font-size: 12px; margin-top: 6px; }
.hot .p { color: var(--red); font-size: 12px; font-weight: 700; }
.old-list { display: grid; gap: 8px; }
.old-item { background: #fff; border-radius: 14px; padding: 10px; display: flex; gap: 10px; }
.old-item img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.old-item h4 { margin: 0 0 4px; font-size: 14px; }
.tag { display: inline-block; background: #e8f0ff; color: var(--blue); font-size: 10px; padding: 1px 6px; border-radius: 999px; }

.menu-wrap { display: flex; min-height: calc(100vh - 126px); }
.cats { width: 86px; background: #eef2f7; }
.cats button { width: 100%; border: 0; background: transparent; padding: 16px 8px; text-align: left; color: #5d6673; font-size: 13px; border-left: 3px solid transparent; }
.cats button.on { background: #fff; color: var(--blue); font-weight: 700; border-left-color: var(--blue); }
.plist { flex: 1; background: #fff; padding: 8px; }
.pitem { display: flex; gap: 10px; padding: 10px 6px; border-bottom: 1px solid #f1f4f8; }
.pitem img { width: 78px; height: 78px; border-radius: 12px; object-fit: cover; }
.pitem h4 { margin: 0 0 4px; font-size: 15px; }
.pitem .d { color: var(--muted); font-size: 12px; }
.price { margin-top: 6px; }
.price b { color: var(--red); }
.price s { color: #b8c0cc; margin-left: 6px; font-size: 12px; }
.add { margin-left: auto; align-self: flex-end; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 20px; line-height: 26px; }

.cartbar { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); width: min(456px, calc(100% - 24px)); background: #1f2430; color: #fff; border-radius: 999px; display: flex; align-items: center; padding: 8px 8px 8px 16px; z-index: 15; }
.cartbar .go { margin-left: auto; background: var(--blue); border: 0; color: #fff; height: 36px; padding: 0 16px; border-radius: 999px; }
.tabbar { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(480px, 100%); height: 64px; background: #fff; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #eef2f6; z-index: 20; }
.tabbar button { border: 0; background: transparent; color: #8b93a1; font-size: 11px; }
.tabbar button.on { color: var(--blue); font-weight: 700; }
.tabbar b { display: block; font-size: 18px; font-weight: 400; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: none; }
.sheet.show { display: block; }
.sheet .box { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(480px, 100%); background: #fff; border-radius: 18px 18px 0 0; padding: 16px; }
.specs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.specs button { border: 1px solid #dbe3ee; background: #fff; border-radius: 999px; padding: 6px 12px; }
.specs button.on { border-color: var(--blue); color: var(--blue); background: #eaf1ff; }
.primary { width: 100%; height: 44px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 700; }
.ghost { width: 100%; height: 40px; border: 1px solid #d7deea; background: #fff; border-radius: 12px; }

.card { background: #fff; margin: 12px; border-radius: 14px; padding: 14px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.order { margin: 12px; background: #fff; border-radius: 14px; padding: 14px; }
.status { color: var(--blue); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: #fff; border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; color: var(--blue); font-size: 18px; margin-top: 4px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #d7deea; background: #fff; }
.toast { position: fixed; left: 50%; top: 20%; transform: translateX(-50%); background: rgba(0,0,0,.78); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 80; display: none; }
input.field, textarea.field, select.field { width: 100%; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; background: #fff; }
.notice { background: #fff4e5; color: #9a5b00; margin: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
