/* ========== 基础与设计变量 ========== */
:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #fbf8f3;
  --ink: #231f1b;
  --ink-2: #5c5248;
  --ink-3: #8d8175;
  --line: #e9e1d6;
  --brand: #c9451f;
  --brand-2: #e0642f;
  --brand-soft: #fdeee6;
  --green: #1f7a55;
  --green-soft: #e6f4ec;
  --amber: #b97a10;
  --amber-soft: #fdf2dc;
  --red: #c0362c;
  --red-soft: #fbe9e7;
  --blue: #2c6e9b;
  --blue-soft: #e8f1f7;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 6px 24px rgba(60, 40, 20, 0.08);
  --shadow-lg: 0 18px 60px rgba(40, 25, 10, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }

.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  transition: transform 0.06s ease, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(201, 69, 31, 0.28); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #ecc9c5; background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { padding: 8px; width: 38px; height: 38px; }

/* ========== 表单 ========== */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-size: 15px;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(201, 69, 31, 0.12);
}
.textarea { resize: vertical; min-height: 70px; }
.input-sm { padding: 7px 10px; font-size: 14px; border-radius: 8px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }

/* ========== 卡片、面板 ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.pill.pending { background: var(--amber-soft); color: var(--amber); }
.pill.cooking { background: var(--blue-soft); color: var(--blue); }
.pill.done { background: var(--green-soft); color: var(--green); }
.pill.cancelled { background: #f1efec; color: var(--ink-3); }
.pill.gray { background: #f1efec; color: var(--ink-2); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.chip:hover { border-color: #d9cbbd; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count { font-size: 11px; background: rgba(0, 0, 0, 0.08); border-radius: 999px; padding: 1px 6px; }
.chip.active .count { background: rgba(255, 255, 255, 0.22); }

/* ========== 提示 / 弹层 ========== */
.toast-wrap {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast {
  background: rgba(30, 24, 18, 0.92);
  color: #fff;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.22s ease;
  max-width: 100%;
  word-break: break-word;
  text-align: center;
}
.toast.error { background: #a52a20; }
.toast.success { background: #17613f; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(28, 22, 16, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fade-in 0.15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  width: min(560px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  animation: modal-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  overflow: hidden;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  padding: 2px 6px;
  border-radius: 8px;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-2);
}

.empty {
  padding: 46px 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.8;
}
.empty .emoji { font-size: 34px; display: block; margin-bottom: 8px; opacity: 0.7; }

/* ========== 顶栏 ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, var(--brand), #8f2f12);
  color: #fff; display: grid; place-items: center; font-size: 17px;
  box-shadow: 0 4px 12px rgba(201, 69, 31, 0.3);
}
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  padding: 8px 14px;
  border-radius: 9px;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-2);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-badge {
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
}
.nav-badge[data-zero="1"] { display: none; }

.sound-attention {
  border-color: #e0642f !important;
  color: #c9451f !important;
  animation: sound-pulse 1.8s ease-in-out infinite;
}
.kitchen-top .sound-attention { color: #ffb37a !important; border-color: #e0642f !important; }
@keyframes sound-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 100, 47, 0.35); }
  50% { box-shadow: 0 0 0 7px rgba(224, 100, 47, 0); }
}

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 170px;
  z-index: 300;
}
.menu-pop button {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
}
.menu-pop button:hover { background: var(--surface-2); }

/* ========== 页面容器 ========== */
.page { max-width: 1180px; margin: 0 auto; padding: 20px 18px 90px; }
.page-title { font-size: 20px; font-weight: 800; margin: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fdfbf8; }

.thumb {
  width: 52px; height: 52px; border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 18px;
  color: var(--ink-3);
  flex: none;
}

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px;
  background: #d9d2c9; transition: 0.18s; cursor: pointer;
}
.switch span::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  left: 3px; top: 3px; background: #fff; transition: 0.18s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(18px); }

