/* ============================================================
   亚云家宴 · 云端菜单 —— 基础视觉层
   暖食欲色系 / 圆角卡片 / 柔和暖阴影 / 手机 375px 优先，桌面限宽 520px
   ============================================================ */

/* ---------- 色板与基础令牌 ---------- */
:root {
  --paper: #FAF5EC;
  --surface: #FFFDF8;
  --ink: #2B2118;
  --ink-soft: #6B5D4F;
  --chili: #C8371F;
  --chili-deep: #A02A15;
  --amber: #E8A33D;
  --scallion: #3E7C4F;
  --ginger: #D9A514;
  --danger: #B3261E;
  --info: #2F7E8C;
  --line: #EADFCE;
  --scrim: rgba(43, 33, 24, .45);

  --radius: 14px;
  --shadow: 0 6px 24px rgba(43, 33, 24, .10);
  --shadow-lift: 0 10px 28px rgba(43, 33, 24, .14);
  --ease-sheet: cubic-bezier(.32, .72, .28, 1);
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "Noto Serif SC", "STZhongsong", "SimSun", serif;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; }

/* hidden 属性优先于任何作者 display 声明（.fab/.badge 等） */
[hidden] { display: none !important; }

html {
  height: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--amber) transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  /* 双层暖光晕：琥珀右上、辣椒红左下 */
  background-image:
    radial-gradient(640px 420px at 100% 0%, rgba(232, 163, 61, .06), transparent 70%),
    radial-gradient(560px 400px at 0% 100%, rgba(200, 55, 31, .05), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* 细颗粒纹理覆盖层 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-conic-gradient(rgba(43, 33, 24, .015) 0% 25%, transparent 0% 50%);
  background-size: 4px 4px;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--info); text-decoration: none; }

::selection { background: rgba(232, 163, 61, .35); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .02em;
}

/* ---------- 定制滚动条（琥珀滑块 / 暖色透明轨道） ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--amber) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--amber);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--chili); }
*::-webkit-scrollbar-corner { background: transparent; }

/* ---------- 应用布局 ---------- */
#app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  /* 旧 iOS/WebView 无 dvh：先给 vh 与 fill-available 兜底，再被 dvh 覆盖 */
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: transparent;
}

#topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 56px;
  padding: 0 8px 0 16px;
  padding-top: env(safe-area-inset-top);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(43, 33, 24, .04);
}

#shopBrand {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 0;
}

#shopName {
  font-size: 20px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

#shopTagline {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--chili-deep);
}

#shopContact {
  margin-top: 1px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink-soft);
  white-space: nowrap;
}

#shopContact a {
  color: var(--chili);
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 19px;
  line-height: 1;
  border-radius: 12px;
  color: var(--ink);
  transition: background-color .15s ease, transform .12s ease;
}
.icon-btn:hover { background: color-mix(in srgb, var(--paper) 70%, var(--surface)); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 22px; height: 22px; }

#searchInput {
  flex: 1 1 100%;
  height: 44px;
  min-height: 0;
  margin: 0 8px 8px 0;
  padding: 8px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
#searchInput::placeholder { color: var(--ink-soft); }
#searchInput:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, .18);
}

#main {
  flex: 1;
  display: flex;
  min-height: 0;
}

#catRail {
  width: 88px;
  flex: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 60%, var(--surface));
  padding-bottom: env(safe-area-inset-bottom);
}

#dishList {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  scroll-behavior: smooth;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  user-select: none;
  transition: transform .12s ease, background-color .15s ease,
              border-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--chili);
  color: #FFFDF8;
  box-shadow: 0 4px 14px rgba(200, 55, 31, .25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--chili-deep);
  box-shadow: 0 6px 18px rgba(160, 42, 21, .30);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--amber);
}

