/* =========================================================
   小厨房 · 暖色手作感样式
   ========================================================= */

:root {
  --cream: #fff6ec;
  --paper: #fffdf9;
  --ink: #3c2b26;
  --ink-soft: #5b4640;
  --muted: #8b7870;
  --line: #f0dfd1;
  --line-strong: #e6cdb9;
  --tomato: #e4573d;
  --tomato-dark: #c9452e;
  --honey: #f5b14c;
  --sage: #6f9f80;
  --sage-soft: #e7f2e9;
  --shadow-sm: 0 4px 14px rgba(92, 58, 45, 0.06);
  --shadow-md: 0 12px 34px rgba(92, 58, 45, 0.1);
  --shadow-lg: 0 24px 60px rgba(60, 43, 38, 0.22);
  --radius: 22px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 120px;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--cream);
  background-image: radial-gradient(circle at 6% 2%, rgba(245, 177, 76, 0.2), transparent 30rem),
    radial-gradient(circle at 96% 12%, rgba(228, 87, 61, 0.1), transparent 28rem),
    radial-gradient(circle at 50% 104%, rgba(111, 159, 128, 0.14), transparent 30rem);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.bg-deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-deco::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(120, 80, 60, 0.07) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 62%);
  mask-image: linear-gradient(to bottom, #000, transparent 62%);
  opacity: 0.55;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}

.blob-a {
  width: 340px;
  height: 340px;
  background: rgba(245, 177, 76, 0.35);
  top: -140px;
  left: -100px;
}

.blob-b {
  width: 300px;
  height: 300px;
  background: rgba(228, 87, 61, 0.16);
  top: 30%;
  right: -150px;
}

.blob-c {
  width: 320px;
  height: 320px;
  background: rgba(111, 159, 128, 0.24);
  bottom: -180px;
  left: 30%;
}

/* ------------------------------- 顶部 ------------------------------- */

