/* ============================================================
   点餐系统 · 设计系统
   暖色系轻食餐厅风格：米白底 + 赤陶橙主色 + 墨绿点缀
   ============================================================ */

:root {
  --bg: #fbf7f2;
  --bg-deep: #f4ece3;
  --surface: #ffffff;
  --surface-2: #fdf9f5;
  --ink: #211a16;
  --ink-2: #4a3f39;
  --muted: #857a72;
  --line: #ecdfd3;
  --line-strong: #ddcbb9;

  --brand: #d9480f;
  --brand-dark: #b23a0b;
  --brand-soft: #fff1e7;
  --brand-soft-2: #ffe3d1;

  --accent: #0f766e;
  --accent-soft: #e6f4f2;
  --gold: #f0a020;
  --danger: #c0392b;
  --danger-soft: #fdecea;

  --shadow-sm: 0 1px 2px rgba(60, 40, 25, 0.06), 0 1px 3px rgba(60, 40, 25, 0.04);
  --shadow-md: 0 4px 12px rgba(60, 40, 25, 0.08), 0 2px 4px rgba(60, 40, 25, 0.04);
  --shadow-lg: 0 18px 40px rgba(60, 40, 25, 0.14), 0 4px 12px rgba(60, 40, 25, 0.06);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

/* 作者样式里的 display 会覆盖浏览器对 [hidden] 的默认处理，
   这里补一条全局规则，否则 .login-wrap 这类 display:grid 的元素加上 hidden 也不会消失 */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(1100px 520px at 12% -12%, #ffe9d9 0%, rgba(255, 233, 217, 0) 62%),
    radial-gradient(900px 480px at 96% 0%, #e8f3ef 0%, rgba(232, 243, 239, 0) 58%);
  background-repeat: no-repeat;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--brand);
  text-decoration: none;
}

::selection {
  background: var(--brand-soft-2);
}

/* ------------------------------- 通用组件 ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.12s ease, background 0.16s ease, box-shadow 0.16s ease, opacity 0.16s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px) scale(0.995);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: linear-gradient(180deg, #e2571a, var(--brand));
  color: #fff;
  box-shadow: 0 2px 8px rgba(217, 72, 15, 0.28);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #d24a12, var(--brand-dark));
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-2);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}
.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.btn-soft:hover:not(:disabled) {
  background: var(--brand-soft-2);
}
.btn-danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-sm {
  padding: 6px 11px;
  font-size: 13px;
  border-radius: 8px;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.field .hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.input,
.textarea,
.select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 72, 15, 0.12);
}
.textarea {
  resize: vertical;
  min-height: 72px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.tag-brand {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: transparent;
}
.tag-green {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.tag-gray {
  background: #f2f0ee;
  color: #8a8480;
  border-color: transparent;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.mono {
  font-variant-numeric: tabular-nums;
}
.price {
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.price-sm {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}
.price::before {
  content: "¥";
  font-size: 0.78em;
  margin-right: 1px;
  font-weight: 700;
}

.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.5px;
}
.stars .off {
  color: #dfd6cd;
}

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}
.empty .emoji {
  font-size: 40px;
  display: block;
  margin-bottom: 10px;
  opacity: 0.75;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(90deg, #f3ece5 25%, #faf6f1 37%, #f3ece5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ------------------------------- 顾客端布局 ------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(180%) blur(14px);
  background: rgba(251, 247, 242, 0.86);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(145deg, #ff8a4c, var(--brand));
  display: grid;
  place-items: center;
  font-size: 17px;
  box-shadow: 0 3px 10px rgba(217, 72, 15, 0.3);
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}
.nav button {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.16s;
}
.nav button.active {
  background: var(--ink);
  color: #fff;
}
.nav button:hover:not(.active) {
  color: var(--ink);
  background: var(--surface-2);
}
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
}
.cart-btn .badge {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 120px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 26px 28px;
  background: linear-gradient(120deg, #2b211c 0%, #43302a 48%, #5b3a2c 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 82% 18%, rgba(255, 168, 92, 0.4), transparent 42%),
    radial-gradient(circle at 95% 90%, rgba(15, 118, 110, 0.35), transparent 46%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(22px, 3.4vw, 31px);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13.5px;
  max-width: 520px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.hero-badges span {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 22px;
  align-items: start;
}
.layout > * {
  min-width: 0;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.search {
  flex: 1 1 220px;
  position: relative;
}
.search input {
  width: 100%;
  min-width: 0;
  padding: 10px 14px 10px 36px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  outline: none;
}
.search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 72, 15, 0.1);
}
.search::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.6;
}

.cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar {
  display: none;
}
.cat-tabs button {
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: all 0.16s;
}
.cat-tabs button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(217, 72, 15, 0.26);
}
.cat-tabs .count {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 4px;
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 14px;
}

.dish {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.dish:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.dish.soldout {
  opacity: 0.62;
}
.dish-thumb {
  height: 96px;
  display: grid;
  place-items: center;
  font-size: 42px;
  background: radial-gradient(circle at 50% 120%, #ffe8d6, #fdf6ef 70%);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.dish-thumb .flag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(33, 26, 22, 0.72);
  color: #fff;
}
.dish-body {
  padding: 12px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.dish-name {
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dish-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.dish-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.dish-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}
.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px;
}
.stepper button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-dark);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.stepper button:disabled {
  opacity: 0.35;
  box-shadow: none;
}
.stepper .qty {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.add-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(217, 72, 15, 0.3);
  transition: transform 0.14s;
}
.add-btn:hover {
  transform: scale(1.08);
}

/* 购物车 */
.cart {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-height: calc(100vh - 96px);
}
.cart-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
}
.cart-head h3 {
  font-size: 14.5px;
}
.cart-items {
  padding: 6px 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}