/* ========== 顾客端 ========== */
.customer-page {
  background: var(--surface-2);
  min-height: 100vh;
  padding-bottom: 118px;
}
.customer-hero {
  background: linear-gradient(160deg, #2a1c12 0%, #4a2a16 55%, #7a3d1b 100%);
  color: #fff;
  padding: 22px 20px 26px;
  position: relative;
  overflow: hidden;
}
.customer-hero::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 160, 80, 0.35), transparent 70%);
}
.hero-inner { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }
.hero-shop { font-size: 21px; font-weight: 800; letter-spacing: 0.5px; }
.hero-sub { font-size: 13px; opacity: 0.78; margin-top: 6px; }
.hero-table {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.menu-wrap { max-width: 720px; margin: 0 auto; padding: 14px 12px 0; }
.menu-layout { display: flex; gap: 12px; align-items: flex-start; }
.menu-cats {
  position: sticky;
  top: 10px;
  width: 92px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: none;
}
.menu-cats::-webkit-scrollbar { display: none; }
.menu-cat {
  padding: 12px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: none;
  border-radius: 10px;
  text-align: center;
  line-height: 1.35;
  word-break: break-all;
}
.menu-cat.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.menu-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.menu-group-title {
  font-size: 15px; font-weight: 800; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.menu-group-title::before {
  content: ""; width: 4px; height: 15px; border-radius: 2px; background: var(--brand);
}
.dish-list { display: flex; flex-direction: column; gap: 10px; }
.dish-card {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(60, 40, 20, 0.04);
}
.dish-thumb {
  width: 82px; height: 82px; border-radius: 11px; flex: none;
  object-fit: cover;
  background: linear-gradient(145deg, #f3e6d6, #e8d3ba);
  display: grid; place-items: center;
  font-size: 26px;
  overflow: hidden;
  position: relative;
}
.dish-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dish-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish-name { font-size: 15px; font-weight: 700; line-height: 1.35; }
.dish-desc {
  font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dish-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price { color: var(--brand); font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.price small { font-size: 12px; font-weight: 700; margin-right: 1px; }
.add-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--brand); color: #fff;
  font-size: 19px; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(201, 69, 31, 0.3);
  flex: none;
}
.add-btn:active { transform: scale(0.9); }
.qty-stepper { display: inline-flex; align-items: center; gap: 8px; }
.qty-stepper button {
  width: 27px; height: 27px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 16px; line-height: 1; display: grid; place-items: center;
  color: var(--ink-2);
}
.qty-stepper .q { min-width: 18px; text-align: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(50, 30, 10, 0.07);
}
.cart-bar-inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.cart-icon {
  position: relative; width: 52px; height: 52px; border-radius: 15px;
  background: #2a211a; color: #fff; display: grid; place-items: center;
  font-size: 23px; flex: none;
}
.cart-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 800;
  min-width: 20px; height: 20px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff;
}
.cart-total { line-height: 1.3; }
.cart-total .t { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-total .s { font-size: 11px; color: var(--ink-3); }

.sheet-mask {
  position: fixed; inset: 0; background: rgba(28, 22, 16, 0.45);
  z-index: 300; display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in 0.15s;
}
.sheet {
  background: var(--surface);
  width: min(720px, 100%);
  max-height: 88vh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: sheet-up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  overflow: hidden;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head {
  padding: 16px 18px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.sheet-body { padding: 16px 18px; overflow: auto; flex: 1; }
.sheet-foot {
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center;
  background: var(--surface-2);
}
.cart-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.cart-item:last-child { border-bottom: none; }
.cart-item-name { font-weight: 700; font-size: 14px; }
.cart-item-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }

.success-screen { max-width: 560px; margin: 0 auto; padding: 54px 22px; text-align: center; }
.success-circle {
  width: 86px; height: 86px; border-radius: 50%;
  background: var(--green-soft); color: var(--green);
  display: grid; place-items: center; font-size: 42px; margin: 0 auto 20px;
  animation: pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-screen h2 { margin: 0 0 8px; font-size: 24px; }
.success-screen p { color: var(--ink-2); line-height: 1.7; margin: 6px 0; }

.table-order-list { margin-top: 26px; text-align: left; }
.day-summary {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.day-summary .amt { color: var(--brand); font-weight: 800; font-size: 18px; }

/* ========== 管理端 / 后厨 ========== */
.admin-body { background: #f4f1ec; min-height: 100vh; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 10px rgba(60, 40, 20, 0.04);
}
.stat .label { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.stat .value.brand { color: var(--brand); }
.stat .value.green { color: var(--green); }
.stat .value.amber { color: var(--amber); }
.stat .sub { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(60, 40, 20, 0.04);
}
.order-card.pending { border-left: 4px solid var(--amber); }
.order-card.cooking { border-left: 4px solid var(--blue); }
.order-card.done { border-left: 4px solid var(--green); opacity: 0.92; }
.order-card.cancelled { border-left: 4px solid #b9afa4; opacity: 0.7; }
.order-head { padding: 12px 14px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.order-table { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.order-no { font-size: 11px; color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.order-items { padding: 10px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.order-item { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; line-height: 1.45; }
.order-item .nm { display: flex; gap: 6px; flex-wrap: wrap; }
.order-item .sp { font-size: 11px; color: var(--ink-3); background: var(--surface-2); border-radius: 5px; padding: 0 5px; }
.order-item .qt { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.order-item-note { font-size: 12px; color: var(--brand); padding-left: 8px; border-left: 2px solid var(--brand-soft); }
.order-note {
  margin: 0 14px 10px;
  background: var(--amber-soft);
  color: #7a5108;
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.5;
}
.order-foot { padding: 10px 14px 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--surface-2); }
.order-total { font-weight: 800; font-size: 16px; color: var(--brand); font-variant-numeric: tabular-nums; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 后厨 */
.kitchen-body { background: #1c1915; color: #f4ede3; min-height: 100vh; }
.kitchen-top {
  position: sticky; top: 0; z-index: 100;
  background: rgba(28, 25, 21, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #3a322a;
}
.kitchen-top-inner { max-width: 1400px; margin: 0 auto; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.kitchen-title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4ecb8d; box-shadow: 0 0 0 3px rgba(78, 203, 141, 0.18); }
.dot.off { background: #c0564c; box-shadow: 0 0 0 3px rgba(192, 86, 76, 0.18); }
.kitchen-top .chip { background: #2a251f; border-color: #3d352c; color: #c9bfb2; }
.kitchen-top .chip.active { background: #f4ede3; border-color: #f4ede3; color: #1c1915; }
.kitchen-top .chip:hover { border-color: #5a4e42; }
.kitchen-top .chip .count { background: rgba(255, 255, 255, 0.12); }
.kitchen-top .chip.active .count { background: rgba(0, 0, 0, 0.12); }
.kitchen-top .btn { background: #2a251f; border-color: #3d352c; color: #e9dfd2; }
.kitchen-top .btn:hover { background: #332d26; }

.board { max-width: 1400px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 860px) { .board { grid-template-columns: 1fr; } }
.board-col-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 14px; font-weight: 800; letter-spacing: 0.5px; color: #b8ac9e;
}
.board-col-title .n {
  background: #2a251f; border-radius: 999px; padding: 1px 8px; font-size: 12px; color: #d8cbbd;
}
.kitchen-card {
  background: #262019;
  border: 1px solid #3a322a;
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  animation: card-in 0.25s ease;
}
@keyframes card-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.kitchen-card.new { border-color: #e0642f; box-shadow: 0 0 0 2px rgba(224, 100, 47, 0.25), 0 8px 26px rgba(0,0,0,0.3); }
.kitchen-card-head { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #3a322a; background: #2d261e; }
.kitchen-table { font-size: 19px; font-weight: 800; color: #fff; }
.kitchen-time { font-size: 12px; color: #a99c8d; font-variant-numeric: tabular-nums; }
.kitchen-items { padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.kitchen-item { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; font-weight: 600; line-height: 1.4; color: #f7f0e7; }
.kitchen-item .qty { color: #f0a35e; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.kitchen-item .sp { font-size: 12px; color: #b8ac9e; font-weight: 500; }
.kitchen-note { margin: 0 14px 12px; padding: 8px 10px; border-radius: 8px; background: rgba(224, 100, 47, 0.14); color: #ffb37a; font-size: 13px; line-height: 1.5; }
.kitchen-actions { display: flex; gap: 8px; padding: 0 14px 12px; }
.kitchen-actions .btn { flex: 1; border: none; font-size: 15px; padding: 12px; border-radius: 10px; }
.kitchen-actions .btn.accept { background: #e0642f; color: #fff; }
.kitchen-actions .btn.accept:hover { background: #ef7440; }
.kitchen-actions .btn.finish { background: #2f8f63; color: #fff; }
.kitchen-actions .btn.finish:hover { background: #37a271; }
.kitchen-empty { padding: 40px 20px; text-align: center; color: #7f7468; font-size: 14px; border: 1px dashed #3a322a; border-radius: 14px; }

/* 登录 */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 10% -10%, #f6e3d3 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 110%, #e6efe7 0%, transparent 50%),
    #f6f3ee;
}
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: 0 24px 70px rgba(60, 35, 15, 0.15);
  border: 1px solid var(--line);
}
.login-logo {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(145deg, var(--brand), #8f2f12);
  box-shadow: 0 10px 24px rgba(201, 69, 31, 0.3);
  margin-bottom: 18px;
}
.login-title { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.login-sub { color: var(--ink-3); font-size: 13px; margin-bottom: 24px; line-height: 1.6; }

/* 打印 */
.print-toolbar {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.print-sheet { padding: 20px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: flex-start; }
.qr-card {
  width: 260px;
  border: 1px dashed #c9bcae;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  background: #fff;
  page-break-inside: avoid;
}
.qr-card .qr-name { font-size: 20px; font-weight: 800; margin-bottom: 2px; }
.qr-card .qr-sub { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.qr-card img { width: 200px; height: 200px; display: block; margin: 0 auto; }
.qr-card .qr-tip { font-size: 12px; color: var(--ink-2); margin-top: 8px; line-height: 1.5; }

@media print {
  .print-toolbar { display: none; }
  body { background: #fff; }
  .print-sheet { padding: 0; gap: 10px; }
  .qr-card { border-color: #ddd; }
}

/* PWA 安装提示条 */
.pwa-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 250;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  animation: sheet-up 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.pwa-banner.above-cart { bottom: calc(86px + env(safe-area-inset-bottom)); }
.pwa-banner img { width: 42px; height: 42px; border-radius: 11px; flex: none; }
.pwa-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pwa-banner-text b { font-size: 13.5px; }
.pwa-banner-text span { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.pwa-banner-close {
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-3);
  padding: 2px 4px;
  flex: none;
}
.pwa-banner-close:hover { color: var(--ink); }

/* 响应式 */
@media (max-width: 720px) {
  .topbar-inner { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .brand { font-size: 15px; gap: 8px; }
  .brand-mark { width: 31px; height: 31px; font-size: 15px; border-radius: 9px; }
  #userName, .sound-label { display: none; }
  #soundBtn { padding: 7px 10px; }
  .user-chip { padding: 4px 4px; gap: 0; }
  .page { padding: 14px 12px 90px; }
  .order-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat .value { font-size: 22px; }
  .card-pad { padding: 14px; }
  table.data th, table.data td { padding: 8px; }
  .menu-cats { width: 78px; }
  .dish-thumb { width: 70px; height: 70px; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .cart-icon { width: 46px; height: 46px; }
  .cart-total .t { font-size: 17px; }
  .nav { order: 5; width: 100%; }
  .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .table-grid .card-pad { padding: 10px !important; }
  .table-grid img { width: 108px !important; height: 108px !important; }
  .table-grid .btn.sm { padding: 5px 7px; font-size: 12px; }
  .kitchen-top-inner { padding: 8px 12px; gap: 8px; }
  .kitchen-title { font-size: 15px; gap: 7px; }
  .kitchen-top .btn { padding: 7px 10px; font-size: 12px; }
  #stationChips { order: 5; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  #stationChips::-webkit-scrollbar { display: none; }
  #stationChips .chip { flex: none; }
}