.topbar {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-badge {
  flex: none;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transform: rotate(-4deg);
}

.brand-badge svg {
  width: 36px;
  height: 36px;
  display: block;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  font-size: clamp(22px, 3.4vw, 27px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text p {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.random-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 650;
  background: rgba(255, 253, 249, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.random-btn:hover {
  transform: translateY(-1px) rotate(-1deg);
  border-color: var(--line-strong);
  background: #fff;
}

.random-btn:active {
  transform: scale(0.97);
}

/* ------------------------------- 导航 ------------------------------- */

.tabs-wrap {
  position: sticky;
  top: 10px;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  margin: 24px auto 0;
  pointer-events: none;
}

.tabs {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(240, 223, 209, 0.9);
  border-radius: 999px;
  box-shadow: 0 8px 26px rgba(92, 58, 45, 0.09);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 17px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tab:hover {
  background: rgba(240, 223, 209, 0.5);
}

.tab.is-active {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 6px 16px rgba(60, 43, 38, 0.25);
}

.tab-badge {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--tomato);
  border-radius: 999px;
}

.tab.is-active .tab-badge {
  color: var(--tomato-dark);
  background: #fff;
}

/* ------------------------------- 布局 ------------------------------- */

.page {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 24px 20px;
}

.view {
  display: none;
  animation: view-in 0.35s ease both;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 18px;
}

.section-head h2,
.admin-head h2 {
  font-size: clamp(26px, 3.8vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-sub {
  margin-top: 7px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.menu-count {
  flex: none;
  padding-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------- 公告 ------------------------------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px 20px;
  margin-bottom: 30px;
  background: linear-gradient(135deg, #fff2e3, #fff9ef 70%);
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
}

.notice-emoji {
  font-size: 22px;
  line-height: 1.4;
  transform: rotate(-6deg);
}

.notice p {
  font-size: 13.5px;
  line-height: 1.7;
  color: #6f554a;
}

/* ------------------------------- 分类 ------------------------------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(255, 253, 249, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.18s ease;
}

.chip:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.chip.is-active {
  color: #fff;
  background: var(--tomato);
  border-color: var(--tomato);
  box-shadow: 0 6px 16px rgba(228, 87, 61, 0.24);
}

.chip small {
  font-size: 10.5px;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------- 菜品卡 ------------------------------- */

.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.dish-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  animation: card-in 0.3s ease both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
}

.dish-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.dish-card.is-off {
  opacity: 0.7;
}

.dish-card.is-off .dish-cover-img {
  filter: grayscale(1);
}

.dish-card.is-off:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.dish-grid.no-anim .dish-card {
  animation: none;
}

.dish-grid > .empty {
  grid-column: 1 / -1;
}

.dish-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fdf0e3;
}

.dish-cover.no-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.65) 1.5px, transparent 1.6px);
  background-size: 18px 18px;
  opacity: 0.6;
}

.dish-cover-emoji {
  position: relative;
  z-index: 1;
  font-size: 58px;
  line-height: 1;
  filter: drop-shadow(0 8px 12px rgba(92, 58, 45, 0.16));
}

.dish-cover-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.dish-card:hover .dish-cover-img {
  transform: scale(1.035);
}

.dish-off-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(60, 43, 38, 0.82);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.dish-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 15px 17px 17px;
}

.dish-top {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.dish-emoji {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 28px;
  border-radius: 17px;
  background: #fdf0e3;
}

.dish-info {
  flex: 1;
  min-width: 0;
}

.dish-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dish-name-row h3 {
  font-size: 17.5px;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dish-qty {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--tomato-dark);
  background: rgba(255, 253, 249, 0.92);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(92, 58, 45, 0.14);
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}

.dish-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  min-height: 39px;
}

.dish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
}

.tag {
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: #7c655b;
  background: #faf2e9;
  border-radius: 999px;
  white-space: nowrap;
}

.tag-cat {
  color: #6f7f70;
  background: #eef4ee;
}

.dish-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.dish-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}

.dish-state i {
  width: 6px;
  height: 6px;
  background: #b9cbbd;
  border-radius: 50%;
}

.dish-card:not(.is-off) .dish-state {
  color: #5c8468;
}

.dish-card:not(.is-off) .dish-state i {
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(111, 159, 128, 0.15);
}

.add-btn {
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  transition: background 0.18s ease, transform 0.18s ease;
}

.add-btn:hover {
  background: var(--tomato);
  transform: translateY(-1px);
}

.add-btn:active {
  transform: scale(0.95);
}

.add-btn.has-cart {
  background: var(--tomato);
}

.dish-card.is-off .add-btn {
  background: #cbbcb2;
  cursor: not-allowed;
}

/* 分类配色 */
.cat-meat {
  background: #ffeadf;
}
.cat-veg {
  background: #e9f3e6;
}
.cat-soup {
  background: #e8f1f7;
}
.cat-staple {
  background: #fdf0d7;
}
.cat-sweet {
  background: #fbe9ef;
}
.cat-drink {
  background: #eeeaf9;
}
.cat-other {
  background: #f1ede9;
}

.loading-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 13px;
}

.loading-egg {
  font-size: 38px;
  animation: bob 1.4s ease-in-out infinite;
}

@keyframes bob {
  50% {
    transform: translateY(-6px) rotate(-5deg);
  }
}

