:root {
  --paper: #f6f1e6;
  --card: #fffdf8;
  --ink: #241d16;
  --ink2: #6b5c4b;
  --ink3: #9a8b76;
  --line: #e7dbc4;
  --accent: #b3382c;
  --gold: #8a6b3f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html, body { overflow-x: hidden; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 680px; margin: 0 auto; min-height: 100vh; padding-bottom: 82px; position: relative; }

/* 头部 */
.hero { padding: 26px 20px 4px; }
.kicker { font-size: 11px; letter-spacing: .32em; color: var(--gold); margin: 0 0 6px; }
.hero h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; letter-spacing: .02em; }
.sub { font-size: 12.5px; color: var(--ink2); margin: 0; }
.searchwrap { position: relative; padding: 14px 0 6px; }
#search {
  width: 100%; border: 1px solid #e0d3ba; background: var(--card);
  border-radius: 999px; padding: 11px 44px 11px 16px; font-size: 14px;
  outline: none; color: var(--ink); -webkit-appearance: none;
}
#search:focus { border-color: var(--accent); }
.clear {
  position: absolute; right: 8px; top: 20px; border: 0; background: none;
  color: var(--ink3); font-size: 15px; padding: 8px; cursor: pointer;
}

/* 左侧分类栏 */
.menu-wrap { display: flex; align-items: flex-start; }
.rail {
  flex: 0 0 92px; width: 92px; position: sticky; top: 0; align-self: flex-start;
  min-height: calc(100vh - 150px); padding: 8px 0 96px;
  background: #f1ebdf; border-right: 1px solid var(--line);
}
.menu-wrap.searching .rail { display: none; }
.rail-item {
  position: relative; padding: 15px 6px; text-align: center;
  font-size: 13.5px; color: var(--ink2); cursor: pointer; line-height: 1.25;
  transition: .12s;
}
.rail-item.on {
  background: var(--paper); color: var(--ink); font-weight: 700;
  border-radius: 0 10px 10px 0;
}
.rail-item.on::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.rail-count { display: block; font-size: 10.5px; color: var(--ink3); font-weight: 400; margin-top: 3px; }
.rail-item.on .rail-count { color: var(--accent); }

/* 右边窄列里的菜品卡片压缩一点 */
.menu-wrap .list { flex: 1; min-width: 0; padding: 8px 10px 24px; }
.menu-wrap .row { padding: 9px; gap: 10px; }
.menu-wrap .thumb { width: 66px; height: 66px; border-radius: 9px; }
.menu-wrap .name { font-size: 14px; }
.menu-wrap .tagline { font-size: 11.5px; }
.menu-wrap .pill { font-size: 10px; padding: 1px 5px; }
.menu-wrap .add { width: 27px; height: 27px; font-size: 18px; }
.menu-wrap .empty { padding: 40px 10px; font-size: 12.5px; }