.cart-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 8px;
  border-radius: 10px;
}
.cart-item:hover {
  background: var(--surface-2);
}
.cart-item .thumb {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: var(--bg-deep);
  flex: none;
}
.cart-item .info {
  flex: 1;
  min-width: 0;
}
.cart-item .name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item .meta {
  font-size: 11.5px;
  color: var(--muted);
}
.cart-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cart-total .price {
  font-size: 21px;
}
.cart-note {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

/* 订单 */
.order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.order-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line-strong);
  margin-bottom: 12px;
}
.order-no {
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.order-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.order-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}
.order-line .thumb {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--bg-deep);
  font-size: 15px;
  flex: none;
}
.order-line .grow {
  flex: 1;
  min-width: 0;
}
.order-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}

/* 状态徽标 */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-pending {
  background: #fff4e5;
  color: #b26a00;
}
.status-accepted {
  background: #e8f1ff;
  color: #1d5fbf;
}
.status-preparing {
  background: #f3ebff;
  color: #6b3fc7;
}
.status-completed {
  background: var(--accent-soft);
  color: var(--accent);
}
.status-cancelled {
  background: #f2f0ee;
  color: #8a8480;
}
.status-pending::before {
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

/* 时间轴 */
.timeline {
  display: flex;
  gap: 0;
  margin: 14px 0 4px;
  padding: 0;
  list-style: none;
}
.timeline li {
  flex: 1;
  position: relative;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  padding-top: 18px;
}
.timeline li::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e3d9cf;
  border: 2px solid var(--bg);
  z-index: 1;
}
.timeline li::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #eee4da;
}
.timeline li:last-child::after {
  display: none;
}
.timeline li.done {
  color: var(--brand-dark);
  font-weight: 600;
}
.timeline li.done::before {
  background: var(--brand);
}
.timeline li.done::after {
  background: var(--brand-soft-2);
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(35, 26, 20, 0.45);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
  animation: fade 0.18s ease;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.modal.wide {
  max-width: 620px;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 {
  font-size: 16px;
}
.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--surface-2);
}
.close-x {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 18px;
}
.close-x:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* 评分选择器 */
.rate-picker {
  display: flex;
  gap: 4px;
  font-size: 28px;
  line-height: 1;
}
.rate-picker span {
  cursor: pointer;
  color: #e2d8ce;
  transition: transform 0.12s, color 0.12s;
}
.rate-picker span.on {
  color: var(--gold);
}
.rate-picker span:hover {
  transform: scale(1.12);
}

/* Toast */
.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  max-width: 340px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(33, 26, 22, 0.94);
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: slidein 0.22s ease;
}
.toast.out {
  animation: slideout 0.2s ease forwards;
}
.toast .ic {
  font-size: 15px;
  line-height: 1.3;
}
.toast-error {
  background: rgba(160, 40, 30, 0.96);
}
.toast-success {
  background: rgba(15, 100, 90, 0.96);
}
@keyframes slidein {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
@keyframes slideout {
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}

/* 移动端底部购物车 */
.mobile-cart-bar {
  display: none;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .cart {
    display: none;
  }
  .mobile-cart-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    padding: 10px 12px 10px 16px;
    border-radius: 16px;
    background: rgba(33, 26, 22, 0.96);
    color: #fff;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
  }
  .mobile-cart-bar .grow {
    flex: 1;
  }
  .mobile-cart-bar .price {
    color: #ffb27a;
    font-size: 17px;
  }
  .page {
    padding-bottom: 96px;
  }
  .hero {
    padding: 20px 18px;
  }
  .dish-grid {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 10px;
  }
  .dish-thumb {
    height: 76px;
    font-size: 32px;
  }
  .nav {
    display: none;
  }
  .topbar-inner {
    padding: 10px 14px;
  }
  .page {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ============================ 商家端 ============================ */

.admin-shell {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  background: #221a16;
  color: #fff;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side .brand {
  color: #fff;
  padding: 4px 8px 18px;
}
.side .brand small {
  color: rgba(255, 255, 255, 0.45);
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: all 0.16s;
}
.side-nav button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.side-nav button.active {
  background: linear-gradient(100deg, var(--brand), #b8420d);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 72, 15, 0.34);
}
.side-nav .badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.side-foot {
  margin-top: auto;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}
.live-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #999;
}
.live-dot.on {
  color: #7ee0c8;
  background: rgba(15, 118, 110, 0.28);
}
.live-dot.on i {
  background: #35d0a5;
  animation: pulse 1.6s infinite;
}

.admin-main {
  min-width: 0;
  padding: 22px 26px 60px;
}
.admin-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.admin-head h2 {
  font-size: 20px;
}
.admin-head .sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.stat .value {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.stat .value small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 3px;
}
.stat.hl {
  background: linear-gradient(150deg, #fff5ec, #fff);
  border-color: #ffd9bd;
}
.stat.hl .value {
  color: var(--brand);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.order-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--line-strong);
  transition: box-shadow 0.2s;
}
.order-panel.fresh {
  animation: flash 1.4s ease;
}
@keyframes flash {
  0% {
    background: #fff3e6;
    box-shadow: 0 0 0 3px rgba(217, 72, 15, 0.2);
  }
}
.order-panel.p-pending {
  border-left-color: var(--brand);
}
.order-panel.p-accepted {
  border-left-color: #1d5fbf;
}
.order-panel.p-preparing {
  border-left-color: #6b3fc7;
}
.order-panel.p-completed {
  border-left-color: var(--accent);
}
.order-panel.p-cancelled {
  border-left-color: #b9b1aa;
}
.order-panel .who {
  font-size: 13.5px;
  font-weight: 700;
}
.order-panel .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  flex-wrap: wrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tbody tr:hover {
  background: var(--surface-2);
}
.table .actions {
  display: flex;
  gap: 6px;
}
.thumb-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}
.thumb-cell .emoji {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--bg-deep);
  font-size: 17px;
  flex: none;
}
.thumb-cell .nm {
  font-weight: 700;
}
.thumb-cell .ds {
  font-size: 11.5px;
  color: var(--muted);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.review-card.hidden {
  opacity: 0.55;
  background: repeating-linear-gradient(45deg, #faf7f4, #faf7f4 8px, #f5f0ea 8px, #f5f0ea 16px);
}
.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.review-body {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.review-reply {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--accent-soft);
  font-size: 12.5px;
  color: #0b5f59;
}

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px;
  border: 1px solid var(--line);
}
.login-card .logo-big {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ff8a4c, var(--brand));
  display: grid;
  place-items: center;
  font-size: 23px;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px rgba(217, 72, 15, 0.3);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  /* 手机上侧栏变成顶部两行：第一行 tab，第二行（在线状态 + 退出登录）右对齐 */
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 10px;
    /* 关键：不再让整条侧栏横向滚动，否则右侧按钮会被裁掉 */
    overflow: hidden;
    padding: 10px 12px;
  }
  .side .brand {
    display: none;
  }
  .side-nav {
    flex: 1 1 100%;
    min-width: 0;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .side-nav::-webkit-scrollbar {
    display: none;
  }
  .side-nav button {
    white-space: nowrap;
    padding: 8px 12px;
  }
  .side-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 100%;
    margin-top: 0;
    margin-left: 0;
    padding: 8px 0 0;
    justify-content: flex-end;
  }
  .side-foot #sideUser {
    display: none;
  }
  .side-foot .live-dot {
    font-size: 11px;
    white-space: nowrap;
  }
  .side-foot .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .admin-main {
    padding: 16px 14px 60px;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .table-wrap {
    overflow-x: auto;
  }
}

/* ============================================================
   移动端增强：底部导航 / 安装引导 / 安全区适配
   ============================================================ */

.tabbar {
  display: none;
}

/* 「添加到主屏」引导条 */
.install-hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(33, 26, 22, 0.96);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}
.install-hint-icon {
  font-size: 18px;
}
.install-hint-text {
  flex: 1;
  line-height: 1.45;
}
.install-hint-action {
  flex: none;
  border: 0;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
}
.install-hint-action:active {
  transform: scale(0.97);
}
.install-hint-close {
  flex: none;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  padding: 4px 2px;
}

@media (max-width: 960px) {
  .tabbar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }
  .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 7px 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 11px;
    color: var(--muted);
    border-radius: 10px;
    transition: color 0.15s ease;
  }
  .tabbar button.active {
    color: var(--brand);
    font-weight: 600;
  }
  .tabbar-icon {
    font-size: 19px;
    line-height: 1.15;
  }
  /* 购物车条抬到底部导航之上 */
  .mobile-cart-bar {
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }
  .page {
    padding-bottom: 150px;
  }
  /* 商家端：顶部横向导航留出安全区 */
  .side {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }
  .install-hint {
    bottom: calc(134px + env(safe-area-inset-bottom, 0px));
  }
}

/* 桌面端：安装提示收成右下角小卡片，不遮挡内容 */
@media (min-width: 961px) {
  .install-hint {
    left: auto;
    right: 20px;
    bottom: 20px;
    max-width: 380px;
  }
}