/* ------------------------------- 空状态 ------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 54px 24px;
  background: rgba(255, 253, 249, 0.7);
  border: 1px dashed var(--line-strong);
  border-radius: 26px;
}

.empty-emoji {
  font-size: 46px;
  margin-bottom: 12px;
}

.empty h3 {
  font-size: 19px;
  font-weight: 750;
}

.empty p {
  max-width: 340px;
  margin: 8px 0 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

/* ------------------------------- 按钮 ------------------------------- */

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--tomato);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(228, 87, 61, 0.25);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn:hover {
  background: var(--tomato-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(228, 87, 61, 0.32);
}

.primary-btn:active {
  transform: scale(0.97);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.primary-btn.big {
  padding: 14px 26px;
  font-size: 14px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-soft);
  background: rgba(255, 253, 249, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.18s ease;
}

.ghost-btn:hover {
  background: #fff;
  border-color: var(--line-strong);
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: #c5432f;
  border: 0;
  border-radius: 999px;
  transition: background 0.18s ease;
}

.danger-btn:hover {
  background: #a93725;
}

.icon-btn {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--muted);
  background: #f7ede3;
  border: 0;
  border-radius: 50%;
  transition: all 0.18s ease;
}

.icon-btn:hover {
  color: var(--ink);
  background: #f0e0d1;
}

/* ------------------------------- 购物车浮条 ------------------------------- */

.cart-bar {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 35;
  width: min(560px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px 10px 20px;
  color: #fff;
  background: rgba(60, 43, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(60, 43, 38, 0.36);
  backdrop-filter: blur(10px);
  animation: cart-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes cart-in {
  from {
    opacity: 0;
    transform: translate(-50%, 24px);
  }
}

.cart-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cart-bar-emoji {
  font-size: 20px;
}

.cart-bar-info strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.cart-bar-info small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-bar-btn {
  flex: none;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 750;
  color: var(--ink);
  background: var(--honey);
  border: 0;
  border-radius: 999px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.cart-bar-btn:hover {
  background: #ffc266;
  transform: translateY(-1px);
}

/* ------------------------------- 遮罩 / 弹层 ------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(60, 43, 38, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in 0.2s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 60;
  width: min(560px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheet-in 0.32s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

@keyframes sheet-in {
  from {
    transform: translate(-50%, 100%);
  }
}

.sheet-grab {
  width: 42px;
  height: 4px;
  margin: 10px auto 2px;
  background: #ead9ca;
  border-radius: 999px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px 14px;
}

.sheet-head h3 {
  font-size: 18px;
  font-weight: 800;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 22px;
  overscroll-behavior: contain;
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.cart-total strong {
  display: block;
  font-size: 14px;
  font-weight: 750;
}

.cart-total small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

/* 购物车行 */
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item-emoji {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 22px;
  background: #faf1e6;
  border-radius: 14px;
}

.cart-item-emoji img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-info small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.stepper {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #f7ede3;
  border-radius: 999px;
}

.stepper button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 50%;
  transition: background 0.15s ease;
}

.stepper button:hover {
  background: #fff;
}

.stepper span {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

/* 表单 */
.field {
  display: block;
  margin: 16px 0;
}

.field > span,
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-soft);
}

.field em {
  color: var(--tomato);
  font-style: normal;
}

.field small {
  font-weight: 500;
  color: var(--muted);
  font-size: 11px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field textarea {
  resize: vertical;
  min-height: 56px;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--tomato);
  box-shadow: 0 0 0 4px rgba(228, 87, 61, 0.1);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #c1ada1;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row .field {
  margin: 0;
}

.form-error {
  min-height: 18px;
  margin: 6px 0 0;
  font-size: 12px;
  color: #c5432f;
  line-height: 1.5;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 4px;
  background: #f7ede3;
  border-radius: 14px;
}

.segmented button {
  padding: 9px 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 11px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(92, 58, 45, 0.1);
}

/* 弹窗 */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 70;
  width: min(470px, calc(100% - 32px));
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  background: var(--paper);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.97);
  }
}

.modal.small {
  width: min(380px, calc(100% - 40px));
  padding: 24px;
}

.modal.small h3 {
  font-size: 18px;
  font-weight: 800;
}