/* 列表 */
.list { padding: 8px 14px 20px; }
.row {
  display: flex; gap: 12px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px;
  margin: 10px 0; cursor: pointer; transition: .15s;
}
.row:active { transform: scale(.995); }
.thumb {
  width: 78px; height: 78px; border-radius: 11px; overflow: hidden; flex: 0 0 auto;
  background: #efe7d8; display: flex; align-items: center; justify-content: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { font-size: 26px; color: #c8b79c; }
.body { flex: 1; min-width: 0; }
.name { font-size: 15px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tagline { font-size: 12px; color: var(--ink3); margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.pill {
  font-size: 10.5px; color: var(--ink2); background: #f2ead9; border-radius: 5px;
  padding: 1px 6px; white-space: nowrap;
}
.pill.hit { background: #fbe6e2; color: var(--accent); font-weight: 600; }
.act { display: flex; align-items: center; padding-left: 4px; }
.add {
  width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--ink);
  color: #fff; font-size: 20px; line-height: 1; cursor: pointer; padding: 0;
}
.empty { padding: 50px 20px; text-align: center; color: var(--ink3); font-size: 13px; }

/* 底部 */
.cartbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 74px;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 22px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(36, 29, 22, .28);
  cursor: pointer; z-index: 30; font-size: 14px; font-weight: 600;
}
.cart-count {
  background: var(--accent); border-radius: 999px; min-width: 20px; height: 20px;
  font-size: 12px; line-height: 20px; text-align: center; padding: 0 6px;
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 62px;
  background: rgba(255, 253, 248, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); display: flex; z-index: 40;
}
.tab {
  flex: 1; border: 0; background: none; color: var(--ink3); font-size: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; padding: 0;
}
.tab .ico { font-size: 19px; }
.tab.on { color: var(--ink); font-weight: 600; }
.tab .ico { position: relative; }
.tb-badge {
  position: absolute; top: -4px; right: -12px; min-width: 16px; height: 16px;
  background: var(--accent); color: #fff; border-radius: 999px; font-size: 10px;
  line-height: 16px; text-align: center; padding: 0 4px; font-weight: 600;
}
.order.fresh { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(179, 56, 44, .12); }

/* 遮罩 & 面板 */
.mask { position: fixed; inset: 0; background: rgba(36, 29, 22, .42); z-index: 50; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--paper); border-radius: 20px 20px 0 0; max-height: 88vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(18px + env(safe-area-inset-bottom));
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.sheet-title { font-size: 17px; font-weight: 700; margin: 0; }
.close { border: 0; background: none; font-size: 20px; color: var(--ink3); cursor: pointer; padding: 4px 8px; }
.sheet-hero { width: 100%; height: 200px; object-fit: cover; display: block; background: #efe7d8; }
.sheet-body { padding: 16px 18px; }
.meta { font-size: 12px; color: var(--ink3); margin-top: 4px; }
.section-title {
  font-size: 14px; font-weight: 700; margin: 20px 0 8px; padding-left: 9px;
  border-left: 3px solid var(--accent); line-height: 1.1;
}
.ing { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #e7dbc4; font-size: 13.5px; }
.ing:last-child { border-bottom: 0; }
.ing b { font-weight: 500; }
.ing span { color: var(--ink2); }
.step { display: flex; gap: 10px; padding: 7px 0; font-size: 13.5px; line-height: 1.7; }
.step i {
  flex: 0 0 auto; width: 19px; height: 19px; border-radius: 50%; background: var(--ink);
  color: #fff; font-size: 11px; font-style: normal; text-align: center; line-height: 19px; margin-top: 3px;
}
.tips { background: #fffaf0; border: 1px solid #f0e3c6; border-radius: 10px; padding: 12px; font-size: 13px; color: var(--ink2); margin-top: 14px; }
.btn {
  display: block; width: 100%; border: 0; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: 15px; font-weight: 600; padding: 13px; cursor: pointer; margin-top: 16px;
}
.btn[disabled] { opacity: .4; }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.field { margin-top: 12px; }
.field label { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  padding: 10px 12px; font-size: 14px; color: var(--ink); font-family: inherit; outline: none;
}
.field textarea { min-height: 62px; resize: vertical; }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--ink2);
  border-radius: 10px; padding: 9px; font-size: 13.5px; cursor: pointer;
}
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 订单 */
.order { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; margin: 10px 0; }
.order-top { display: flex; justify-content: space-between; align-items: center; }
.order-time { font-size: 12px; color: var(--ink3); }
.status { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: #f2ead9; color: var(--ink2); }
.status.pending { background: #fdf0dc; color: #a96a00; }
.status.cooking { background: #e6eefb; color: #1f5fb0; }
.status.done { background: #e7f4ea; color: #1f7a45; }
.order-items { font-size: 14px; font-weight: 600; margin: 8px 0 0; }
.order-note { font-size: 12.5px; color: var(--ink2); margin-top: 5px; }
.order-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #f2ead9; }
.mini {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  font-size: 12.5px; padding: 6px 15px; color: var(--ink); cursor: pointer;
}
.mini.danger { color: var(--accent); border-color: #f0d5cf; }
.kitchenbar { padding: 12px 20px; font-size: 12.5px; color: var(--ink2); }
.kitchen-tools { padding: 0 20px 8px; }
.kitchen-tools .mini { margin-right: 8px; }
.sheet-body code {
  background: #f2ead9; border-radius: 4px; padding: 1px 5px; font-size: 11.5px;
  word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.kitchenbar input {
  width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; background: var(--card); outline: none;
}
.toast {
  position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%);
  background: rgba(36, 29, 22, .9); color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 13px; z-index: 90; animation: up .18s ease-out;
}

/* 口令门 */
.gate {
  position: fixed; inset: 0; z-index: 200; background: var(--paper);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.gate-box { width: 100%; max-width: 360px; }
.gate-box h1 { font-size: 30px; margin: 4px 0 8px; }
.gate-input {
  width: 100%; margin-top: 18px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); padding: 14px 16px; font-size: 22px; letter-spacing: 8px;
  text-align: center; outline: none; color: var(--ink);
}
.gate-input:focus { border-color: var(--accent); }
.gate-err { color: var(--accent); font-size: 12.5px; min-height: 18px; margin: 8px 0 0; }
.gate .btn { margin-top: 10px; }
.gate .btn.ghost { margin-top: 12px; font-size: 13px; padding: 11px; }

/* 菜品配图 */
.dishpick { display: flex; flex-wrap: wrap; margin: 8px -5px 0; }
.dp-item { width: calc(33.333% - 10px); margin: 5px; cursor: pointer; }
.dp-thumb {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  background: #efe7d8; display: flex; align-items: center; justify-content: center;
}
.dp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-thumb span { font-size: 20px; color: #c8b79c; }
.dp-name {
  font-size: 11.5px; color: var(--ink2); margin-top: 4px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.preview {
  width: 100%; height: 180px; margin-top: 12px; border-radius: 12px; overflow: hidden;
  background: #efe7d8; display: flex; align-items: center; justify-content: center;
  color: var(--ink3); font-size: 13px;
}
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 收藏星标 */
.star {
  border: 0; background: none; font-size: 18px; line-height: 1; padding: 6px 4px;
  color: #c9bfae; cursor: pointer;
}
.star.on { color: #e0a300; }
.rail-item.fav { color: #b3382c; font-weight: 600; }

/* 编辑表单 */
.sel {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  padding: 10px 12px; font-size: 14px; color: var(--ink);
}
.dybox { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }