/* ==========================================================
   粥粥和宇宇的温馨小馆 · v2 原型样式
   居家温馨 × 像素手作：切角像素边框、缝线虚线、木质与奶油色
   ========================================================== */

@font-face {
  font-family: "Fusion Pixel 12px";
  src: url("../fonts/fusion-pixel-12.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #3d2817;
  --ink-2: #5a3e2a;
  --cocoa: #7a5c44;
  --muted: #a08a72;
  --line: #ecd9c0;
  --paper: #fffbf3;
  --paper-2: #fbf1e3;
  --cream: #f6e8d3;
  --wall: #f9ead4;
  --wood: #d9a86a;
  --wood-2: #b7804f;
  --wood-3: #8c5a33;
  --tomato: #e05c4a;
  --tomato-2: #c24335;
  --honey: #f7b733;
  --honey-2: #d98f1f;
  --sage: #7aa85c;
  --sage-2: #5a8242;
  --berry: #f6b8c6;
  --berry-2: #d97a90;
  --sky: #cfeaf7;
  --shadow: rgba(61, 40, 23, 0.16);
  --grid:
    linear-gradient(rgba(140, 90, 51, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 90, 51, 0.07) 1px, transparent 1px);
  --px: "Fusion Pixel 12px", "Microsoft YaHei", "PingFang SC", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --topbar-h: 54px;
}

/* ---------- 基础 ---------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--cream);
  background-image: var(--grid);
  background-size: 24px 24px;
  min-height: 100vh;
  padding-top: var(--topbar-h);
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
canvas.pixel-art { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.px { font-family: var(--px); font-weight: 400; }

/* 切角像素边框：底色当描边，::before 缩进后当填充
   （.btn / .tag / .meta-chip 自带边框，不必再写 pf） */
.pf, .btn, .tag, .meta-chip {
  --c: 6px;
  --b: 2px;
  --fill: var(--paper);
  --frame: var(--ink);
  position: relative;
  isolation: isolate;
  background: var(--frame);
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
}
.pf::before, .btn::before, .tag::before, .meta-chip::before {
  content: "";
  position: absolute;
  inset: var(--b);
  z-index: -1;
  background: var(--fill);
  clip-path: polygon(calc(var(--c) - var(--b)) 0, calc(100% - var(--c) + var(--b)) 0, 100% calc(var(--c) - var(--b)), 100% calc(100% - var(--c) + var(--b)), calc(100% - var(--c) + var(--b)) 100%, calc(var(--c) - var(--b)) 100%, 0 calc(100% - var(--c) + var(--b)), 0 calc(var(--c) - var(--b)));
}
.lift { filter: drop-shadow(3px 3px 0 var(--shadow)); }

/* ---------- 按钮 / 标签 / 步进器 ---------- */

.btn {
  --c: 6px;
  --b: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 3px 16px;
  font-family: var(--px);
  font-size: 12px;
  letter-spacing: 1px;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  filter: drop-shadow(2px 2px 0 var(--shadow));
  transition: transform 0.06s, filter 0.06s;
}
.btn:active { transform: translate(1px, 2px); filter: drop-shadow(0 0 0 var(--shadow)); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-tomato { --fill: var(--tomato-2); color: #fff; }
.btn-honey { --fill: var(--honey); }
.btn-sage { --fill: var(--sage-2); color: #fff; }
.btn-paper { --fill: var(--paper); }
.btn-sm { height: 32px; padding: 2px 10px; --c: 5px; }
.btn-lg { height: 48px; padding: 3px 22px; }
.btn-block { width: 100%; }

.tag {
  --c: 4px;
  --b: 2px;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 1px 6px;
  font-family: var(--px);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  flex: none;
}
.tag-tomato { --fill: var(--tomato-2); color: #fff; }
.tag-honey { --fill: var(--honey); }
.tag-sage { --fill: var(--sage-2); color: #fff; }
.tag-paper { --fill: var(--paper-2); color: var(--cocoa); --frame: var(--cocoa); }

.qty { --qh: 40px; position: relative; width: calc(var(--qh) * 2.7); height: var(--qh); flex: none; }
.q-add {
  position: absolute;
  right: 0;
  top: 2px;
  width: calc(var(--qh) - 4px);
  height: calc(var(--qh) - 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  --fill: var(--tomato-2);
  color: #fff;
  filter: drop-shadow(2px 2px 0 var(--shadow));
}
.q-add:active { transform: translate(1px, 1px); filter: none; }
.q-group { position: absolute; right: 0; top: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 3px; }
.q-btn { width: calc(var(--qh) - 12px); height: calc(var(--qh) - 12px); display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid var(--ink); color: var(--ink); }
.q-btn:active { transform: translate(1px, 1px); }
.q-n { min-width: 18px; text-align: center; font-size: 12px; line-height: 1; }
.q-n.bump { animation: bump 0.22s steps(3); }
@keyframes bump { 50% { transform: translateY(-3px); } }

.ico { position: relative; width: 12px; height: 12px; display: inline-block; }
.ico::before, .ico::after { content: ""; position: absolute; background: currentColor; }
.ico::before { left: 0; top: 5px; width: 12px; height: 2px; }
.ico-plus::after { left: 5px; top: 0; width: 2px; height: 12px; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}
.topbar-in { max-width: 1120px; height: 100%; margin: 0 auto; padding: 0 12px 0 16px; display: flex; align-items: center; gap: 10px; }
.topbar-logo { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex: none; }
.topbar-name { font-size: 12px; letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cart-fab {
  position: relative;
  margin-left: auto;
  width: 44px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  --fill: var(--honey);
  flex: none;
}
.cart-fab-n {
  position: absolute;
  top: -9px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--px);
  font-size: 12px;
  line-height: 1;
  background: var(--tomato-2);
  color: #fff;
  border: 2px solid var(--ink);
}

/* 取餐跟踪小条（放在顶栏里） */
.track {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 2px 10px;
  --c: 5px;
  --b: 2px;
  --fill: var(--honey);
  font-family: var(--px);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  flex: none;
}
.track .dot { width: 8px; height: 8px; background: var(--ink); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* ---------- 店面横幅 ---------- */

.shop { position: relative; background: var(--wall); border-bottom: 3px solid var(--ink); }
.shop-in { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wall {
  position: relative;
  height: 232px;
  overflow: hidden;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0 2px, transparent 2px 18px);
}
.deco { position: absolute; display: block; }
.wall .win { left: 5%; top: 52px; z-index: 1; }
.wall .lamp { right: 7%; top: 0; z-index: 2; }
.lamp-glow {
  position: absolute;
  right: calc(7% - 60px);
  top: 96px;
  width: 210px;
  height: 150px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 214, 122, 0.62), rgba(255, 214, 122, 0));
  animation: glow 2.4s steps(2) infinite;
}
@keyframes glow { 50% { opacity: 0.72; } }
.wall .spark { z-index: 1; animation: blink 1.6s steps(1) infinite; }
.garland { position: absolute; left: 0; top: 6px; width: 100%; height: 36px; z-index: 2; pointer-events: none; }
.garland canvas { width: 100%; height: 100%; }

.sign { position: absolute; left: 50%; top: 34px; transform: translateX(-50%); z-index: 4; width: min(540px, 72%); text-align: center; }
.sign::before, .sign::after { content: ""; position: absolute; top: -20px; width: 2px; height: 22px; background: var(--ink); }
.sign::before { left: 15%; }
.sign::after { right: 15%; }
.plaque {
  --c: 8px;
  --b: 3px;
  --fill: linear-gradient(180deg, #e6b97d 0 62%, #d9a86a 62% 100%);
  padding: 12px 18px 14px;
  filter: drop-shadow(4px 5px 0 rgba(61, 40, 23, 0.22));
}
.shop-name { font-family: var(--px); font-weight: 400; font-size: 36px; line-height: 1.15; letter-spacing: 2px; color: #fff; text-shadow: 3px 3px 0 var(--ink); }
.shop-slogan { font-size: 12px; letter-spacing: 3px; color: var(--ink-2); margin-top: 4px; }
.shop-meta { margin-top: 10px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.status-chip, .meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 2px 10px;
  --c: 5px;
  --b: 2px;
  --fill: var(--paper);
  font-family: var(--px);
  font-size: 12px;
  line-height: 1;
}
.status-chip i { width: 8px; height: 8px; background: var(--sage-2); }
.status-chip.off i { background: var(--muted); }
.notice {
  margin: 10px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  height: 28px;
  padding: 2px 12px 2px 4px;
  --c: 5px;
  --b: 2px;
  --fill: var(--paper-2);
  font-size: 12px;
  color: var(--cocoa);
  text-align: left;
}
.notice-tag { height: 20px; padding: 1px 6px; background: var(--tomato-2); color: #fff; flex: none; }
.notice-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.shelf {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  height: 10px;
  z-index: 2;
  background: linear-gradient(180deg, #e6b97d 0 5px, var(--wood-2) 5px 10px);
  box-shadow: inset 0 -2px 0 var(--wood-3);
}
.shelf .it { position: absolute; bottom: 100%; z-index: 2; }
.wall .cat { right: 16%; bottom: 26px; z-index: 3; }
.floor {
  height: 22px;
  background:
    repeating-linear-gradient(90deg, rgba(61, 40, 23, 0.22) 0 2px, transparent 2px 72px),
    linear-gradient(#e2b67e, #cf9d61);
  border-top: 3px solid var(--wood-3);
}

/* ---------- 主体布局 ---------- */

.layout {
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 20px 48px;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.side { position: sticky; top: calc(var(--topbar-h) + 12px); display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - var(--topbar-h) - 24px); overflow: auto; scrollbar-width: thin; }

.cats { display: flex; gap: 8px; }
.cats-side { flex-direction: column; padding: 6px; }
.cats-bar {
  display: none;
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  margin: 0 -12px 4px;
  padding: 10px 12px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background-color: var(--cream);
  background-image: var(--grid);
  background-size: 24px 24px;
}
.cats-bar::-webkit-scrollbar { display: none; }
.chip {
  --c: 6px;
  --b: 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 2px 12px 2px 4px;
  font-family: var(--px);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  flex: none;
  transition: transform 0.06s;
}
.chip:active { transform: translate(1px, 1px); }
.chip .cnt { margin-left: auto; color: var(--muted); }
.chip.on { --fill: var(--tomato-2); color: #fff; }
.chip.on .cnt { color: rgba(255, 255, 255, 0.82); }

/* ---------- 桌面端餐盘面板 ---------- */

.cart-panel { --c: 8px; --b: 2px; padding: 10px 12px 12px; }
.cart-panel h3 { font-family: var(--px); font-weight: 400; font-size: 12px; letter-spacing: 1px; color: var(--cocoa); display: flex; justify-content: space-between; margin-bottom: 4px; }
.cart-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 16px 0; }
.cart-lines { max-height: 300px; overflow: auto; scrollbar-width: thin; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-top: 2px dashed var(--line); margin-top: 4px; font-size: 12px; color: var(--cocoa); }
.cart-total b { font-family: var(--px); font-weight: 400; font-size: 24px; line-height: 1; color: var(--tomato-2); }

.cline { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 2px dashed var(--line); }
.cline:last-child { border-bottom: 0; }
.cline-tile { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); background: var(--tile); flex: none; }
.cline-name { font-size: 14px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cline-price { font-size: 12px; color: var(--muted); font-family: var(--px); }
.cline .qty { --qh: 34px; }
/* 侧栏餐盘更紧凑，给菜名留出位置 */
.cart-panel .cline { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; padding: 6px 0; }
.cart-panel .cline-tile { width: 40px; height: 40px; }
.cart-panel .qty { --qh: 30px; width: calc(var(--qh) * 2.5); }

/* ---------- 区块标题 / 今日主打 ---------- */

.sec { scroll-margin-top: calc(var(--topbar-h) + 66px); }
.sec-h { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; }
.sec:first-child .sec-h { margin-top: 0; }
.sec-h .spr { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; --c: 6px; --b: 2px; --fill: var(--tile, var(--honey)); flex: none; }
.sec-h h2 { font-family: var(--px); font-weight: 400; font-size: 24px; line-height: 1; letter-spacing: 1px; }
.sec-h .sub { font-size: 12px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.sec-h::after { content: ""; flex: 1; border-top: 2px dashed #dcc3a3; margin-left: 6px; }

.featured-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fcard { --c: 8px; --b: 2px; padding: 8px 10px 10px; cursor: pointer; transition: transform 0.08s; }
.fcard:hover { transform: translate(-1px, -1px); }
.fcard-tile { position: relative; height: 104px; display: flex; align-items: center; justify-content: center; background: var(--tile); border: 2px solid var(--ink); margin-bottom: 10px; }
.fcard-tile::before { content: ""; position: absolute; inset: 4px; border: 2px dashed rgba(61, 40, 23, 0.16); pointer-events: none; }
.fcard-tile .tag { position: absolute; left: 6px; top: 6px; z-index: 2; }
.fcard-tile canvas { animation: bob 2.2s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.fcard h3 { font-size: 15px; font-weight: 700; line-height: 1.3; }
.fcard .desc { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.fcard .qty { --qh: 36px; }

/* ---------- 菜品行 ---------- */

.dishes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.dish {
  --c: 7px;
  --b: 2px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 8px;
  cursor: pointer;
  transition: transform 0.08s, filter 0.08s;
}
.dish:hover { transform: translate(-1px, -1px); filter: drop-shadow(4px 4px 0 var(--shadow)); }
.dish:active { transform: translate(1px, 1px); }
.dish-tile { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: var(--tile); border: 2px solid var(--ink); }
.dish-body { min-width: 0; }
.dish-name { font-size: 15px; font-weight: 700; line-height: 1.3; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.dish-desc { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dish-price { font-family: var(--px); font-size: 18px; line-height: 1; color: var(--tomato-2); margin-top: 6px; }
.dish-price small { font-size: 12px; margin-right: 2px; }
.dish.sold { cursor: pointer; }
.dish.sold .dish-tile canvas { filter: grayscale(1); opacity: 0.45; }
.dish.sold .dish-name { color: var(--muted); }
.sec-empty { padding: 18px; text-align: center; font-size: 12px; color: var(--muted); }

.menu-foot { margin-top: 36px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- 浮动餐盘条（窄屏） ---------- */

.cart-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 40;
  height: 60px;
  text-align: left;
  transform: translateY(130%);
  visibility: hidden;
  transition: transform 0.22s steps(6), visibility 0s 0.22s;
}
.cart-bar.show { transform: none; visibility: visible; transition: transform 0.22s steps(6), visibility 0s; }
.cart-bar-body {
  position: absolute;
  inset: 0;
  --c: 8px;
  --b: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 66px;
  filter: drop-shadow(4px 4px 0 rgba(61, 40, 23, 0.25));
}
.cart-bar:active .cart-bar-body { filter: drop-shadow(2px 2px 0 rgba(61, 40, 23, 0.25)); }
.cart-bar-icon {
  position: absolute;
  left: 8px;
  top: -16px;
  z-index: 2;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--honey);
  border: 3px solid var(--ink);
  filter: drop-shadow(3px 3px 0 rgba(61, 40, 23, 0.22));
}
.cart-bar-icon .n {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--px);
  font-size: 12px;
  line-height: 1;
  background: var(--tomato-2);
  color: #fff;
  border: 2px solid var(--ink);
}
.cart-bar-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-bar-info b { font-family: var(--px); font-weight: 400; font-size: 18px; line-height: 1.1; color: var(--tomato-2); }
.cart-bar-info small { font-size: 12px; color: var(--muted); }
.cart-bar-cta {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--tomato-2);
  color: #fff;
  font-family: var(--px);
  font-size: 12px;
  letter-spacing: 1px;
  border: 2px solid var(--ink);
}

/* ---------- 弹层（底部抽屉 / 居中对话框） ---------- */

.mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(61, 40, 23, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.mask.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-bottom: 0;
  box-shadow: 0 -6px 0 rgba(61, 40, 23, 0.18);
  transform: translateY(40px);
  transition: transform 0.22s steps(6);
}
.mask.open .sheet { transform: none; }
.sheet-grab { width: 48px; height: 4px; margin: 8px auto 0; background: var(--line); flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 2px dashed var(--line); flex: none; }
.sheet-head h2 { font-family: var(--px); font-weight: 400; font-size: 24px; line-height: 1; letter-spacing: 1px; }
.sheet-head .sub { font-size: 12px; color: var(--muted); }
.sheet-x { margin-left: auto; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; --fill: var(--paper-2); --c: 5px; --b: 2px; flex: none; }
.xico { position: relative; width: 14px; height: 14px; display: inline-block; }
.xico::before, .xico::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; background: currentColor; }
.xico::before { transform: rotate(45deg); }
.xico::after { transform: rotate(-45deg); }
.sheet-body { overflow: auto; padding: 14px 16px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 2px dashed var(--line); background: var(--paper); flex: none; }

@media (min-width: 720px) {
  .mask { align-items: center; padding: 24px; }
  .sheet { width: 480px; max-height: 86vh; border-bottom: 3px solid var(--ink); box-shadow: 8px 8px 0 rgba(61, 40, 23, 0.25); }
  .sheet-grab { display: none; }
}

/* 表单 */
.field { margin-bottom: 12px; }
.flabel { display: block; font-size: 12px; font-weight: 700; color: var(--cocoa); margin-bottom: 6px; }
.inp { width: 100%; height: 42px; padding: 2px 12px; background: #fff; border: 2px solid var(--ink); outline: none; font-size: 14px; }
.inp:focus { box-shadow: 3px 3px 0 var(--honey); }
.inp::placeholder { color: #c4b29b; }
textarea.inp { height: auto; min-height: 60px; padding: 8px 12px; resize: vertical; }
.seg { display: flex; }
.seg button { flex: 1; height: 38px; border: 2px solid var(--ink); background: #fff; font-size: 14px; font-weight: 700; }
.seg button + button { border-left: 0; }
.seg button.on { background: var(--honey); }
.seat-row { display: flex; flex-wrap: wrap; gap: 6px; }
.seat { width: 42px; height: 36px; border: 2px solid var(--ink); background: #fff; font-family: var(--px); font-size: 12px; }
.seat.on { background: var(--tomato-2); color: #fff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 12px; color: var(--cocoa); }
.sum-row b { font-family: var(--px); font-weight: 400; font-size: 24px; line-height: 1; color: var(--tomato-2); }

/* 菜品详情 */
.detail { display: flex; flex-direction: column; align-items: center; text-align: center; }
.detail-tile { width: 160px; height: 160px; display: flex; align-items: center; justify-content: center; background: var(--tile); border: 3px solid var(--ink); position: relative; margin-bottom: 14px; }
.detail-tile::before { content: ""; position: absolute; inset: 8px; border: 2px dashed rgba(61, 40, 23, 0.18); }
.detail-tile canvas { animation: bob 2s steps(2) infinite; }
.detail h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; }
.detail .desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.detail .dish-price { font-size: 24px; margin: 8px 0 14px; }
.detail-foot { display: flex; align-items: center; justify: space-between; gap: 12px; width: 100%; }

/* 下单成功 */
.done { text-align: center; }
.done-kicker { font-size: 12px; color: var(--muted); }
.done-no { display: inline-block; margin: 10px 0 6px; padding: 12px 22px; --c: 8px; --b: 3px; --fill: var(--honey); font-family: var(--px); font-size: 48px; line-height: 1; letter-spacing: 2px; filter: drop-shadow(4px 4px 0 rgba(61, 40, 23, 0.22)); animation: pop 0.4s steps(5); }
@keyframes pop { 0% { transform: scale(0.6); } 100% { transform: scale(1); } }
.done-tip { font-size: 13px; color: var(--cocoa); }
.flow { display: flex; justify-content: space-between; margin: 20px 4px 16px; position: relative; }
.flow::before { content: ""; position: absolute; left: 12%; right: 12%; top: 9px; border-top: 2px dashed #d9bf9d; }
.flow li { position: relative; z-index: 1; flex: 1; list-style: none; font-size: 12px; color: var(--muted); }
.flow li i { display: block; width: 20px; height: 20px; margin: 0 auto 6px; background: var(--paper); border: 3px solid #d9bf9d; }
.flow li.done i { background: var(--sage-2); border-color: var(--ink); }
.flow li.now i { background: var(--tomato-2); border-color: var(--ink); animation: blink 1s steps(1) infinite; }
.flow li.done, .flow li.now { color: var(--ink); font-weight: 700; }
.done-items { text-align: left; border: 2px dashed var(--line); padding: 8px 10px; background: #fff; font-size: 13px; }
.done-items div { display: flex; justify-content: space-between; padding: 2px 0; }
.done-items .t { border-top: 2px dashed var(--line); margin-top: 4px; padding-top: 6px; color: var(--tomato-2); font-weight: 700; }

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: 50%;
  z-index: 99;
  max-width: calc(100% - 32px);
  padding: 8px 16px;
  transform: translate(-50%, -14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--paper);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
  font-size: 13px;
  transition: transform 0.2s steps(5), opacity 0.15s, visibility 0s 0.2s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform 0.2s steps(5), opacity 0.15s, visibility 0s; }
.toast.err { background: var(--tomato-2); }

/* ==========================================================
   后厨页
   ========================================================== */

.kit-top { position: sticky; top: 0; z-index: 50; background: var(--ink); color: var(--paper); border-bottom: 3px solid var(--ink); }
.kit-top-in { max-width: 1200px; margin: 0 auto; padding: 0 12px 0 16px; height: 56px; display: flex; align-items: center; gap: 10px; }
.kit-name { font-family: var(--px); font-size: 12px; letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kit-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #cfe9c0; white-space: nowrap; }
.kit-live i { width: 8px; height: 8px; background: #8fd06a; animation: blink 1.4s steps(1) infinite; }
.kit-clock { display: none; margin-left: auto; font-family: var(--px); font-size: 12px; color: var(--honey); }
.kit-link { height: 34px; padding: 2px 10px; --fill: var(--tomato-2); --frame: var(--paper); color: #fff; font-family: var(--px); font-size: 12px; text-decoration: none; display: inline-flex; align-items: center; margin-left: auto; flex: none; }
.kit-main { max-width: 1200px; margin: 0 auto; padding: 16px 16px 60px; }
body.kit-page { padding-top: 0; }

.kit-tabs { display: flex; gap: 10px; margin-bottom: 16px; }
.kit-tab { height: 44px; padding: 3px 18px; --fill: var(--paper-2); font-family: var(--px); font-size: 12px; letter-spacing: 1px; display: inline-flex; align-items: center; gap: 8px; }
.kit-tab .n { min-width: 18px; height: 18px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; background: var(--tomato-2); color: #fff; border: 2px solid var(--ink); font-size: 12px; }
.kit-tab.on { --fill: var(--honey); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { --c: 8px; --b: 2px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; }
.kpi-ic { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); background: var(--tile); flex: none; }
.kpi b { display: block; font-family: var(--px); font-weight: 400; font-size: 24px; line-height: 1.1; }
.kpi span { font-size: 12px; color: var(--muted); }

.lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.lane-h { display: flex; align-items: center; gap: 8px; height: 40px; padding: 2px 10px; margin-bottom: 10px; --c: 6px; --b: 2px; --fill: var(--lane, var(--paper)); font-weight: 700; font-size: 14px; }
.lane-h .n { margin-left: auto; font-family: var(--px); font-size: 12px; line-height: 1; padding: 3px 6px; background: var(--paper); border: 2px solid var(--ink); }
.lane-empty { padding: 22px 10px; text-align: center; font-size: 12px; color: var(--muted); border: 2px dashed #dcc3a3; }

.ticket { --c: 8px; --b: 2px; padding: 10px 12px 12px; margin-bottom: 12px; }
.ticket-top { display: flex; align-items: center; gap: 8px; }
.ticket-no { font-family: var(--px); font-size: 24px; line-height: 1; }
.ticket-ago { margin-left: auto; font-family: var(--px); font-size: 12px; line-height: 1; padding: 4px 6px; border: 2px solid var(--ink); background: var(--paper-2); white-space: nowrap; }
.ticket-ago.late { background: var(--tomato-2); color: #fff; }
.new-tag { animation: blink 0.8s steps(1) infinite; }
.ticket-meta { font-size: 12px; color: var(--cocoa); margin: 6px 0 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.ticket-items { border: 2px dashed var(--line); padding: 6px 8px; background: #fff; }
.ticket-items div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px 0; }
.ticket-items .q { color: var(--cocoa); }
.ticket-items .tt { border-top: 2px dashed var(--line); margin-top: 4px; padding-top: 6px; color: var(--tomato-2); font-weight: 700; }
.ticket-note { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--ink); background: #fff3d6; border-left: 4px solid var(--honey); padding: 4px 8px; }
.ticket-acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 菜单管理 */
.menu-tools { display: flex; gap: 10px; margin-bottom: 14px; }
.menu-search { flex: 1; height: 40px; padding: 2px 12px; background: #fff; border: 2px solid var(--ink); outline: none; font-size: 14px; }
.menu-search:focus { box-shadow: 3px 3px 0 var(--honey); }
.mgroup { margin-bottom: 18px; }
.mrow { --c: 7px; --b: 2px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 8px; margin-bottom: 8px; }
.mrow.off { opacity: 0.6; }
.mrow-tile { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); background: var(--tile); }
.mrow-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.mrow-sub { font-size: 12px; color: var(--muted); font-family: var(--px); }
.mrow-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sw { height: 32px; padding: 2px 8px; --c: 5px; --b: 2px; --fill: #fff; font-family: var(--px); font-size: 12px; display: inline-flex; align-items: center; }
.sw.on { --fill: var(--honey); }
.sw.danger.armed { --fill: var(--tomato-2); color: #fff; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-picker button { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid var(--ink); position: relative; }
.icon-picker button.sel { background: var(--honey); box-shadow: inset 0 0 0 2px var(--ink); }
.icon-picker-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.icon-picker-sub { font-size: 12px; color: var(--muted); margin: 8px 0 6px; width: 100%; }
.icon-picker button.custom-ic::after { content: "自"; position: absolute; right: 1px; bottom: 1px; font-family: var(--px); font-size: 10px; line-height: 1; padding: 1px 2px; background: var(--sage-2); color: #fff; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--tomato-2); }

/* ==========================================================
   像素图标画板（v2 后厨页 & 弹窗）
   ========================================================== */

.sheet.sheet-wide { width: 100%; }
@media (min-width: 720px) {
  .sheet.sheet-wide { width: min(760px, 94vw); max-height: 90vh; }
}

.pstudio { display: flex; flex-direction: column; gap: 14px; }
.ps-toolbar {
  --c: 8px;
  --b: 2px;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ps-group { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-tool {
  --c: 5px;
  --b: 2px;
  --fill: #fff;
  height: 34px;
  padding: 2px 10px;
  font-family: var(--px);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.ps-tool.on { --fill: var(--honey); }
.ps-tool.ps-danger { --fill: #fde2dc; color: var(--tomato-2); }
.ps-tool:disabled { opacity: 0.4; pointer-events: none; }

.ps-work {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.pstudio-modal .ps-work { grid-template-columns: minmax(0, 336px) minmax(0, 1fr); gap: 12px; }

.ps-left, .ps-right { display: flex; flex-direction: column; gap: 12px; }
.ps-board-card, .ps-card { --c: 8px; --b: 2px; padding: 10px 12px 12px; }
.ps-board-head, .ps-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--cocoa); }
.ps-coord { font-size: 11px; color: var(--muted); }

.ps-canvas-wrap {
  display: flex;
  justify-content: center;
  padding: 6px;
  background: var(--paper-2);
  border: 2px dashed var(--line);
}
.ps-canvas {
  width: min(312px, calc(100vw - 88px));
  height: min(312px, calc(100vw - 88px));
  aspect-ratio: 1 / 1;
  border: 3px solid var(--ink);
  image-rendering: pixelated;
  touch-action: none;
  user-select: none;
  display: block;
}
.pstudio-modal .ps-canvas {
  width: min(288px, calc(100vw - 80px));
  height: min(288px, calc(100vw - 80px));
}

.ps-cur-color { display: inline-flex; align-items: center; gap: 6px; }
.ps-cur-color i { width: 18px; height: 18px; border: 2px solid var(--ink); display: inline-block; }

.ps-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.ps-swatch {
  aspect-ratio: 1 / 1;
  min-height: 28px;
  border: 2px solid var(--ink);
  transition: transform 0.06s;
}
.ps-swatch:active { transform: translate(1px, 1px); }
.ps-swatch.on { outline: 3px solid var(--tomato-2); outline-offset: 1px; z-index: 1; }

.ps-custom-row { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.ps-custom-pick {
  --c: 5px;
  --b: 2px;
  --fill: var(--paper-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
}
.ps-custom-pick input[type="color"] { width: 24px; height: 22px; border: 2px solid var(--ink); padding: 0; background: none; cursor: pointer; }

.ps-bg-dots { display: flex; gap: 6px; }
.ps-bg-dot { width: 20px; height: 20px; border: 2px solid var(--ink); }
.ps-bg-dot.on { box-shadow: 0 0 0 2px var(--tomato-2); }

.ps-prev-stage { display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; padding: 6px 0 2px; flex-wrap: wrap; }
.ps-prev-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ps-prev-box { display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); position: relative; }
.ps-prev-box.bob canvas { animation: bob 2.2s steps(2) infinite; }

.ps-tpl-row { display: flex; gap: 8px; align-items: center; }
.ps-tpl-sel { height: 36px; font-size: 13px; }

.ps-save-acts { display: flex; gap: 8px; margin-top: 10px; }
.ps-save-sub { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.ps-lib { margin-top: 6px; }
.ps-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
.ps-lib-empty { grid-column: 1 / -1; }
.ps-gcard { --c: 8px; --b: 2px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ps-gcard.on { --fill: #fff7dc; }
.ps-gcard-tile { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); background: var(--paper-2); }
.ps-gcard-name { font-size: 13px; font-weight: 700; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-gcard-acts { display: flex; gap: 6px; }

@media (max-width: 719px) {
  .ps-work, .pstudio-modal .ps-work { grid-template-columns: minmax(0, 1fr); }
  .ps-swatches { grid-template-columns: repeat(6, 1fr); }
}

/* ==========================================================
   响应式
   ========================================================== */

@media (min-width: 1000px) {
  .cart-bar { display: none; }
}

@media (min-width: 720px) {
  .kit-clock { display: block; }
  .kit-link { margin-left: 0; }
  .kit-clock { margin-right: 12px; }
}

@media (min-width: 860px) {
  .dishes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 999px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 120px; gap: 0; }
  .side { display: none; }
  .cats-bar { display: flex; }
  .cart-fab { display: none; }
  .track { margin-left: auto; }
  .sec { scroll-margin-top: calc(var(--topbar-h) + 74px); }
}

@media (max-width: 719px) {
  .topbar-sub { display: none; }
  .shop-in { padding: 0 12px; }
  .wall { height: 196px; }
  .wall .lamp { right: 2%; top: -16px; }
  .garland { height: 26px; }
  .lamp-glow { right: -10px; top: 56px; width: 130px; height: 110px; }
  .sign { top: 26px; width: min(440px, 86%); }
  .sign::before, .sign::after { top: -14px; height: 16px; }
  .sign::before { left: 9%; }
  .sign::after { right: 9%; }
  .plaque { padding: 10px 12px 12px; }
  .shop-name { font-size: 24px; letter-spacing: 1px; text-shadow: 2px 2px 0 var(--ink); }
  .shop-slogan { font-size: 12px; letter-spacing: 2px; }
  .shop-meta { margin-top: 8px; }
  .notice { max-width: 78%; }
  .wall .hide-s { display: none; }
  .shelf { bottom: 12px; }
  .wall .cat { right: 2%; bottom: 22px; }
  .floor { height: 16px; }

  .featured-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -12px; padding: 4px 12px 10px; scrollbar-width: none; }
  .featured-row::-webkit-scrollbar { display: none; }
  .fcard { flex: 0 0 176px; scroll-snap-align: start; }
  .sec-h h2 { font-size: 24px; }
  .sec-h .spr { width: 32px; height: 32px; }

  .dish { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; padding: 8px 8px 8px 8px; }
  .dish-tile { width: 56px; height: 56px; }
  .dish-name { font-size: 14px; }
  .dish-desc { max-width: 52vw; }
  .dish .qty { --qh: 38px; width: calc(var(--qh) * 2.55); }

  .form-row { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 8px 10px; gap: 10px; }
  .kpi-ic { width: 40px; height: 40px; }
  .lanes { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .kit-main { padding: 12px 12px 60px; }
  .mrow { grid-template-columns: 44px minmax(0, 1fr); }
  .mrow-tile { width: 44px; height: 44px; }
  .mrow-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .kit-live { display: none; }
}

@media (max-width: 359px) {
  .shop-name { font-size: 12px; transform: scale(1.6); transform-origin: center; letter-spacing: 0; }
}