.btn-danger {
  background: var(--danger);
  color: #FFFDF8;
  box-shadow: 0 4px 14px rgba(179, 38, 30, .22);
}
.btn-danger:hover:not(:disabled) { background: #8F1E18; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

/* ---------- 标签 chip（四色语义） ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.chip-推荐 { background: var(--amber); color: var(--ink); }
.chip-辣   { background: var(--chili); color: #FFFDF8; }
.chip-素   { background: var(--scallion); color: #FFFDF8; }
.chip-新品 { background: var(--info); color: #FFFDF8; }

/* ---------- 悬浮加菜按钮 ---------- */
.fab {
  position: fixed;
  right: max(16px, calc(50% - 260px + 16px));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--chili), var(--chili-deep));
  color: #FFFDF8;
  font-size: 15px;
  font-weight: 700;
  /* 辣椒红本体 + 琥珀描边光晕 */
  box-shadow: 0 8px 22px rgba(200, 55, 31, .35), 0 0 0 2px rgba(232, 163, 61, .35);
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}
.fab svg { flex: none; }
.fab:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 26px rgba(160, 42, 21, .40), 0 0 0 3px rgba(232, 163, 61, .5);
}
.fab:active { transform: scale(.96); }

/* ---------- 底部抽屉 sheet ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .24s ease;
}
.sheet-mask.open { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 41;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(43, 33, 24, .18);
  transform: translate(-50%, 100%);
  visibility: hidden;
  transition: transform 320ms var(--ease-sheet), visibility 0s linear 320ms;
}
.sheet.open {
  transform: translate(-50%, 0);
  visibility: visible;
  transition: transform 320ms var(--ease-sheet), visibility 0s;
}
/* 抽屉顶部抓手条 */
.sheet::before {
  content: "";
  display: block;
  flex: none;
  width: 36px;
  height: 4px;
  margin: -8px auto 12px;
  border-radius: 999px;
  background: var(--line);
}

/* ---------- 顶部提示 toast（语义四色左边条） ---------- */
#toastRoot {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 480px);
  pointer-events: none;
}

.toast {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border-left: 4px solid var(--info);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lift);
  pointer-events: auto;
  animation: toast-in .28s var(--ease-sheet) both;
}
.toast.leaving { animation: toast-out .22s ease both; }
.toast-success { border-left-color: var(--scallion); }
.toast-warning { border-left-color: var(--ginger); }
.toast-danger  { border-left-color: var(--danger); }
.toast-info    { border-left-color: var(--info); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}

/* ---------- 购物车角标 ---------- */
.badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
  animation: pop .24s var(--ease-sheet);
}

@keyframes pop {
  0%   { transform: scale(.4); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ---------- 分类窄栏条目 ---------- */
.rail-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px 8px 13px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  color: var(--ink-soft);
  word-break: break-all;
  transition: background-color .15s ease, color .15s ease;
}
.rail-item:hover { color: var(--ink); }
.rail-item.active {
  background: var(--surface);
  color: var(--chili);
  font-weight: 700;
}
.rail-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  border-radius: 0 3px 3px 0;
  background: var(--chili);
}

/* ---------- 表单字段 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.field input,
.field textarea,
.field select {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-soft); opacity: .8; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, .18);
}

/* ---------- 数量步进器 ---------- */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.stepper button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--chili);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  transition: background-color .15s ease, transform .12s ease;
}
.stepper button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
}
.stepper button:active { transform: scale(.94); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper .stepper-value,
.stepper output {
  min-width: 40px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ---------- 空状态 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}
.empty img,
.empty svg {
  width: 96px;
  height: 96px;
  opacity: .9;
}

/* ---------- 动效减弱（完全关闭过渡与动画） ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* ============================================================
   主界面视图层（Task 7 追加）：分类角标 / 菜品卡 / 搜索展开 /
   列表淡入 / 骨架屏 / 弹层内容 / toast 动作按钮
   ============================================================ */

body.no-scroll { overflow: hidden; }

/* ---------- 顶栏搜索展开/收起动画（整行展开，不挤压 375px 品牌区） ---------- */
#searchInput { animation: search-in .22s var(--ease-sheet); }
@keyframes search-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
}
#searchInput.is-closing { animation: search-out .18s ease both; }
@keyframes search-out {
  from {
    opacity: 1;
    transform: translateY(0);
    max-height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
  }
}
.icon-btn.active {
  color: var(--chili);
  background: color-mix(in srgb, var(--chili) 8%, var(--surface));
}

/* ---------- 分类栏：数量角标 / ＋分类 ---------- */
.rail-name { min-width: 0; }
.rail-count {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 24%, var(--surface));
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rail-item.active .rail-count { background: var(--amber); color: var(--ink); }
.rail-add {
  gap: 3px;
  min-height: 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}
.rail-add svg { width: 14px; height: 14px; }
.rail-add:hover { color: var(--chili); }

/* ---------- 菜品卡 ---------- */
.dish-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}
.dish-card:active { transform: scale(.99); }
.dish-thumb {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: var(--paper);
  border: 1px solid var(--line);
}
.dish-body { flex: 1; min-width: 0; }
.dish-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dish-cat { font-size: 11px; color: var(--ink-soft); line-height: 1.4; }
.dish-desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dish-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.dish-tags:empty { display: none; }
.chip-off { background: var(--line); color: var(--ink-soft); }
.dish-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.price {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--chili);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.quick-add {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--chili);
  color: #FFFDF8;
  box-shadow: 0 4px 12px rgba(200, 55, 31, .28);
  transition: transform .12s ease, background-color .15s ease;
}
.quick-add:hover { background: var(--chili-deep); }
.quick-add:active { transform: scale(.9); }
.quick-add svg { width: 20px; height: 20px; }
.dish-card.off { opacity: .6; }
.dish-card.off .dish-thumb { filter: grayscale(.7); }
.dish-card.off .price { color: var(--ink-soft); }

/* ---------- 列表切换淡入 ---------- */
.fade-in { animation: fade-in .24s ease both; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 骨架屏 ---------- */
.skel {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--line) 55%, var(--surface));
  border-radius: 8px;
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 253, 248, .75), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.skel-thumb { width: 64px; height: 64px; flex: none; border-radius: 10px; }
.skel-line { height: 12px; margin-bottom: 8px; }
.skel-line.w60 { width: 60%; }
.skel-line.w90 { width: 90%; }
.skel-line.w40 { width: 40%; }
.skel-price { width: 44px; height: 18px; flex: none; }
.skel-rail { height: 44px; margin: 10px; border-radius: 10px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- toast 布局与动作按钮 ---------- */
.toast { display: flex; align-items: center; gap: 10px; }
.toast-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}
.toast-icon svg { width: 18px; height: 18px; }
.toast-success .toast-icon { color: var(--scallion); }
.toast-warning .toast-icon { color: var(--ginger); }
.toast-danger .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--info); }
.toast-msg { flex: 1; min-width: 0; }
/* 撤销按钮：琥珀底 + 深色字（对比度 ≥ 7:1） */
.toast-action {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--amber);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.toast-action:active { transform: scale(.95); }

/* ---------- 弹层内容通用 ---------- */
.sheet-title { font-size: 18px; margin-bottom: 10px; }
.confirm-body {
  color: var(--ink-soft);
  font-size: 14px;
  white-space: pre-line;
  margin-bottom: 4px;
}
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }

/* ---------- 最小购物车清单（Task 8 替换） ---------- */
.mini-list { margin: 4px 0; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.mini-row:last-child { border-bottom: 0; }
.mini-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-qty { color: var(--ink-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.mini-price {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--chili);
  white-space: nowrap;
}
.mini-remove { color: var(--ink-soft); }
.mini-remove svg { width: 18px; height: 18px; }

/* ---------- 最小「我的」身份卡（Task 10 替换） ---------- */
.mine-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
}
.mine-role { font-size: 22px; color: var(--chili); }
.mine-shop { color: var(--ink-soft); font-size: 14px; }
.mine-hint { font-size: 14px; color: var(--ink-soft); }
.mine-uid { margin-top: 12px; font-size: 12px; color: var(--ink-soft); }

/* ---------- 最小菜品详情（Task 8 替换） ---------- */
.detail-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 12px;
}
.detail-price { font-size: 20px; margin: 2px 0 8px; }
.detail-desc {
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 10px;
  white-space: pre-line;
}

