/* Lantern Eats — warm paper, lantern red, ink. System fonts only (no external CDNs). */
:root {
  --paper: #fbf6ee;
  --card: #ffffff;
  --ink: #2b211b;
  --muted: #7a6a5d;
  --line: #eadfce;
  --red: #b3261e;
  --red-ink: #8c1d17;
  --gold: #e0a526;
  --jade: #2f7d5b;
  --sky: #2c6e9b;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 14px rgba(60, 40, 20, .06);
  --r: 14px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--red); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
.pad { padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 10px 16px; background: rgba(251, 246, 238, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: .5px; white-space: nowrap; }
.lantern { width: 18px; height: 22px; border-radius: 45%; background: var(--red); position: relative; box-shadow: inset 0 -3px 0 var(--red-ink); }
.lantern::before, .lantern::after { content: ""; position: absolute; left: 3px; right: 3px; height: 3px; background: var(--gold); border-radius: 2px; }
.lantern::before { top: -2px; } .lantern::after { bottom: -2px; }
.nav { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.nav a, .nav button { padding: 6px 10px; border-radius: 999px; color: var(--ink); background: none; border: 0; cursor: pointer; white-space: nowrap; font-size: 14px; }
.nav a.active { background: var(--ink); color: #fff; }
.nav .cart-pill { background: var(--red); color: #fff; font-weight: 700; }

.app { max-width: 1040px; margin: 0 auto; padding: 16px 16px 120px; outline: none; }
h1 { font-size: 24px; margin: 4px 0 12px; line-height: 1.25; }
h2 { font-size: 18px; margin: 20px 0 10px; }
h3 { font-size: 16px; margin: 0 0 6px; }

.hero { background: var(--red); color: #fff; border-radius: 20px; padding: 20px; margin-bottom: 16px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; border: 22px solid rgba(224, 165, 38, .35); }
.hero h1 { color: #fff; margin: 0 0 4px; font-size: 26px; }
.hero p { margin: 0 0 14px; opacity: .9; }
.addr-row { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.addr-row input { flex: 1 1 220px; min-width: 0; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: thin; }
.chip { border: 1px solid var(--line); background: var(--card); padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; font-size: 14px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.rcard { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); }
.rcard.dim { opacity: .55; }
.emoji { font-size: 30px; width: 54px; height: 54px; flex: none; display: grid; place-items: center; background: #fff3e0; border-radius: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #f3ece2; color: var(--ink); white-space: nowrap; }
.badge.ok { background: #e3f2ea; color: var(--jade); }
.badge.warn { background: #fdecea; color: var(--red-ink); }
.badge.info { background: #e6f0f7; color: var(--sky); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 10px 16px; cursor: pointer;
  background: var(--red); color: #fff; font-weight: 700; min-height: 42px; }
.btn:hover { background: var(--red-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn.ghost:hover { background: #f3ece2; }
.btn.dark { background: var(--ink); }
.btn.jade { background: var(--jade); }
.btn.sm { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.hero .btn.ghost { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.6); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.24); }

input, select, textarea { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; min-height: 42px; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible { outline: 3px solid rgba(224, 165, 38, .55); outline-offset: 1px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: 14px; }
.check input { width: 18px; min-height: 18px; height: 18px; margin-top: 2px; flex: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.form { max-width: 460px; }

.menu-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.menu-head .emoji { width: 70px; height: 70px; font-size: 40px; }
.cat-tabs { position: sticky; top: 53px; z-index: 5; background: var(--paper); }
.item { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.item:last-child { border-bottom: 0; }
.item .name { font-weight: 700; }
.item .zh { color: var(--muted); font-size: 14px; }
.price { font-weight: 800; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 800; }

.cartbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 30; width: min(560px, calc(100% - 24px));
  display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #fff; padding: 10px 10px 10px 18px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }

.sum { width: 100%; border-collapse: collapse; }
.sum td { padding: 4px 0; }
.sum td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.sum tr.total td { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 800; font-size: 17px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li.done::before { background: var(--jade); }
.timeline li.now::before { background: var(--red); box-shadow: 0 0 0 4px rgba(179, 38, 30, .18); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.status-big { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.minimap { width: 100%; height: 180px; background: #f6efe3; border-radius: 12px; border: 1px solid var(--line); }

.cols { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.col h2 { margin-top: 4px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.kpi .v { font-size: 22px; font-weight: 800; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.notice { background: #fff6dd; border: 1px solid #f1dc9f; padding: 10px 12px; border-radius: 12px; font-size: 14px; margin: 10px 0; }
.toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
.toast.bad { background: var(--red-ink); }

@media (max-width: 520px) {
  .app { padding: 12px 12px 110px; }
  h1 { font-size: 21px; }
  .hero { padding: 16px; border-radius: 16px; }
  .hero h1 { font-size: 22px; }
  .brand { font-size: 16px; }
  .nav a, .nav button { padding: 6px 8px; font-size: 13px; }
  .cat-tabs { top: 49px; }
}