.modal.small p {
  margin: 10px 0 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.modal-head h3 {
  font-size: 19px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .form-error {
  flex: 1;
  margin: 0;
}

.photo-editor {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.photo-preview {
  position: relative;
  flex: none;
  width: 152px;
  height: 104px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fbf4ec;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.photo-preview:hover,
.photo-preview.is-dragover {
  background: #fff1e9;
  border-color: var(--tomato);
}

.photo-preview.has-image {
  border-style: solid;
  border-color: var(--line);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-placeholder {
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(92, 58, 45, 0.12));
}

.photo-empty-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}

.photo-preview.is-busy::after {
  content: "处理中…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.78);
}

.photo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 2px;
}

.photo-actions .ghost-btn {
  padding: 8px 14px;
  font-size: 12px;
}

.photo-hint {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
}

.danger-ghost {
  color: #b04a37;
  background: #fdf3ef;
  border-color: #f0d3ca;
}

.danger-ghost:hover {
  background: #fbe8e2;
  border-color: #e8c3b8;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.emoji-btn {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: #fbf4ec;
  border: 1.5px solid transparent;
  border-radius: 12px;
  transition: all 0.15s ease;
}

.emoji-btn:hover {
  background: #fff;
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.emoji-btn.is-active {
  background: #ffece4;
  border-color: var(--tomato);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 6px;
  padding: 14px 16px;
  background: #fbf4ec;
  border-radius: 16px;
  cursor: pointer;
}

.switch-row strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}

.switch-row small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.switch-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch {
  flex: none;
  position: relative;
  width: 46px;
  height: 28px;
  background: #e4d5c8;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(60, 43, 38, 0.2);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.switch-row input:checked + .switch {
  background: var(--sage);
}

.switch-row input:checked + .switch::after {
  transform: translateX(18px);
}

/* ------------------------------- 订单 ------------------------------- */

.order-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
}

.order-card {
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}

.order-card.status-pending {
  border-left: 4px solid var(--honey);
}

.order-card.status-cooking {
  border-left: 4px solid #5b95d6;
}

.order-card.status-done {
  border-left: 4px solid var(--sage);
}

.order-card.status-cancelled {
  border-left: 4px solid #c8b7ac;
  opacity: 0.72;
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.order-no {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.order-time {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.status-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 750;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.st-pending {
  color: #a26a08;
  background: #fff0d6;
}

.st-cooking {
  color: #2f6fb5;
  background: #e4f0ff;
}

.st-done {
  color: #3f7a53;
  background: #e5f4e9;
}

.st-cancelled {
  color: #8b7870;
  background: #f1ece9;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 16px 0 6px;
  padding: 0 2px;
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: #b9a79b;
}

.step i {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  background: #e7d9cd;
  border-radius: 50%;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 9px;
  width: calc(100% - 9px);
  height: 1.5px;
  background: #eee0d4;
}

.step.is-done {
  color: var(--ink-soft);
}

.step.is-done i {
  background: var(--tomato);
  box-shadow: 0 0 0 3px rgba(228, 87, 61, 0.12);
}

.step.is-done:not(:last-child)::after {
  background: #f2c4b7;
}

.order-items {
  list-style: none;
  margin: 12px 0 0;
  padding: 12px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-items li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
}

.oi-emoji {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 16px;
  border-radius: 7px;
}

.oi-emoji img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.oi-name {
  flex: 1;
  font-weight: 600;
}

.oi-qty {
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.order-note {
  margin-top: 11px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: #7a5c4c;
  background: #fff7e9;
  border-radius: 10px;
  overflow-wrap: anywhere;
}

.order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.order-meta {
  font-size: 11.5px;
  color: var(--muted);
}

.order-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.mini-btn {
  padding: 7px 13px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  background: #f7ede3;
  border: 0;
  border-radius: 999px;
  transition: all 0.18s ease;
}

.mini-btn:hover {
  background: #efe0d2;
}

.mini-btn.primary {
  color: #fff;
  background: var(--tomato);
}

.mini-btn.primary:hover {
  background: var(--tomato-dark);
}

.mini-btn.success {
  color: #fff;
  background: var(--sage);
}

.mini-btn.success:hover {
  background: #5d8a6d;
}

.mini-btn.danger {
  color: #b04a37;
  background: #fbe9e4;
}

.mini-btn.danger:hover {
  background: #f6d8d0;
}

/* ------------------------------- 管理 ------------------------------- */

.lock-card {
  max-width: 430px;
  margin: 26px auto 0;
  padding: 38px 30px 30px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}

.lock-emoji {
  width: 66px;
  height: 66px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: #fff2df;
  border-radius: 22px;
  transform: rotate(3deg);
}

.lock-card h2 {
  font-size: 24px;
  font-weight: 800;
}

.lock-card > p {
  margin: 8px 0 22px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.pin-form {
  display: flex;
  gap: 8px;
}

.pin-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.12em;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.pin-form input:focus {
  border-color: var(--tomato);
  box-shadow: 0 0 0 4px rgba(228, 87, 61, 0.1);
}

.pin-form .primary-btn {
  flex: none;
}

.lock-card .form-error {
  margin-top: 10px;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.stat strong {
  display: block;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.stat-accent {
  background: linear-gradient(135deg, #fff1e0, #fff8ee);
  border-color: #f2d6b8;
}

.stat-accent strong {
  color: var(--tomato-dark);
}

.panel-card {
  padding: 22px;
  margin-bottom: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
}

.panel-head h3 {
  font-size: 17px;
  font-weight: 800;
}

.panel-head p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.panel-head .primary-btn {
  flex: none;
  padding: 9px 16px;
  font-size: 12.5px;
}

.admin-dish-list {
  display: flex;
  flex-direction: column;
}

.admin-dish {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}

.admin-dish:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.admin-dish-emoji {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 21px;
  border-radius: 13px;
}

.admin-dish-emoji img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.admin-dish-info {
  flex: 1;
  min-width: 0;
}

.admin-dish-info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-dish-info small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-dish-info .is-off-text {
  color: #b98a6a;
}

.admin-dish-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-switch {
  flex: none;
  position: relative;
  width: 38px;
  height: 23px;
  cursor: pointer;
}

.mini-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mini-switch .switch {
  position: absolute;
  inset: 0;
  width: 38px;
  height: 23px;
}

.mini-switch .switch::after {
  width: 17px;
  height: 17px;
}

.mini-switch input:checked + .switch {
  background: var(--sage);
}

.mini-switch input:checked + .switch::after {
  transform: translateX(15px);
}

.admin-empty {
  padding: 26px 0 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

.settings-form {
  margin-top: 14px;
}

.settings-form .field {
  margin: 13px 0;
}

.settings-form .field > span {
  font-size: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
}

.form-actions .form-error {
  margin: 0;
}

/* ------------------------------- 下单成功 ------------------------------- */

.success-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, #fffaf3, #ffeeda 70%);
  animation: fade-in 0.3s ease both;
}

.success-card {
  position: relative;
  width: min(420px, 100%);
  padding: 34px 28px 30px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow-md);
  animation: pop-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(14px);
  }
}

.success-card::before,
.success-card::after {
  position: absolute;
  font-size: 28px;
  opacity: 0;
  animation: heart-float 3.4s ease-in-out infinite;
}

.success-card::before {
  content: "💗";
  top: 26px;
  left: 22px;
  animation-delay: 0.2s;
}

.success-card::after {
  content: "💛";
  top: 50px;
  right: 24px;
  animation-delay: 1.1s;
}

@keyframes heart-float {
  0%,
  100% {
    opacity: 0;
    transform: translateY(8px) rotate(-8deg);
  }
  35%,
  65% {
    opacity: 0.9;
    transform: translateY(-6px) rotate(6deg);
  }
}

.success-emoji {
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  font-size: 42px;
  background: #fff2df;
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(245, 177, 76, 0.12);
  animation: bob 2.2s ease-in-out infinite;
}

.success-eyebrow {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: var(--tomato);
}

.success-card h2 {
  margin-top: 7px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.success-desc {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.success-desc strong {
  color: var(--ink);
  font-weight: 800;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 24px;
}

.success-actions .ghost-btn {
  border-color: transparent;
  background: transparent;
}

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

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -14px);
  z-index: 120;
  max-width: calc(100% - 32px);
  padding: 11px 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(60, 43, 38, 0.96);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(60, 43, 38, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------- 响应式 ------------------------------- */

@media (min-width: 700px) {
  .sheet {
    bottom: 16px;
    border-radius: 28px;
    max-height: 86vh;
  }

  .sheet-grab {
    display: none;
  }

  .sheet-head {
    padding-top: 20px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 22px 18px 0;
  }

  .brand-badge {
    width: 46px;
    height: 46px;
    font-size: 24px;
    border-radius: 15px;
  }

  .brand-text h1 {
    font-size: 21px;
  }

  .brand-text p {
    font-size: 11px;
  }

  .random-btn {
    padding: 9px 12px;
    font-size: 12px;
  }

  .random-btn span:last-child {
    display: none;
  }

  .tabs-wrap {
    top: 8px;
    padding: 0 14px;
    margin-top: 18px;
  }

  .tabs {
    width: 100%;
    justify-content: space-between;
  }

  .tab {
    flex: 1;
    justify-content: center;
    padding: 9px 8px;
    font-size: 12.5px;
  }

  .page {
    padding: 26px 18px 20px;
  }

  .section-head h2,
  .admin-head h2 {
    font-size: 26px;
  }

  .notice {
    padding: 14px 16px;
    margin-bottom: 24px;
  }

  .notice p {
    font-size: 12.5px;
  }

  .chips {
    padding-right: 22px;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 26px), transparent);
  }

  .dish-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .dish-card {
    padding: 0;
  }

  .dish-cover {
    aspect-ratio: 16 / 9;
  }

  .dish-desc {
    min-height: 0;
  }

  .photo-preview {
    width: 132px;
    height: 96px;
    border-radius: 14px;
  }

  .photo-actions .ghost-btn {
    padding: 8px 12px;
    font-size: 11.5px;
  }

  .photo-hint {
    font-size: 10px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
  }

  .stat {
    padding: 13px 15px;
  }

  .stat strong {
    font-size: 23px;
  }

  .panel-card {
    padding: 17px;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-head .primary-btn {
    align-self: flex-start;
  }

  .admin-dish {
    flex-wrap: wrap;
    gap: 9px;
  }

  .admin-dish-info {
    flex: 1 1 45%;
  }

  .admin-dish-actions {
    width: 100%;
    justify-content: flex-end;
    padding-left: 51px;
  }

  .admin-head {
    align-items: center;
  }

  .emoji-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
  }

  .emoji-btn {
    font-size: 17px;
    border-radius: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-row .field {
    margin: 13px 0;
  }

  .sheet-body {
    padding: 0 18px;
  }

  .sheet-head,
  .sheet-foot {
    padding-left: 18px;
    padding-right: 18px;
  }

  .cart-bar {
    padding-left: 16px;
  }

  .cart-bar-info small {
    max-width: 150px;
  }

  .order-card {
    padding: 16px;
  }

  .order-actions {
    width: 100%;
    margin-left: 0;
  }

  .order-actions .mini-btn {
    flex: 1;
    text-align: center;
  }

  .success-card {
    padding: 28px 22px 24px;
  }

  .success-card h2 {
    font-size: 26px;
  }
}

@media (max-width: 360px) {
  .segmented button {
    font-size: 11px;
  }

  .tab {
    font-size: 11.5px;
  }

  .brand-text p {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 键盘焦点 */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--tomato);
  outline-offset: 2px;
}