/* ---------- 空态补充 ---------- */
.empty-hint { font-size: 12px; opacity: .8; }

/* ============================================================
   详情 + 购物车视图层（Task 8 追加）：详情大图 / 数量行 /
   编辑者操作行 / 购物车条目（仅单价，无合计金额）
   ============================================================ */

/* ---------- 菜品详情 ---------- */
.detail-hero {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 12px;
}
.detail-hero-empty { display: grid; place-items: center; }
.detail-hero-empty img { width: 120px; height: 120px; opacity: .9; }
.detail-hero.is-placeholder { object-fit: contain; padding: 24px; }
.detail-name { font-size: 22px; }
.detail-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.detail-qty-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.detail-editor-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.detail-editor-row .btn { flex: 1; padding: 0 8px; font-size: 14px; }
.detail-editor-row .btn svg { width: 18px; height: 18px; }
.detail-del { color: var(--danger); }

/* ---------- 购物车条目 ---------- */
.cart-list { margin: 4px 0 14px; }
.cart-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.cart-row:last-child { border-bottom: 0; }
.cart-thumb {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: var(--paper);
  border: 1px solid var(--line);
}
.cart-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cart-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-price { font-size: 14px; }
.cart-stepper .stepper-value { min-width: 28px; }
.cart-remove { flex: none; color: var(--ink-soft); }
.cart-remove svg { width: 18px; height: 18px; }

/* ============================================================
   加菜/编辑表单 + 分类管理（Task 9 追加）：照片预览 / 标签切换 /
   字段错误定位 / 上架开关 / 分类管理行 / 新菜高亮入场
   ============================================================ */

/* ---------- 表单字段错误 ---------- */
.field.error input,
.field.error textarea,
.field.error select { border-color: var(--danger); }
.field.error input:focus,
.field.error textarea:focus,
.field.error select:focus { box-shadow: 0 0 0 3px rgba(179, 38, 30, .15); }
.field-msg { font-size: 12px; color: var(--danger); }

/* ---------- 照片区 ---------- */
.photo-box { display: flex; flex-direction: column; gap: 10px; }
.form-photo {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
}
.form-photo.is-placeholder { object-fit: contain; padding: 24px; }
.photo-pick { align-self: flex-start; }

/* ---------- 标签多选 chips ---------- */
.tag-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-toggle {
  border: 1px solid var(--line);
  min-height: 44px;
  padding: 2px 14px;
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease;
}
.chip-toggle[aria-pressed="false"] { background: var(--surface); color: var(--ink-soft); }
.chip-toggle[aria-pressed="true"] { border-color: transparent; }
.chip-toggle:active { transform: scale(.96); }

/* ---------- 上架开关（编辑时） ---------- */
.field-switch { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.field-switch label { font-size: 14px; color: var(--ink); cursor: pointer; }
/* 视觉轨道 48×28，命中区 56×44（padding + background-clip: content-box） */
.field .switch-input {
  appearance: none;
  -webkit-appearance: none;
  width: 56px;
  height: 44px;
  min-height: 44px;
  flex: none;
  padding: 8px 4px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  background-clip: content-box;
  position: relative;
  cursor: pointer;
  transition: background-color .18s ease;
}
.field .switch-input::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(43, 33, 24, .25);
  transition: transform .18s ease;
}
.field .switch-input:checked { background-color: var(--scallion); }
.field .switch-input:checked::after { transform: translateX(20px); }
.field .switch-input:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- 分类栏「管理」入口 ---------- */
.rail-manage {
  gap: 3px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}
.rail-manage svg { width: 14px; height: 14px; }
.rail-manage:hover { color: var(--chili); }

/* ---------- 分类管理 sheet ---------- */
.cat-manage-hint { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.cat-manage-list { margin: 4px 0; }
.cat-manage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.cat-manage-row:last-child { border-bottom: 0; }
.cat-manage-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-manage-actions { display: flex; flex: none; gap: 2px; }
.cat-act {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ink-soft);
  transition: background-color .15s ease, color .15s ease;
}
.cat-act:hover:not(:disabled) { background: var(--paper); color: var(--chili); }
.cat-act:disabled { opacity: .3; cursor: not-allowed; }
.cat-act svg { width: 18px; height: 18px; }
.cat-act.rot-up svg { transform: rotate(90deg); }
.cat-act.rot-down svg { transform: rotate(-90deg); }
.cat-del { color: var(--danger); }
.cat-rename {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--amber);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}
.cat-manage-empty { padding: 16px 0; text-align: center; color: var(--ink-soft); font-size: 14px; }
.cat-danger-hint { font-size: 12px; color: var(--ink-soft); }

/* ---------- 新菜品高亮入场（琥珀光晕 1.2s） ---------- */
.dish-card.highlight-in { animation: highlight-in 1.2s ease both; }
@keyframes highlight-in {
  0% {
    background: color-mix(in srgb, var(--amber) 36%, var(--surface));
    box-shadow: 0 0 0 3px rgba(232, 163, 61, .35), var(--shadow);
    transform: translateY(-3px);
  }
  60% { background: color-mix(in srgb, var(--amber) 18%, var(--surface)); }
  100% { background: var(--surface); }
}

/* ============================================================
   「我的」身份页（Task 10 追加）：身份卡昵称 / 状态提示 /
   申请按钮 / 管理员入口行
   ============================================================ */

.mine-nick { font-size: 14px; color: var(--ink); }
.mine-hint.is-revoked { color: var(--danger); }
.mine-cta { width: 100%; margin-top: 12px; }
.mine-rows {
  margin-top: 14px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}
.mine-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 2px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.mine-row svg { width: 20px; height: 20px; flex: none; color: var(--ink-soft); }
.mine-row-label { flex: 1; min-width: 0; }
.mine-row::after {
  content: "›";
  flex: none;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1;
}
.mine-row:hover { color: var(--chili); }
.mine-row:hover svg,
.mine-row:hover::after { color: var(--chili); }

/* 管理中心行新订单角标（Task 10 预留接口，Task 11 经 setMineBadge 填充） */
.mine-badge {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--chili);
  color: #FFFDF8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   管理中心（Task 11 追加）：三 tab / 审批行 / 订单卡 / 设置区 /
   顶栏新订单圆点
   ============================================================ */

/* 顶栏「我的」新订单圆点（打开管理中心后由 JS 清除） */
#btnMine.has-dot::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--chili);
  box-shadow: 0 0 0 2px var(--surface);
  animation: pop .24s var(--ease-sheet);
}

/* ---------- 分区 tab ---------- */
.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.admin-tab {
  flex: 1;
  min-height: 44px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  transition: background-color .15s ease, color .15s ease;
}
.admin-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--chili);
  box-shadow: 0 1px 6px rgba(43, 33, 24, .10);
}
.admin-tab:hover { color: var(--chili); }

/* ---------- 内容滚动区（弹层为固定高度 flex 列，仅此处滚动，不再套第二层滚动） ---------- */
.admin-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}
.admin-loading {
  padding: 32px 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}
.admin-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 0;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
}
.admin-empty { padding: 40px 16px; }
.admin-section-title {
  margin: 12px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.admin-section:first-child .admin-section-title { margin-top: 0; }
.admin-list { margin: 0; }
.admin-none {
  padding: 10px 0;
  color: var(--ink-soft);
  font-size: 13px;
}

/* ---------- 审批行 ---------- */
.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.admin-row:last-child { border-bottom: 0; }
.admin-row-main { flex: 1; min-width: 0; }
.admin-nick {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-meta { font-size: 12px; color: var(--ink-soft); }
.admin-row-actions { display: flex; flex: none; gap: 6px; }
.admin-act {
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
}
.admin-act-deny { color: var(--danger); }

/* ---------- 订单卡 ---------- */
.order-card {
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.order-card:last-child { margin-bottom: 0; }
.order-card.is-done {
  opacity: .6;
  background: color-mix(in srgb, var(--paper) 55%, var(--surface));
}
.order-head { display: flex; align-items: center; gap: 8px; }
.order-nick {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-time { flex: none; font-size: 12px; color: var(--ink-soft); }
.chip-new { background: var(--chili); color: #FFFDF8; }
.chip-done { background: var(--line); color: var(--ink-soft); }
.order-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.order-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}
.order-item-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-item-qty {
  flex: none;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.order-item-price { flex: none; font-size: 12px; color: var(--ink-soft); }
.order-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  background: color-mix(in srgb, var(--amber) 15%, var(--surface));
  font-size: 13px;
  color: var(--ink);
  word-break: break-word;
}
.order-done-btn {
  width: 100%;
  margin-top: 10px;
  font-size: 14px;
}
.order-done-btn svg { width: 18px; height: 18px; }

/* ---------- 设置区 ---------- */
.admin-setting {
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px dashed var(--line);
}
.admin-setting:last-of-type { border-bottom: 0; }
.admin-save {
  width: 100%;
  margin-bottom: 4px;
}
.admin-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ============================================================
   视觉精修（Task 12 追加）：店名印章 / 桌机手机框 / 管理中心
   固定高度弹层 / 触屏 hover 抑制 / 启动兜底态
   ============================================================ */

/* ---------- 顶栏店名印章（「乡味」白文辣椒红底，与标题同排） ---------- */
.shop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.shop-head #shopName { min-width: 0; }
.shop-seal {
  flex: none;
  width: 44px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(150deg, var(--chili), var(--chili-deep));
  color: #FFFDF8;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  user-select: none;
  /* 内描边做出印章边缘，外投影让印章浮在纸面之上 */
  box-shadow: inset 0 0 0 1px rgba(255, 253, 248, .30), 0 2px 6px rgba(160, 42, 21, .28);
}

/* ---------- 触屏设备抑制 :hover 残留（卡片上浮/按钮增亮只在有指针时生效） ---------- */
@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
  .fab:hover { filter: none; }
}

/* ---------- 启动兜底态（index.html 看门狗注入） ---------- */
.boot-error { padding-top: 40px; }
.boot-error .empty-hint { max-width: 240px; }

/* ---------- 管理中心：固定高度、仅内容区滚动 ---------- */
.sheet-admin {
  display: flex;
  flex-direction: column;
  /* 旧 iOS/WebView 兜底：先用 86vh 与安全区等效式，再被 dvh 覆盖 */
  height: 86vh;
  height: min(86vh, calc(100vh - env(safe-area-inset-top) - 16px));
  height: min(86dvh, calc(100dvh - env(safe-area-inset-top) - 16px));
  overflow: hidden;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.sheet-admin > .sheet-title,
.sheet-admin > .admin-tabs,
.sheet-admin > .sheet-actions { flex: none; }
.sheet-admin > .sheet-actions { margin-top: 12px; }

/* ---------- 桌机：520px 居中「手机框」+ 暖色背景光晕 ---------- */
@media (min-width: 560px) {
  body {
    padding: 24px 0;
    background-image:
      radial-gradient(820px 560px at 82% 10%, rgba(232, 163, 61, .22), transparent 68%),
      radial-gradient(720px 520px at 14% 90%, rgba(200, 55, 31, .16), transparent 70%),
      linear-gradient(160deg, #F7EFE2, #EFE1CA);
  }
  #app {
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--paper);
    box-shadow:
      0 30px 70px rgba(43, 33, 24, .22),
      0 0 0 8px rgba(255, 253, 248, .55),
      0 0 120px rgba(232, 163, 61, .28);
  }
  /* 弹层/吐司/悬浮按钮跟随手机框内缩，不再贴浏览器窗口边缘 */
  .sheet {
    bottom: 24px;
    border-radius: 20px;
  }
  #toastRoot { top: 36px; }
  .fab { bottom: calc(44px + env(safe-area-inset-bottom)); }
}

/* ---------- 窄屏表单控件 16px：iOS Safari 聚焦时不再自动放大页面 ---------- */
@media (max-width: 559px) {
  input, textarea, select { font-size: 16px; }
}
