/* ============================================================
   我家小厨房 主样式
   暖橙 + 奶白基底的温馨简约风；768px 断点切换移动端布局
   ============================================================ */

:root {
  --bg: #fafafa;
  --bg-2: #f2f3f5;
  --card: #ffffff;
  --card-2: #fcfcfd;
  /* 页面背景斜向渐变：近白 → 极浅灰（比原来的奶油橘更干净） */
  --bg-grad-a: #ffffff;
  --bg-grad-b: #eef1f5;
  --primary: #ff8c42;
  --primary-2: #ffa96b;
  --primary-soft: #ffe7d6;
  --primary-dim: #ffd2b3;
  --pink: #ffd9e2;
  --pink-deep: #ff9fb6;
  --blue: #d9e9ff;
  --blue-deep: #79a9f0;
  --green: #cdebd4;
  --green-deep: #4fae6b;
  --amber: #ffe8b8;
  --amber-deep: #e0a030;
  --red: #ffe9e6;
  --red-deep: #d05a4c;
  --purple: #e3d9ff;
  --purple-deep: #8a6fe0;
  --text: #4a3b31;
  --text-2: #8c7a6e;
  --text-3: #b8a99d;
  --line: #f3e4d7;
  --shadow: 0 6px 24px rgba(214, 163, 116, 0.12);
  --shadow-lg: 0 16px 48px rgba(214, 163, 116, 0.2);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --sidebar-w: 216px;
  --tabbar-h: 46px;
  --topbar-h: 54px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
/* 页面背景：同色系斜向渐变（左上角纯浅 → 右下角纯深）；用 fixed 伪元素铺满视口，避免 background-attachment 在移动端的问题 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(135deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 100%);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* 手机端点击不出现系统默认的矩形高亮/聚焦框（保留键盘聚焦轮廓） */
* { -webkit-tap-highlight-color: transparent; }
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
label:focus:not(:focus-visible) { outline: none; }

/* ---------------- 布局 ---------------- */
/* 桌面端内容区铺满侧边栏以外的全部宽度，菜品网格按可用宽度自动增加列数 */
.app { display: flex; justify-content: center; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  /* fixed 让渐变按视口坐标取样：与 body::before 的斜向渐变在分界处无缝衔接 */
  background: linear-gradient(135deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 100%);
  background-attachment: fixed;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  gap: 6px;
  z-index: 20;
}

.topbar { display: none; }

.view {
  flex: 1;
  /* 作为弹性子项允许收缩到内容最小宽度以下：否则菜品卡（content-visibility 记住的尺寸）
     会把 .view 的最小宽度撑大，窗口缩小时卡片不再自适应，页面出现横向滚动 */
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 26px 34px 60px;
  /* 不限制最大宽度：宽屏下菜品卡自动排更多列，避免两侧出现过宽留白 */
  max-width: none;
}

.tabbar { display: none; }

/* ---------------- 侧边栏 ---------------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 16px;
}
.brand-logo { font-size: 26px; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: 0.5px; }

.bell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, #fff1e4 0%, #ffe3ee 100%);
  border: 1.5px solid var(--primary-dim);
  transition: box-shadow 0.2s, transform 0.12s, filter 0.2s;
  position: relative;
}
.bell:hover { box-shadow: 0 6px 16px rgba(255, 140, 66, 0.22); filter: brightness(1.02); }
.bell:active { transform: scale(0.97); }
.bell .bell-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  font-weight: 600;
}

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--text-2);
  font-size: 15px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.nav-item:hover { background: var(--primary-soft); color: var(--text); }
.nav-item:active { transform: scale(0.97); }
.nav-item.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 140, 66, 0.32);
}
.nav-icon { font-size: 18px; width: 22px; text-align: center; }

/* 订单角标：黄色=等待我操作 */
.nav-badges { display: inline-flex; align-items: center; gap: 4px; }
.nav-item .nav-badges { margin-left: auto; }
.nav-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 10px;
  color: #fff;
  font-size: 11.5px;
  line-height: 19px;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}
.nav-badge.ord-badge-mine { background: var(--amber-deep); }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.me-mini { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 6px 8px; font-size: 14px; color: var(--text-2); border-radius: 12px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.me-mini:hover { background: var(--bg-2); color: var(--text); }
.me-mini.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.me-mini > span:last-child { line-height: 1; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--pink-deep));
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-lg { width: 56px; height: 56px; font-size: 23px; }
/* 头像选择器：方形点击框（空时内部为＋），已选则显示图片 */
.avatar-picker { display: flex; align-items: center; gap: 12px; }
.avatar-box {
  width: 84px;
  height: 84px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.avatar-box:hover { border-color: var(--primary); background: #fff; box-shadow: var(--shadow); }
.avatar-box img { width: 100%; height: 100%; object-fit: cover; }
.avatar-box-plus { font-size: 30px; font-weight: 700; color: var(--primary); line-height: 1; }
.avatar-box-tip { font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.3; }

/* ---------------- 通用组件 ---------------- */
.page { animation: fadeSlideIn 0.3s ease; }
.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h2 { font-size: 21px; font-weight: 700; }
.page-head .spacer { flex: 1; }
/* 管理模式两个操作按钮保持同尺寸 */
.menu-toolbar #manage-meta,
.menu-toolbar #add-dish { min-width: 96px; justify-content: center; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-title { font-weight: 700; font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, transform 0.12s, box-shadow 0.2s, color 0.2s;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-dim); }
.btn:active { transform: scale(0.95); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 140, 66, 0.3);
}
.btn.primary:hover { filter: brightness(1.04); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { background: #ffe3e0; color: #d05a4c; }
.btn.danger:hover { background: #ffd2cd; }
/* 无红底、红字 + 淡红描边（如订单卡片的「直接撤销」） */
.btn.danger-plain { background: transparent; border: 1.5px solid rgba(208, 90, 76, 0.35); color: #d05a4c; }
.btn.danger-plain:hover { background: rgba(208, 90, 76, 0.08); border-color: rgba(208, 90, 76, 0.55); }
.btn.blue { background: var(--blue); color: #3f6db4; }
.btn.green { background: var(--green); color: #2f7d47; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
/* 需要用户注意时：轻微摇晃 + 光圈脉冲（如未开始制作就点菜品的完成圆圈） */
@keyframes btnAttention {
  0%, 100% { transform: translateX(0) scale(1); box-shadow: 0 0 0 0 rgba(255, 140, 66, 0); }
  15% { transform: translateX(-3px) scale(1.04); box-shadow: 0 0 0 6px rgba(255, 140, 66, 0.18); }
  30% { transform: translateX(3px) scale(1.06); box-shadow: 0 0 0 10px rgba(255, 140, 66, 0.10); }
  45% { transform: translateX(-2px) scale(1.04); box-shadow: 0 0 0 6px rgba(255, 140, 66, 0.18); }
  60% { transform: translateX(2px) scale(1.02); box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.12); }
  80% { transform: translateX(0) scale(1); }
}
.btn.attention { animation: btnAttention 1.1s ease; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.field { margin-bottom: 13px; }
.field > label:not(.check) { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input[type="text"],
.field input[type="password"],
.field input[type="date"],
.field input[type="search"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.14);
}
.field textarea { resize: vertical; min-height: 70px; }

/* 字数限制输入框（attachCharLimit）：字数统计 + 超限震动 / 变红 */
.char-input-wrap { position: relative; }
.char-input-wrap input, .field .char-input-wrap input,
.char-input-wrap textarea, .field .char-input-wrap textarea { padding-right: 54px; }
.char-count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-3);
  pointer-events: none;
}
/* 多行输入：计数移到右下角 */
.char-count.bottom { top: auto; bottom: 9px; right: 14px; transform: none; }
/* 多行文本：不再给每一行让出右侧空间；底部预留一行给计数，正文全宽换行 */
.char-input-wrap textarea,
.field .char-input-wrap textarea {
  padding-right: 13px;
  padding-bottom: 30px;
  line-height: 1.6;
}
.char-input-wrap textarea + .char-count.bottom {
  right: 12px;
  bottom: 8px;
  padding: 1px 3px 1px 10px;
  border-radius: 6px 0 10px 0;
  background: linear-gradient(90deg, rgba(255, 253, 251, 0), var(--card-2) 26%);
}
.char-count.at-limit { color: #d05a4c; font-weight: 600; }
.char-input-wrap input.limit-shake,
.char-input-wrap textarea.limit-shake {
  animation: limitShake 0.32s;
  border-color: #e57365;
  box-shadow: 0 0 0 3px rgba(224, 90, 76, 0.15);
}
.char-count.limit-flash { animation: countFlash 0.32s; color: #d05a4c; }
@keyframes limitShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
@keyframes countFlash {
  0%, 100% { scale: 1; }
  45% { scale: 1.35; }
}
/* 输入对话框：收紧输入框与底部按钮的间距 */
.modal-prompt .prompt-field { margin-bottom: 0; }
.modal-prompt .modal-body { padding-bottom: 8px; }
.modal-prompt .modal-foot { padding-top: 8px; }

/* 标记完成：选择给负责人发放的积分 */
.modal-award-points .modal-body { padding-bottom: 6px; }
.award-points { text-align: center; }
.ap-desc { font-size: 14px; color: var(--text-2); margin-bottom: 14px; }
.ap-desc b { color: var(--primary); }
.ap-stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 10px; }
.ap-step {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card-2);
  color: var(--primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
}
.ap-step:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary-dim); }
.ap-step:active:not(:disabled) { transform: scale(0.92); }
.ap-step:disabled { opacity: 0.35; cursor: not-allowed; }
.ap-value { min-width: 108px; display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.ap-num { font-size: 34px; font-weight: 800; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.ap-unit { font-size: 13px; color: var(--text-3); }
.ap-range {
  width: 100%;
  height: 26px;
  margin: 0 0 4px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 日期 + 餐次下拉（点餐表单） */
.date-meal-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.date-meal-row input[type="date"] { flex: 0 0 150px; width: 150px; }
.date-meal-row .date-pick { flex: 0 0 150px; width: 150px; min-width: 0; }
.meal-slot { flex: 1 1 auto; min-width: 150px; }
/* 餐次按钮组（点餐 / 编辑订单）：四个按钮单选，紧凑排列 */
.meal-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meal-btns .chip { padding: 12px 16px; white-space: nowrap; }
.order-form-modal .meal-slot { min-width: max-content; }

/* ---------------- 自定义日期选择器 ---------------- */
.date-pick { position: relative; width: 100%; }
.date-pick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  color: var(--text);
  text-align: left;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.date-pick-btn:hover { border-color: var(--primary-dim); }
.date-pick.open .date-pick-btn {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.14);
}
.dp-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dp-icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-2); }
.dp-pop {
  position: fixed;
  z-index: 75;
  width: min(320px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
  user-select: none;
  -webkit-overflow-scrolling: touch;
  animation: selIn 0.16s ease both;
}
.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 8px;
}
.dp-title { font-size: 14px; font-weight: 700; color: var(--text-2); }
.dp-nav {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.dp-nav:hover:not(:disabled) { background: var(--bg-2); color: var(--text); }
.dp-nav:disabled { opacity: 0.28; cursor: not-allowed; }
.dp-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  padding: 0 0 4px;
}
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-day {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.dp-day:hover:not(:disabled) { background: var(--bg-2); color: var(--text); }
.dp-day:active:not(:disabled) { transform: scale(0.94); }
.dp-day.other { opacity: 0.25; }
.dp-day.today { border: 1.5px solid var(--primary); color: var(--primary); }
.dp-day.selected {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 9px rgba(255, 140, 66, 0.3);
}
.dp-day:disabled { opacity: 0.28; cursor: not-allowed; }
@media (max-width: 768px) {
  .dp-pop { padding: 8px; border-radius: 14px; }
  .dp-head { padding: 0 0 6px; }
  .dp-title { font-size: 13px; }
  .dp-nav { width: 30px; height: 30px; font-size: 18px; }
  .dp-week { font-size: 10.5px; padding-bottom: 3px; }
  .dp-grid { gap: 3px; }
  .dp-day { font-size: 12px; border-radius: 9px; }
  .dp-icon { width: 15px; height: 15px; }
}

/* ---------------- 自定义下拉选择 ---------------- */
.sel { position: relative; width: 100%; }
.sel-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  color: var(--text);
  font-size: 14px;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sel-btn:hover { border-color: var(--primary-dim); }
.sel.open .sel-btn { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.14); }
.sel-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-arrow { color: var(--text-3); font-size: 11px; flex-shrink: 0; transition: transform 0.2s; }
.sel.open .sel-arrow { transform: rotate(180deg); }
.sel-menu {
  position: fixed;
  z-index: 75;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  animation: selIn 0.16s ease both;
}
.sel-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.sel-opt:hover { background: var(--bg-2); color: var(--text); }
.sel-opt.disabled { opacity: 0.38; pointer-events: none; }
.sel-opt.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sel-opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-check { opacity: 0; color: var(--primary); font-size: 13px; flex-shrink: 0; }
.sel-opt.active .sel-check { opacity: 1; }
/* 多选下拉的勾选框 */
.sel-opt-cb {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sel-opt.active .sel-opt-cb {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border-color: transparent;
  color: #fff;
}
.sel-empty { padding: 12px; text-align: center; color: var(--text-3); font-size: 13px; }

/* 订单筛选行 */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-sel { width: 150px; flex-shrink: 0; }
.menu-sort-slot { width: 150px; flex-shrink: 0; }
/* 订单筛选开关：仅手机端显示（点击展开 / 收起筛选卡片） */
.filter-toggle { display: none; }
/* 订单总数（右对齐） */
.order-count { color: var(--text-3); font-size: 13px; white-space: nowrap; }
/* 订单数右侧的筛选日期区间 */
.order-range { color: var(--text-3); font-size: 13px; white-space: nowrap; }

/* 日期区间选择（订单筛选）：复用点餐页的自定义日期选择器 */
.date-range { display: flex; align-items: center; gap: 10px; }
.date-range .date-pick { flex: 0 0 150px; width: 150px; min-width: 0; }
.date-sep { color: var(--text-3); font-size: 13px; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* 定制勾选框（如「记住密码」） */
.check-pretty { position: relative; gap: 6px; line-height: 1.25; }
.check-pretty input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.check-pretty .cb-box {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--card-2);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}
.check-pretty .cb-box::after {
  content: '';
  width: 10px;
  height: 6px;
  margin-top: -2px;
  border-left: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.18s;
}
.check-pretty:hover .cb-box { border-color: var(--primary); }
.check-pretty:active .cb-box { transform: scale(0.92); }
.check-pretty input:checked + .cb-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border-color: transparent;
  box-shadow: 0 3px 9px rgba(255, 140, 66, 0.35);
}
.check-pretty input:checked + .cb-box::after { transform: rotate(-45deg) scale(1); }
.check-pretty input:focus-visible + .cb-box { outline: 2px solid var(--primary-soft); outline-offset: 1px; }
.check-pretty input:disabled + .cb-box,
.check-pretty input:disabled ~ span:not(.cb-box) { opacity: 0.5; }
.check-pretty:has(input:disabled) { cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1.5px solid transparent;
  font-size: 13.5px;
  color: var(--text-2);
  transition: all 0.2s;
}
.chip:hover { background: var(--primary-soft); }
.chip:active { transform: scale(0.94); }
/* 分类按钮：页面改渐变底后，需要描边才能看清药丸轮廓（active 保持主题橙描边） */
#menu-cats .chip:not(.active) { border-color: rgba(160, 108, 58, 0.3); }
#menu-cats { margin-bottom: 16px; }
/* 菜品种类（仅电脑端）：固定一行展示，超出部分横向滚动；页面上下滚动时吸顶冻结。
   吸顶毛玻璃在独立伪元素上（fixed 定位，仅吸顶时淡入）：避免随分类横向滚动位移；
   底缘用渐变遮罩让底色与模糊逐渐消失，与菜品之间形成柔和过渡（无切割感）。
   左右边距为 0：底色从侧边栏边缘铺到窗口右缘，用负外边距抵掉 .view 的 34px 内边距，
   再用等量内边距让分类按钮保持在原位 */
@media (min-width: 769px) {
  #menu-cats {
    /* 内容区已铺满侧边栏以外的宽度：只需用负外边距抵消 .view 的 34px 内边距 */
    --cats-bleed: 34px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    position: sticky;
    top: 0;
    z-index: 25;
    width: calc(100% + 2 * var(--cats-bleed));
    margin-left: calc(0px - var(--cats-bleed));
    /* 上下留 6px 内边距：分类按钮与毛玻璃背景之间留一点间距 */
    padding: 6px var(--cats-bleed);
    margin-bottom: 10px; /* 与上下内边距合计，保持分类按钮到菜品的原有间距 */
    /* 隐藏横向滚动条（滚轮 / 触控板 / Shift+滚轮仍可横向滚动） */
    scrollbar-width: none;
  }
  #menu-cats::-webkit-scrollbar { display: none; }
  /* 吸顶后冻住毛玻璃层：0~49px 铺满（与分类栏同高），之后约 23px 渐隐；
     分类栏本身高度不变，渐隐部分叠在菜品上方，菜品滑出时平滑淡出 */
  #menu-cats::before {
    content: '';
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: 72px;
    z-index: -1;
    pointer-events: none;
    /* 底色用与页面背景相同的视口渐变、仅 62% 不透明：毛玻璃保留背景渐变色，
       与页面颜色无缝一致（菜品处呈暖色磨砂） */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.62) 0%, rgba(238, 241, 245, 0.62) 100%);
    background-attachment: fixed;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 68%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 68%, transparent 100%);
    opacity: 0;
  }
  #menu-cats.stuck::before { opacity: 1; transition: opacity 0.25s ease; }
  #menu-cats .chip { flex-shrink: 0; white-space: nowrap; }
}
.chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.chip.mini { padding: 3px 9px; font-size: 12px; border-radius: 8px; background: var(--bg-2); color: var(--text-2); }

.tag { padding: 3px 9px; border-radius: 8px; font-size: 12px; background: var(--bg-2); color: var(--text-2); }
.tag.home-only { background: var(--purple); color: #6a51c8; }
.tag.takeout-only { background: var(--blue); color: #3f6db4; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
}
.st-pending { background: #fff3d9; color: var(--amber-deep); }
.st-cooking { background: #e4f0ff; color: #4a86d8; }
.st-awaiting { background: #fff3d9; color: var(--amber-deep); }
.st-done { background: #e2f5e7; color: var(--green-deep); }
.st-cancel_pending { background: #eee8ff; color: var(--purple-deep); }
.st-cancelled { background: var(--red); color: var(--red-deep); }

/* 统一状态色：黄=等待我操作、蓝=等待对方操作、绿=已完成、红=已取消 */
.status-badge.tone-mine { background: #fff3d9; color: var(--amber-deep); }
.status-badge.tone-other { background: #e4f0ff; color: #4a86d8; }
.status-badge.tone-done { background: #e2f5e7; color: var(--green-deep); }
.status-badge.tone-cancelled { background: var(--red); color: var(--red-deep); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.st-pending { background: var(--amber-deep); }
.dot.st-cooking { background: #4a86d8; }
.dot.st-done { background: var(--green-deep); }
.dot.st-cancel_pending { background: var(--purple-deep); }
.dot.st-cancelled { background: var(--red-deep); }
.dot.tone-mine { background: var(--amber-deep); }
.dot.tone-other { background: #4a86d8; }
.dot.tone-done { background: var(--green-deep); }
.dot.tone-cancelled { background: var(--red-deep); }

.empty {
  text-align: center;
  color: var(--text-3);
  padding: 42px 16px;
  font-size: 14px;
}
/* 菜品为空时占满整行并上下左右居中 */
.dish-grid > .empty {
  flex: 1;
  min-height: 46vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.empty .empty-icon { font-size: 40px; display: block; margin-bottom: 10px; opacity: 0.7; }

/* ---------------- 登录页 ---------------- */
.login-root {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 217, 226, 0.8), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(217, 233, 255, 0.8), transparent 42%),
    var(--bg);
  padding: 20px;
  z-index: 50;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 30px 26px;
  text-align: center;
  animation: popIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.login-logo { font-size: 48px; animation: floatY 3s ease-in-out infinite; }
.login-card h1 { font-size: 23px; margin: 8px 0 4px; }
.login-sub { color: var(--text-3); font-size: 13.5px; margin-bottom: 24px; }
.login-card form { text-align: left; }
/* 记住密码：定制勾选框 + 与按钮之间的舒适间距 */
.login-remember { margin: 2px 0 20px; font-size: 13.5px; color: var(--text-2); }
.login-error { color: #d05a4c; font-size: 13px; min-height: 20px; margin-top: 8px; text-align: center; }
.shake { animation: shake 0.45s ease; }

/* ---------------- 点单（原日历） ---------------- */
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-month {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-2);
  padding: 3px 12px;
  border-radius: 999px;
  min-width: 88px;
  text-align: center;
}

.cal-page { max-width: 1000px; margin: 0 auto; }
.cal-card { padding: 16px 16px 10px; }
.cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  padding-bottom: 8px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  touch-action: pan-y;
}
.cal-cell {
  position: relative;
  aspect-ratio: 1 / 0.6;
  border-radius: 12px;
  padding: 7px 6px 4px;
  background: var(--bg-2);
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.12s, border-color 0.2s;
  overflow: hidden;
}
.cal-cell:hover { background: var(--primary-soft); }
.cal-cell:active { transform: scale(0.95); }
.cal-cell.other { opacity: 0.32; }
.cal-cell.today { border-color: var(--primary); background: #fff6ee; }
.cal-cell.today .cal-day { color: var(--primary); font-weight: 700; }
.cal-day { font-size: 14px; font-weight: 600; }
.cal-dots { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.cal-dots .dot { width: 7px; height: 7px; }
.cal-photo {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  object-fit: cover;
  border: 1.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}
.cal-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 4px 4px;
  color: var(--text-3);
  font-size: 12.5px;
  align-items: center;
}
.cal-legend .item { display: inline-flex; align-items: center; gap: 5px; }
.cal-slide-next { animation: calSlideNext 0.3s ease both; }
.cal-slide-prev { animation: calSlidePrev 0.3s ease both; }

.cal-hint { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 8px 0 4px; }

/* ---------------- 订单卡片 ---------------- */
.order-list { display: flex; flex-direction: column; gap: 12px; }
.order-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(160, 108, 58, 0.18), 0 2px 8px rgba(160, 108, 58, 0.09);
  padding: 0;
  transition: box-shadow 0.25s, transform 0.25s;
}
/* 订单卡片内容层：手机端左滑时整体左移，露出右侧操作托盘 */
.oc-swipe {
  position: relative;
  z-index: 1;
  padding: 15px 17px;
  background: var(--card);
  transition: transform 0.25s ease;
}
.oc-swipe.dragging { transition: none; }
.order-card.swiped .oc-swipe { transform: translateX(calc(-1 * var(--oc-tray-w, 92px))); }
/* 没有可点按钮的卡片：左滑只做轻微橡皮筋跟随，松手后弹簧动效回弹到原始状态 */
.oc-swipe.snap-back { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.order-card.no-tray .oc-tray { display: none; }
/* 手机端进入订单页时：第一张可左滑卡片播放一次半透明提示动画（0.8s） */
.order-card.swipe-hint .oc-swipe { animation: swipeHintSlide 0.8s ease both; }
.order-card.swipe-hint::after {
  content: '👈 左滑操作';
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  pointer-events: none;
  animation: swipeHintFade 0.8s ease both;
}
.order-card.is-closed .oc-swipe { background: #eae2d9; }
/* 左滑操作托盘（手机端）：按钮隐藏在卡片右侧，左滑露出；电脑端不显示 */
.oc-tray {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: 92px;
  display: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  overflow-y: auto;
  background: linear-gradient(160deg, #fff3e7 0%, #ffe4cf 100%);
  box-shadow: inset 10px 0 14px -10px rgba(160, 108, 58, 0.3);
}
.order-card.is-closed .oc-tray {
  background: linear-gradient(160deg, #eee4d9 0%, #e0d3c4 100%);
}
.oc-tray .oc-tray-btn {
  width: 100%;
  padding: 7px 4px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 9px;
  white-space: normal;
  background: #fff;
  border: 1px solid rgba(160, 108, 58, 0.12);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(160, 108, 58, 0.12);
}
.oc-tray .oc-tray-btn:hover { background: #fff8f0; }
.oc-tray .oc-tray-btn.primary { color: var(--primary); }
.oc-tray .oc-tray-btn.blue { color: #3f6db4; }
.oc-tray .oc-tray-btn.green { color: #2f7d47; }
.oc-tray .oc-tray-btn.danger,
.oc-tray .oc-tray-btn.danger-plain { color: #d05a4c; }
.oc-tray .oc-tray-del { background: #ffe9e6; border-color: transparent; color: #d05a4c; }
.oc-tray .oc-tray-del:hover { background: #ffded9; }
/* 长列表卡片：滚动到附近再渲染，提升长列表滚动流畅度（保留占位高度避免跳动） */
/* content-visibility 仅桌面端启用：部分手机浏览器（华为等）滚动时会闪出黑色细线伪影 */
@media (min-width: 769px) {
  .dish-card, .order-card { content-visibility: auto; contain-intrinsic-size: auto 340px; }
}
.order-card:hover { box-shadow: 0 16px 44px rgba(160, 108, 58, 0.26), 0 4px 14px rgba(160, 108, 58, 0.12); }
.order-card.pop-in { animation: popIn 0.3s ease both; }
/* 已完成 / 已撤销订单：更明显的暖灰底 + 更轻阴影，与白色全局背景和白色进行中卡片区分 */
.order-card.is-closed {
  background: #eae2d9;
  border: 1px solid #e0d6ca;
  box-shadow: 0 3px 12px rgba(160, 108, 58, 0.08), 0 1px 3px rgba(160, 108, 58, 0.05);
}
.order-card.is-closed:hover { box-shadow: 0 7px 20px rgba(160, 108, 58, 0.14), 0 2px 6px rgba(160, 108, 58, 0.07); }
.order-card.is-closed .order-dish { background: #e0d7cc; }
.order-card.is-closed .order-dish.done { background: #d5e4d8; }
.order-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.order-top .spacer { flex: 1; }
.order-points-tip { font-size: 12px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.method-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  background: var(--blue);
  color: #3f6db4;
}
.method-tag.home { background: var(--purple); color: #6a51c8; }
.method-tag.takeout { background: var(--blue); color: #3f6db4; }
.method-tag.restaurant { background: var(--pink); color: #c05b78; }
.method-tag.mixed { background: var(--amber); color: #9a6a12; }
/* 订单卡片：菜品名称胶囊 + 制作进度 */
.order-dishes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
/* 电脑端订单卡片：菜品网格随窗口宽度自适应列数与卡片大小，左右留白一致（日历展示卡保持原样） */
.order-card .order-dishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.order-card .order-dish { width: auto; min-width: 0; }
.order-dish {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 150px;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg-2);
  font-size: 14px;
  font-weight: 600;
}
.order-dish .od-info { display: block; line-height: 1.35; }
.order-dish i { font-style: normal; font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 4px; }
.order-dish.done { background: var(--green); color: #2f7d47; }
.od-thumb { width: 100%; aspect-ratio: 4 / 3; height: auto; border-radius: 9px; object-fit: cover; cursor: pointer; }
.od-thumb-wrap { position: relative; display: block; border-radius: 9px; overflow: hidden; cursor: pointer; }
/* 菜品块等高时图片撑满剩余空间：避免菜名行数少（如「可乐鸡翅」）时图片下方留出空行 */
.order-dish > .od-thumb { flex: 1 0 auto; min-height: 0; }
.order-dish .od-thumb-wrap { flex: 1 0 auto; min-height: 0; aspect-ratio: 4 / 3; }
.order-dish .od-thumb-wrap .od-thumb { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.od-thumb-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: rgba(50, 42, 38, 0.45);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.od-thumb-wrap:hover .od-thumb-mask { opacity: 1; }
.od-thumb.ph { display: flex; align-items: center; justify-content: center; background: var(--card-2); font-size: 26px; }

.od-progress { margin-top: 10px; }
.od-progress .od-progress-text { font-size: 12.5px; color: var(--text-2); }
.od-progress .od-progress-text b { color: var(--primary); }
.od-progress-bar { margin-top: 5px; height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
/* 订单详情：进度文字与进度条同一行（文字左、进度条右） */
.order-detail-modal .od-progress { display: flex; align-items: center; gap: 10px; }
.order-detail-modal .od-progress-text { flex-shrink: 0; }
.order-detail-modal .od-progress-bar { flex: 1 1 auto; min-width: 60px; margin-top: 0; }
.od-progress-bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary-2), var(--primary)); transition: width 0.4s ease; }
.od-progress.mini .od-progress-bar { height: 6px; }
/* 订单卡片：制作进度文字与进度条同一行（文字左、进度条右） */
.order-card .od-progress { display: flex; align-items: center; gap: 10px; }
.order-card .od-progress .od-progress-text { flex-shrink: 0; }
.order-card .od-progress .od-progress-bar { flex: 1 1 auto; min-width: 60px; margin-top: 0; }

/* 订单详情弹窗 */
.od-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; align-items: start; }
.od-item { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card-2); min-width: 0; }
.od-item-head { display: flex; gap: 10px; align-items: flex-start; }
.od-item.done { background: #f2fbf5; border-color: var(--green); }
.od-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--primary-dim);
  background: #fff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 0.2s, border-color 0.2s, transform 0.12s;
}
.od-check:not(:disabled):hover { border-color: var(--primary); }
.od-check:not(:disabled):active { transform: scale(0.9); }
.od-check.checked { background: var(--green-deep); border-color: var(--green-deep); }
.od-check:disabled { cursor: not-allowed; opacity: 0.65; }
.od-check.static { border: none; background: transparent; font-size: 16px; opacity: 0.8; }
/* 制餐人已接单：未完成条目的圆圈持续放大 + 双层波纹，引导逐道勾选 */
.od-check.od-check-guide {
  position: relative;
  border-color: var(--primary);
  animation: odCheckGuidePulse 1.8s ease-in-out infinite;
  will-change: transform;
}
.od-check.od-check-guide::before,
.od-check.od-check-guide::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  pointer-events: none;
  animation: odCheckGuideRipple 1.8s ease-out infinite;
}
.od-check.od-check-guide::after { animation-delay: 0.6s; }
@keyframes odCheckGuidePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}
@keyframes odCheckGuideRipple {
  0% { transform: scale(1); opacity: 0.55; }
  70%, 100% { transform: scale(1.6); opacity: 0; }
}
.od-item-img { width: 100%; aspect-ratio: 4 / 3; height: auto; border-radius: 12px; object-fit: cover; }
.od-item-img.ph { display: flex; align-items: center; justify-content: center; background: var(--bg-2); font-size: 26px; }
.od-main { flex: 1; min-width: 0; }
/* 菜品名 + 金额（金额靠右上角） */
.od-name-row { display: flex; align-items: flex-start; gap: 8px; }
.od-name-row .od-name { flex: 1; min-width: 0; }
.od-name-row .od-budget { flex-shrink: 0; }
/* 菜名不换行：超出可用宽度（金额标签左侧）的字自动渐隐；点一下名字可滚动查看全名 */
.od-name {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 1.2em), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 1.2em), transparent);
}
.od-name-track { display: inline-flex; width: max-content; }
.od-name-text { padding-right: 1.5em; }
.od-name.scrolling .od-name-track { animation: odNameScroll 4s linear infinite; }
@keyframes odNameScroll { to { transform: translateX(-50%); } }
/* 菜品名下方：汤 / 制作方式 / 辣度 / 金额（与圆圈、图片同一左边缘） */
.od-item-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.od-item.done .od-name { color: #2f7d47; }
.od-state { font-size: 12px; color: var(--amber-deep); background: #fff3d9; padding: 2px 8px; border-radius: 7px; }
.od-state.ok { color: var(--green-deep); background: #e2f5e7; }
/* 菜品金额（负责人可点击填写） */
.od-budget {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid transparent;
  padding: 2px 8px;
  border-radius: 7px;
}
.od-budget.od-missing { color: var(--text-3); background: var(--bg-2); border-style: dashed; border-color: var(--line); font-weight: 500; }
button.od-budget { cursor: pointer; transition: border-color 0.2s, background 0.2s, color 0.2s; }
button.od-budget:hover { border-color: var(--primary); background: #fff; }
/* 金额就地编辑 */
.od-budget-edit { flex-shrink: 0; display: inline-flex; align-items: center; }
.od-budget-input {
  width: 88px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--primary);
  padding: 2px 8px;
  border-radius: 7px;
  outline: none;
}
.od-total {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 13px;
}
.od-total b { color: var(--primary); font-size: 16px; }
.od-total .ct-missing { color: #d05a4c; }
/* 桌面端一行 4 个：弹窗已加宽，卡片内容随之略放大 */
@media (min-width: 769px) {
  .od-items { gap: 12px; }
  .od-item { gap: 10px; padding: 9px 11px; border-radius: 12px; }
  .od-item-flip { padding: 0; }
  .od-item-flip .od-flip-front { padding: 9px 11px; }
  .od-item-flip .od-flip-back { padding: 9px 11px; }
  .od-item-head { gap: 9px; }
  .od-check { width: 22px; height: 22px; font-size: 12px; }
  .od-item-img { border-radius: 12px; }
  .od-name { font-size: 16px; }
  .od-item-tags { gap: 6px; margin-top: 7px; }
  .od-item-tags .tag { font-size: 12px; padding: 2px 8px; }
  .od-state { font-size: 12px; padding: 2px 8px; }
  .od-budget { font-size: 12px; padding: 2px 8px; }
}
.od-flip { perspective: 1100px; cursor: pointer; }
.od-flip-inner { position: relative; width: 100%; aspect-ratio: 4 / 3; transform-style: preserve-3d; transition: transform 0.3s ease; }
.od-flip.flipped .od-flip-inner { transform: rotateY(180deg); }
.od-flip-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.od-flip-front { background: var(--bg-2); }
.od-flip-front .od-item-img { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.od-flip-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(50, 42, 38, 0.45);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.od-flip:hover .od-flip-mask { opacity: 1; }
.od-flip.flipped .od-flip-mask { opacity: 0; }
.od-flip-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 13px;
  background: var(--card-2);
  border: 1.5px solid var(--blue-deep);
}
.od-flip-title { flex-shrink: 0; font-size: 13.5px; font-weight: 700; color: var(--blue-deep); }
.od-flip-text { flex: 1; overflow-y: auto; font-size: 13px; line-height: 1.65; color: var(--text-2); white-space: pre-wrap; }
/* 餐厅订单翻转背面：推荐菜一行一个 */
.od-rec-item { padding: 1px 0; white-space: normal; word-break: break-word; }
.od-rec-item::before { content: '· '; color: var(--primary); font-weight: 700; }
.od-rec-empty { color: var(--text-3); white-space: normal; }
.od-flip-text.od-flip-empty { display: flex; align-items: center; justify-content: center; color: var(--text-3); white-space: normal; }
/* 订单详情：整张菜品卡片可翻转，背面制作过程占满卡片 */
.od-item-flip { padding: 0; border: none; background: transparent; }
.od-item-flip .od-flip { display: block; }
.od-item-flip .od-flip-inner { position: relative; width: auto; aspect-ratio: auto; transform-style: preserve-3d; }
.od-item-flip .od-flip-front {
  position: relative; inset: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 12px; background: var(--card-2); border: 1.5px solid var(--line);
}
.od-item-flip .od-flip-front .od-item-img { height: auto; aspect-ratio: 4 / 3; border-radius: 12px; }
/* 遮罩只作用在图片上，并保持与图片一致的圆角 */
.od-item-flip .od-flip-media { position: relative; border-radius: 12px; overflow: hidden; }
.od-item-flip .od-flip-back { padding: 10px 12px; gap: 8px; }
.od-item-flip.done .od-flip-front { background: #f2fbf5; border-color: var(--green); }
/* 未填写制作过程：0.2s 翻到背面，抖动 0.3s，抖动结束后立即翻回（0.2s），全程由 CSS 动画衔接，无定时器停顿 */
.od-flip.flip-empty .od-flip-inner { animation: flipEmpty 0.7s both; }
.od-flip.flip-empty { animation: shake 0.3s ease 0.2s; }
.od-flip.flip-empty .od-flip-back { border-color: #e25b4a; }
@keyframes flipEmpty {
  0% { transform: rotateY(0deg); animation-timing-function: ease; }
  28.571% { transform: rotateY(180deg); animation-timing-function: linear; }
  71.429% { transform: rotateY(180deg); animation-timing-function: ease; }
  100% { transform: rotateY(0deg); }
}
.od-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; justify-content: flex-end; }
.od-actions .order-meta { order: -1; margin-right: auto; }

/* 日历日详情：按餐次分组的展示卡 */
.meal-group { margin-bottom: 18px; }
.meal-group-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.meal-cards { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.meal-card {
  width: fit-content;
  max-width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow 0.25s, transform 0.2s;
}
@media (hover: hover) and (pointer: fine) {
  .meal-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
}
.meal-card.done { opacity: 0.82; }
.meal-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meal-card-top .spacer { flex: 1; }
/* 当日餐食卡：菜品网格与标签行间距收紧，减少卡片内的白色留白 */
.meal-card .order-dishes { margin-top: 7px; }

.order-meta { margin-top: 5px; color: var(--text-3); font-size: 12.5px; }
.order-cancel-req {
  /* 上间距由 .order-bottom 统一控制，避免与菜品卡片之间出现双倍间距 */
  margin-top: 0;
  background: #f6f1ff;
  color: var(--purple-deep);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
}
.order-bottom { display: flex; align-items: center; gap: 8px 14px; margin-top: 12px; flex-wrap: wrap; }
.order-bottom .order-foot { flex: 1 1 auto; margin-top: 0; }
.order-bottom.has-progress .od-progress { flex: 1 1 200px; min-width: 140px; margin-top: 0; }
.order-bottom.has-progress .order-foot { display: contents; }
.order-bottom.has-progress .order-foot-info { flex: 0 1 auto; min-width: 0; }
.order-bottom.has-progress .order-foot-info .order-meta:first-child { margin-top: 0; }
.order-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 12px; margin-top: 12px; flex-wrap: wrap; }
.order-foot-info { flex: 1 1 220px; min-width: 0; }
.order-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.order-actions .oa-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-actions .oa-del { flex-shrink: 0; }

/* ---------------- 菜单 ---------------- */
.menu-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
/* 管理模式下，两个操作按钮从「管理 / 点餐」按钮右侧分化出现 */
@keyframes menuManageActionIn {
  0% { opacity: 0; transform: translateX(-16px) scale(0.62); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
.menu-toolbar.manage-mode #manage-meta,
.menu-toolbar.manage-mode #add-dish {
  transform-origin: left center;
  animation: menuManageActionIn 0.26s cubic-bezier(0.18, 0.89, 0.32, 1.18) backwards;
}
.menu-toolbar.manage-mode #add-dish { animation-delay: 0.05s; }
/* 电脑端：分类栏上下间距保持一致（工具栏→按钮 10+6=16px，按钮→菜品 6+10=16px） */
@media (min-width: 769px) {
  .menu-toolbar { margin-bottom: 10px; }
  /* 管理模式：搜索框让出空间给排序与右侧管理按钮，保持同一行 */
  .menu-toolbar.manage-mode .menu-search-wrap { flex: 1 1 120px; min-width: 100px; }
  /* 电脑端工具栏：管理切换、搜索、排序、管理操作按钮统一高度 */
  .menu-toolbar .mode-toggle,
  .menu-toolbar .search,
  .menu-toolbar .sel-btn,
  .menu-toolbar #manage-meta,
  .menu-toolbar #add-dish { height: 44px; }
  .menu-toolbar .mode-toggle,
  .menu-toolbar #manage-meta,
  .menu-toolbar #add-dish { padding-top: 0; padding-bottom: 0; }
}
.menu-toolbar .search { flex: 1 1 0%; width: auto; min-width: 160px; margin-bottom: 0; padding: 9px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card-2); }
/* 点单搜索框：右侧常驻清空按钮 */
.menu-search-wrap { position: relative; flex: 1 1 0%; min-width: 160px; display: flex; }
.menu-search-wrap .search { width: 100%; min-width: 0; padding-right: 30px; }
.menu-search-wrap .search::-webkit-search-cancel-button,
.menu-search-wrap .search::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.menu-search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: rgba(160, 108, 58, 0.1);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.18s, background 0.18s, transform 0.12s;
}
.menu-search-clear:hover { color: var(--primary); background: var(--primary-soft); }
.menu-search-clear:active { transform: translateY(-50%) scale(0.9); }
/* 点餐 / 管理 单按钮切换（搜索框左侧） */
.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 12px;
  background: #fff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(214, 163, 116, 0.18);
  transition: background 0.2s, color 0.2s, transform 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}
/* 悬停变底色仅在支持 hover 的设备生效：避免手机端点击后 hover 状态残留变橙底 */
@media (hover: hover) and (pointer: fine) {
  .mode-toggle:hover { background: var(--primary-soft); }
  .mode-toggle.manage:hover { background: var(--blue); }
}
.mode-toggle:active { transform: scale(0.96); }
.mode-toggle.manage { color: #3f6db4; }
/* 行优先瀑布流：列容器横向排列，卡片按顺序依次放入各列（列内间距固定） */
.dish-grid { display: flex; gap: 14px; align-items: flex-start; }
/* 无限加载哨兵 */
#menu-sentinel { height: 2px; }
.dish-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.dish-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}
/* 悬停抬升仅在支持 hover 的设备生效：避免手机端点击后“粘住 hover”导致卡片弹跳 */
@media (hover: hover) and (pointer: fine) {
  .dish-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
}
/* 图片区固定 4:3（横 4 竖 3），高度跟随卡片宽度 */
.dish-img { aspect-ratio: 4 / 3; height: auto; position: relative; overflow: hidden; }
.dish-img picture { display: block; width: 100%; height: 100%; }
.dish-img img { width: 100%; height: 100%; object-fit: cover; }
.dish-img .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}
.dish-count {
  position: absolute;
  right: 9px;
  bottom: 9px;
  background: rgba(74, 59, 49, 0.72);
  color: #fff;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(3px);
}
.dish-body { padding: 13px 15px 15px; flex: 1; display: flex; flex-direction: column; }
.dish-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dish-name .dn-text { flex: 1 1 auto; min-width: 40px; line-height: 1.35; overflow-wrap: anywhere; }
.dish-name .tag { flex: 0 0 auto; white-space: nowrap; }
.dish-desc { color: var(--text-2); font-size: 13px; margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
/* 编辑 / 删除：悬浮在图片右上角，不占卡片空间 */
.dish-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 5px;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.dish-card:hover .dish-actions { opacity: 1; }
.dish-act {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, color 0.2s, transform 0.12s;
}
.dish-act:hover { background: #fff; color: var(--primary); }
.dish-act.danger:hover { background: #fff; color: #d05a4c; }
.dish-act:active { transform: scale(0.88); }
.dish-img { cursor: pointer; }

/* 点餐模式：加入购物车圆钮 + 购物车悬浮按钮 */
.dish-add {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #ff7a2f);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s, filter 0.2s;
  z-index: 2;
}
.dish-add:hover { filter: brightness(1.07); }
.dish-add:active { transform: scale(0.88); }
/* 已加入购物车时显示份数而非＋ */
.dish-add.has-count { font-size: 14px; }
.dish-count { bottom: auto; top: 9px; right: auto; left: 9px; }

/* 购物车悬浮球：手机 / 电脑共用，固定在右下角（内容与手机端一致：🛒 + 总份数 + 菜 / 馆角标） */
.cart-mfab {
  position: fixed;
  right: 26px;
  bottom: 30px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 84px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #ff7a2f);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(255, 122, 47, 0.4);
  z-index: 45;
  transition: transform 0.15s, filter 0.2s;
}
.cart-mfab.show { display: flex; }
.cart-mfab:active { transform: scale(0.94); }
.cart-mfab .cm-icon { font-size: 16px; }
.cart-mfab .cm-total { font-size: 16px; }
.cart-mfab .cm-mini {
  position: absolute;
  top: -10px;
  display: flex;
  align-items: center;
  gap: 1px;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border: 1.5px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}
.cart-mfab .cm-mini b { font-size: 10px; }
.cart-mfab .cm-mini-dish { left: -6px; background: #4fae6b; }
.cart-mfab .cm-mini-rest { right: -6px; background: #79a9f0; }

/* 电脑端购物车球放大，避免右下角太小不易看到（手机端保持原尺寸） */
@media (min-width: 769px) {
  .cart-mfab {
    right: 30px;
    bottom: 32px;
    gap: 9px;
    min-width: 132px;
    height: 60px;
    padding: 0 26px;
    font-size: 18px;
    box-shadow: 0 12px 30px rgba(255, 122, 47, 0.5);
  }
  .cart-mfab:hover { filter: brightness(1.06); }
  .cart-mfab .cm-icon { font-size: 24px; }
  .cart-mfab .cm-total { font-size: 22px; }
  .cart-mfab .cm-mini {
    top: -12px;
    gap: 2px;
    min-width: 26px;
    height: 21px;
    padding: 0 7px;
    border-radius: 11px;
    font-size: 12px;
  }
  .cart-mfab .cm-mini b { font-size: 12px; }
  .cart-mfab .cm-mini-dish { left: -9px; }
  .cart-mfab .cm-mini-rest { right: -9px; }
}

/* 加入购物车面板 */
.add-sheet-modal { max-width: 460px; }
.as-img {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 4 / 3;
  height: auto;
  margin: 0 auto 13px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
}
.as-img img { width: 100%; height: 100%; object-fit: cover; }
/* 加购面板：点击图片后整张卡片翻转到制作过程 */
.as-flip { cursor: default; }
.as-flip .as-img { cursor: pointer; }
.as-flip .od-flip-back { cursor: pointer; }
/* 悬停提示只跟随图片，不跟随整张卡片 */
.as-flip .od-flip-front .od-flip-mask { opacity: 0; }
.as-flip .as-img:hover .od-flip-mask { opacity: 1; }
.as-flip.flipped .od-flip-mask { opacity: 0; }
.as-flip .od-flip-inner { aspect-ratio: auto; }
.as-flip .od-flip-front {
  position: relative;
  inset: auto;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}
.as-flip .od-flip-back {
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--card-2);
}
.as-flip .od-flip-back .od-flip-title { font-size: 15px; }
.as-flip .od-flip-back .od-flip-text { font-size: 14px; }
.as-required { color: var(--primary); font-size: 12px; font-weight: 700; }
.as-method-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.as-method-row .chips { flex: 1 1 auto; }
.as-add { flex-shrink: 0; margin-left: auto; }
/* 份数 + 金额 */
.as-qty-row { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.as-amount-input {
  flex: 1 1 160px;
  min-width: 0;
  height: 30px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.as-amount-input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.14); }
/* 数量步进器（加购面板 / 购物车共用） */
.qty-stepper { display: inline-flex; align-items: center; gap: 2px; }
.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.qty-btn:hover { background: var(--primary-soft); color: var(--primary); }
.qty-btn:active { transform: scale(0.92); }
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-num { min-width: 28px; text-align: center; font-weight: 700; font-size: 14px; }
/* 可点击输入的份数：外观与 .qty-num 一致，聚焦时高亮提示可编辑 */
.qty-stepper input.qty-num-input {
  flex: none;
  width: 30px;
  padding: 2px 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  outline: none;
  transition: background 0.15s, box-shadow 0.15s;
}
.qty-stepper input.qty-num-input:focus { background: var(--primary-soft); box-shadow: 0 0 0 1.5px var(--primary-2); }

/* 购物车抽屉 */
.cart-modal { max-width: 560px; }
.cart-modal .modal-body { max-height: 58vh; }
#cart-list { display: flex; flex-direction: column; gap: 8px; }
.cart-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cart-item:hover { border-color: var(--primary-dim); }
.cart-check .cb-box { width: 18px; height: 18px; border-radius: 6px; }
.cart-check .cb-box::after { width: 9px; height: 5px; margin-top: -2px; border-left-width: 2px; border-bottom-width: 2px; }
.ci-img { width: 46px; height: 46px; border-radius: 11px; object-fit: cover; flex-shrink: 0; }
.ci-img.ci-rest { display: flex; align-items: center; justify-content: center; background: var(--amber); font-size: 24px; }
.ci-rest-tag { background: var(--amber); color: #9a6a12; }
.ci-mode-dinein { background: var(--green); color: #2f7d47; }
.ci-mode-takeout { background: var(--blue); color: #3f6db4; }
.placeholder-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}
.ci-main { flex: 1; min-width: 0; }
.ci-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; font-weight: 600; font-size: 16.5px; }
.ci-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-name .method-tag, .ci-name .tag { flex-shrink: 0; font-size: 9.5px; padding: 1px 6px; border-radius: 5px; gap: 2px; }
/* 购物车行：数量步进 + 金额输入 */
.ci-edit { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ci-edit .qty-btn { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
.ci-budget {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px 2px 9px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--card-2);
  color: var(--text-3);
  font-size: 12.5px;
}
.ci-budget:focus-within { border-color: var(--primary-2); }
.ci-budget-input {
  width: 62px;
  border: none;
  background: transparent;
  outline: none;
  padding: 2px 0;
  font-size: 13px;
  color: var(--text);
}
.ci-budget-input::-webkit-outer-spin-button,
.ci-budget-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ci-budget-input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.ci-line-total { color: var(--primary); font-size: 12.5px; font-weight: 700; }
/* 购物车合计 */
.cart-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 10px 4px 2px;
  color: var(--text-2);
  font-size: 13px;
}
.cart-total b { color: var(--primary); font-size: 15px; }
.ct-missing { color: #d05a4c; }
.cart-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}
.cart-remove:hover { background: #ffe3e0; color: #d05a4c; }
.cart-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 4px 2px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.cart-foot .spacer { flex: 1; }

/* 结算 */
.checkout-modal { max-width: 520px; }
/* 结算弹窗底部按钮（返回购物车 / 提交订单）：比默认按钮大一号 */
.checkout-modal .modal-foot .btn { padding: 11px 20px; font-size: 15px; border-radius: 13px; }
/* 结算弹窗：底部按钮贴近「本次结算」卡片（抵消内容区/字段/按钮区的三重留白叠加） */
.checkout-modal .modal-body { padding-bottom: 6px; }
.checkout-modal .modal-body .field:last-child { margin-bottom: 0; }
.checkout-modal .modal-foot { padding-top: 8px; }
/* 结算弹窗：餐次四个圆球按钮单选，直径与左侧日期输入框等高 */
.co-meal-btns {
  --co-ctl-h: calc(15px * 1.55 + 10px * 2 + 1.5px * 2);
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 12px;
}
.co-meal-btns .chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--co-ctl-h);
  height: var(--co-ctl-h);
  padding: 0;
  border-radius: 50%;
  font-size: 14px;
  white-space: nowrap;
}
.co-meal-btns .chip:not(.active) { background: var(--card-2); border-color: var(--line); }
/* 结算弹窗：制餐人 / 点餐人 + 用餐人数同一行（各自带小标题） */
.co-person-row { display: flex; align-items: flex-start; gap: 8px; }
.co-person-col { flex: 1 1 auto; min-width: 0; }
.co-person-col > label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.co-person-col.co-people-col { flex: 0 0 108px; }
.checkout-summary { color: var(--text-2); font-size: 14px; background: var(--bg-2); border-radius: 12px; padding: 10px 13px; }
.checkout-summary .ct-missing { font-size: 12.5px; }

/* ---------------- 餐厅 ---------------- */
.rest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.rest-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: box-shadow 0.25s, transform 0.25s; }
.rest-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
/* 餐厅卡片图片：仅手机端展示；电脑端保持原有布局 */
.rest-body { display: contents; }
.rest-thumb { display: none; }
/* 餐厅页：标题行与说明面板 */
.rest-head { margin-bottom: 10px; }
.rest-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
}
/* 餐厅：搜索工具栏 */
.rest-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.rest-toolbar .search {
  flex: 1 1 0%;
  width: auto;
  min-width: 160px;
  margin-bottom: 0;
  padding: 9px 13px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rest-toolbar .search:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.14); }
.rest-sort-slot { width: 150px; flex-shrink: 0; }
/* 卡片内：备注、属性与分组字段 */
.rest-note {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.5;
  padding-left: 9px;
  border-left: 3px solid var(--primary-dim);
  border-radius: 2px;
}
.rest-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* 餐厅加购：属性行末尾的圆形加号按钮 */
.rest-cart-add {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: filter 0.2s, transform 0.12s;
}
.rest-cart-add:hover { filter: brightness(0.98); }
.rest-cart-add:active { transform: scale(0.95); }
/* 餐厅加购弹窗：加入购物车按钮缩小，与金额输入框同一行 */
.rest-add-modal .as-qty-row { flex-wrap: nowrap; }
.rest-add-modal .ras-add {
  flex: none;
  margin-left: 0;
  height: 30px;
  padding: 0 14px;
  font-size: 12.5px;
  border-radius: 10px;
  white-space: nowrap;
}
/* 属性标签：人均（琥珀）/ 餐次（绿）/ 规格（橙），一眼区分信息类型 */
.rest-card .rest-price { background: var(--amber); color: #9a6a12; }
.rest-card .rest-meal { background: var(--green); color: #2f7d47; }
/* 分组字段：左侧小标题 + 右侧标签流 */
.rest-fields { display: flex; flex-direction: column; gap: 7px; border-top: 1px dashed var(--line); padding-top: 10px; }
.rest-field { display: grid; grid-template-columns: max-content 1fr; align-items: start; gap: 8px; }
.rest-label { padding-top: 3px; font-size: 11px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.rest-empty { color: var(--text-3); font-size: 12.5px; padding-top: 2px; }
/* 菜品种类：虚线描边（对应「支持外卖」的能力）；推荐菜：暖色实底，更像菜名 */
.rest-card .cat-tag { background: transparent; border: 1px dashed var(--line); color: var(--text-3); border-radius: 999px; }
.rest-card .dish-tag { background: var(--bg-2); color: var(--text); font-weight: 500; border-radius: 999px; padding: 3px 10px; }
/* 餐厅：网格内的「新增餐厅」大按钮 */
.rest-add-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.12s;
  /* 轻提示：虚线边框缓慢呼吸，暗示可点击 */
  animation: restAddBreath 3.2s ease-in-out infinite;
}
.rest-add-tile:hover { border-color: var(--primary); color: var(--primary); background: #fff; box-shadow: var(--shadow); animation: none; }
.rest-add-tile:active { transform: scale(0.985); }
.rest-add-plus {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
  animation: restAddPulse 2.6s ease-in-out infinite;
}
@keyframes restAddBreath {
  0%, 100% { border-color: var(--line); }
  50% { border-color: #efc4a4; }
}
@keyframes restAddPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 140, 66, 0.20); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 7px rgba(255, 140, 66, 0.06); }
}
@media (prefers-reduced-motion: reduce) {
  .rest-add-tile, .rest-add-plus { animation: none; }
  .btn.attention { animation: none; }
}
/* 分类 / 标签管理：菜品分类一行两个 */
.cm-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cm-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 7px 6px 11px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.cm-cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.cm-cat-badge { flex-shrink: 0; padding: 2px 6px; font-size: 11px; }
.cm-cat-acts { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.cm-cat-acts .rest-act { width: 26px; height: 26px; font-size: 12px; }
.rest-act:disabled { opacity: 0.4; cursor: not-allowed; }
/* 餐厅表单：人均价格 / 菜品种类 下拉框占 1/3（比原来窄 1/3），右侧内容占 2/3 */
.rf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }
/* 餐厅表单：适合餐类四个独立圆球按钮（可多选），一排紧凑排列；直径与同行左侧下拉框等高 */
.rf-meal-btns {
  --rf-ctl-h: calc(14px * 1.55 + 10px * 2 + 1.5px * 2);
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 10px;
}
.rf-meal-btns .chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--rf-ctl-h);
  height: var(--rf-ctl-h);
  padding: 0;
  border-radius: 50%;
  font-size: 13px;
  white-space: nowrap;
}
.rf-meal-btns .chip:not(.active) { background: var(--card-2); border-color: var(--line); }
.rf-label-hint { color: var(--text-3); font-size: 11.5px; }
/* 餐厅表单：支持方式（堂食 / 外卖）两个独立圆钮，至少选一种、可全选 */
.rf-mode-title { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.rf-mode-btns { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.rf-mode-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--card-2);
  border: 1.5px solid var(--line);
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.12s;
}
.rf-mode-btn:hover { border-color: var(--primary-dim); }
.rf-mode-btn:active { transform: scale(0.94); }
.rf-mode-btn.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary);
  font-weight: 600;
}
/* 餐厅表单：店名与支持方式同排；右侧标题与两个圆钮对齐 */
.rf-name-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 6px; }
.field.rf-name-field > label { margin-bottom: 0; }
.rf-name-field .rf-mode-title { text-align: center; }
/* 餐厅表单：推荐菜一行一个，右侧「＋」增加、行间距紧凑 */
.rf-dish-list { display: flex; flex-direction: column; gap: 6px; }
.rf-dish-row { display: flex; align-items: center; gap: 6px; }
.rf-dish-row .char-input-wrap { flex: 1; min-width: 0; }
.rf-dish-row .rf-dish-input { flex: 1; min-width: 0; }
.rf-dish-row .rf-dish-add { color: var(--primary); background: var(--primary-soft); }
/* 菜品表单：可选辣度 + 价格档位 同一行各占一半（minmax(0,1fr) + min-width:0 防止长标签把另一栏挤走） */
.df-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.df-row > .field { min-width: 0; }
/* 菜品表单：菜名与菜品图上传框同一行；框高与菜名输入框一致，比例 4:3 */
.df-name-row { display: flex; gap: 12px; align-items: flex-start; }
.df-name-field { flex: 1; min-width: 0; }
.df-img-field { flex-shrink: 0; }
.df-img-box-wrap { position: relative; }
.df-img-box {
  height: 46px;
  width: auto;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.df-img-box:hover { border-color: var(--primary); background: #fff; box-shadow: var(--shadow); }
.df-img-box img { width: 100%; height: 100%; object-fit: cover; }
.df-img-plus { font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1; }
.df-img-tip { font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.3; }
.df-img-clear {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(74, 59, 49, 0.75);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s, transform 0.12s;
}
.df-img-clear:hover { background: #d05a4c; }
.df-img-clear:active { transform: scale(0.88); }
/* 菜品表单：制作详情输入框加高，方便写做法步骤 */
.field textarea.df-how { min-height: 200px; }
.rest-top { display: flex; align-items: flex-start; gap: 8px; }
.rest-head-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rest-acts { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.rest-top .spacer { flex: 1; }
.rest-name { font-weight: 700; font-size: 18px; }
.rest-dinein { background: var(--green); color: #2f7d4f; font-weight: 600; }
.rest-takeout { background: var(--blue); color: #3f6db4; font-weight: 600; }
.rest-modes.both { background: linear-gradient(135deg, var(--green), var(--blue)); color: #355d4a; font-weight: 600; }
.tag.restaurant-only { background: var(--amber); color: #9a6a12; font-weight: 600; }
/* 点单 / 管理共用右上角圆形按钮：点单为加号，管理为删除叉号 */
.rest-acts-order .rest-cart-add { margin-left: 0; }
/* 抽奖页「符合条件的餐厅」列表 */
.tag.hot { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.rest-eligible { display: flex; flex-direction: column; gap: 7px; }
.re-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-2);
  border-radius: 10px;
  font-size: 14px;
}
.re-item .re-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest-act {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, transform 0.12s;
}
.rest-act:hover { background: var(--primary-soft); color: var(--primary); }
.rest-act.danger:hover { background: #ffe3e0; color: #d05a4c; }
.rest-act:active { transform: scale(0.88); }
.rest-dishes { display: flex; flex-wrap: wrap; gap: 6px; }

/* 网格布局中的卡片不受「相邻卡片间距」规则影响，否则第二张起会被压下 16px、显得更小 */
.rest-grid .card + .card,
.stats-grid .card + .card,
.user-grid .card + .card { margin-top: 0; }
.price-tag { font-size: 12px; padding: 2px 8px; border-radius: 7px; }
.price-cheap { background: var(--green); color: #2f7d47; }
.price-medium { background: var(--amber); color: #9a6a12; }
.price-expensive { background: var(--pink); color: #c05b78; }

/* ---------------- 弹窗 ---------------- */
/* 弹窗打开时锁定页面滚动（配合 modal() 里的 body.modal-open），防止滑动穿透。
   同时补上滚动条宽度，避免隐藏滚动条后内容变宽、背景卡片重新排版/缩放 */
body.modal-open { overflow: hidden; overscroll-behavior: none; padding-right: var(--modal-scrollbar-w, 0px); }
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(74, 59, 49, 0.4);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 18px;
  overscroll-behavior: none;
  animation: fadeIn 0.2s ease both;
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.modal.wide { max-width: 700px; }
/* 订单详情：一行 4 个菜品，弹窗加宽让卡片更大；卡片与标题行间距收紧 */
.modal.order-detail-modal { max-width: 1180px; }
.order-detail-modal .modal-body { padding-top: 0; }
.order-detail-modal .od-items { margin-top: 2px; }
/* 订单详情：发起人/制餐人与时间信息紧跟标题右侧 */
.order-detail-modal .modal-head { flex-wrap: wrap; }
.modal-head .od-time-meta, .modal-head .od-people-meta { margin: 0; font-weight: 400; font-size: 12.5px; }
/* 点餐 / 编辑订单：稍加宽，菜品一行 3 个 */
.modal.order-form-modal { max-width: 840px; }
.modal.closing { animation: modalOut 0.2s ease both; }
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 20px 12px;
  font-weight: 700;
  font-size: 17px;
}
.modal-head .spacer { flex: 1; }
.modal-close { color: var(--text-3); font-size: 20px; padding: 2px 8px; border-radius: 8px; transition: background 0.2s; }
.modal-close:hover { background: var(--bg-2); color: var(--text); }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; overscroll-behavior: contain; }
/* 弹窗数据加载中的占位（弹窗先开、数据后填，保证按钮即时可交互） */
.modal-loading { display: flex; align-items: center; justify-content: center; min-height: 180px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 18px; }

/* ---------------- Toast / 骨架屏 / 灯箱 ---------------- */
#toast-root {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
  pointer-events: none;
  padding: 0 12px;
  box-sizing: border-box;
}
.toast {
  padding: 11px 18px;
  border-radius: 14px;
  background: rgba(74, 59, 49, 0.92);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  max-width: min(86vw, 420px);
  word-break: break-word;
}
@media (max-width: 480px) {
  .toast { font-size: 13.5px; padding: 10px 14px; max-width: 88vw; }
}
.toast.success { background: rgba(79, 174, 107, 0.94); }
.toast.error { background: rgba(208, 90, 76, 0.94); }
.toast.out { animation: toastOut 0.25s ease both; }

.skeleton { border-radius: 12px; background: linear-gradient(90deg, #f6ebe1 25%, #fdf7f1 50%, #f6ebe1 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skel-card { height: 84px; margin-bottom: 12px; }
.skel-line { height: 14px; margin-bottom: 8px; }

.spinner {
  width: 34px;
  height: 34px;
  border: 3.5px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 30px auto;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(38, 30, 24, 0.92);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease both;
  user-select: none;
}
.lightbox img { max-width: 92vw; max-height: 78vh; border-radius: 12px; animation: popIn 0.28s ease both; }
.lightbox-close { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 28px; padding: 6px 12px; }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 30px;
  width: 48px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }
.lightbox-caption { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.85); font-size: 13.5px; }

/* ---------------- 照片墙 ---------------- */
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.photo-upload-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--card-2);
  color: var(--text-3);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
}
.photo-upload-box:hover { border-color: var(--primary); color: var(--primary); background: #fff6ee; }
.photo-upload-box:active { transform: scale(0.98); }
.photo-upload-box .pub-plus { font-size: 42px; line-height: 1; font-weight: 300; }
.photo-upload-box .pub-text { font-size: 13px; }
.photo-add {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--card-2);
  color: var(--text-3);
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.photo-add:hover { border-color: var(--primary); color: var(--primary); background: #fff6ee; }
.photo-upload-box.uploading, .photo-add.uploading { opacity: 0.55; pointer-events: none; }
/* 今日美食：照片与上传方块保持同样大小（随容器自适应） */
.photo-strip .photo-thumb { width: 100%; aspect-ratio: 1 / 1; height: auto; border-radius: 16px; }
.photo-thumb {
  width: 92px;
  height: 92px;
  border-radius: 13px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: var(--shadow);
}
.photo-thumb:hover { transform: scale(1.05); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}
/* 触屏设备：放大删除按钮点击区域 */
@media (hover: none), (pointer: coarse), (max-width: 768px) {
  .photo-del {
    width: 28px;
    height: 28px;
    top: 6px;
    right: 6px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.62);
  }
  .photo-del:active { background: #d05a4c; }
}

/* ---------------- 抽奖（拉霸机样式） ---------------- */
.lottery-layout { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.lottery-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.lottery-sub { margin: 0; color: var(--text-3); font-size: 13px; }
.lottery-method-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.lottery-method-head .card-title { margin-bottom: 0; }

.slot-machine {
  position: relative;
  width: 100%;
  max-width: 300px;
  padding: 16px 20px 18px;
  border-radius: 26px;
  background: linear-gradient(160deg, #4f4038 0%, #332a24 100%);
  box-shadow: 0 18px 44px rgba(74, 59, 49, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}
.machine-lights { display: flex; gap: 11px; }
.machine-lights i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6a584c;
  transition: background 0.25s, box-shadow 0.25s;
}
.slot-machine.spinning .machine-lights i {
  background: var(--primary-2);
  box-shadow: 0 0 9px var(--primary);
  animation: lightBlink 0.45s ease-in-out infinite alternate;
}
.slot-machine.show-result .machine-lights i { background: var(--green-deep); box-shadow: 0 0 7px rgba(79, 174, 107, 0.7); }

.slot-window {
  position: relative;
  width: 156px;
  height: 100px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff9f2 0%, #ffe9d6 100%);
  box-shadow: inset 0 7px 16px rgba(74, 59, 49, 0.22), inset 0 -5px 12px rgba(74, 59, 49, 0.12), 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.slot-reel { display: flex; flex-direction: column; align-items: center; }
.slot-reel span { height: 100px; line-height: 100px; font-size: 50px; }
.slot-reel.spinning { animation: reelLoop 0.24s linear infinite; }
.slot-result {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  opacity: 0;
}
.slot-machine.show-result .slot-reel { visibility: hidden; }
.slot-machine.show-result .slot-result { opacity: 1; animation: popIn 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.4) both; }

.slot-go {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, #ff7a2f 100%);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 2px;
  box-shadow: 0 8px 20px rgba(255, 122, 47, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.12s, filter 0.2s;
}
.slot-go:hover { filter: brightness(1.06); }
.slot-go:active { transform: scale(0.96); }
.slot-go:disabled { filter: grayscale(0.35); cursor: not-allowed; transform: none; }

.result-cards { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
/* 抽奖结果卡片：顶部通栏菜图（4:3），下方居中菜名 / 类型，与菜单卡片观感一致 */
.result-card {
  background: linear-gradient(160deg, #fff8f1, #fff);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  width: 140px;
  text-align: center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: popIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
.result-card .rc-thumb { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.result-card .rc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-card .rc-emoji { font-size: 26px; padding: 24px 12px 8px; }
.result-card .rc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; justify-content: center; flex: 1; }
.result-card .rc-name { font-weight: 700; font-size: 14.5px; line-height: 1.4; }

.spec-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 480px; }
.spec-slot .sel { width: 100%; }
.spec-row .sel-btn { padding: 10px 10px; font-size: 13.5px; gap: 6px; }
.tabs { display: inline-flex; background: var(--bg-2); padding: 4px; border-radius: 13px; gap: 3px; }
.tab {
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
  transition: all 0.22s;
}
.tab.active { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 3px 10px rgba(214, 163, 116, 0.18); }

/* ---------------- 积分 ---------------- */
.points-hero {
  background: linear-gradient(120deg, #ffb27a, #ff8c42 55%, #ff9fb6);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: 0 12px 32px rgba(255, 140, 66, 0.32);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.points-hero .num { font-size: 44px; font-weight: 800; line-height: 1.1; letter-spacing: 1px; }
.points-hero .num-label { opacity: 0.86; font-size: 13.5px; }
.points-hero .spacer { flex: 1; }
.points-hero .rule { font-size: 12.5px; opacity: 0.9; text-align: right; line-height: 1.7; }
.redeem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.redeem-card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  text-align: center;
  transition: all 0.22s;
  cursor: pointer;
}
.redeem-card:hover { border-color: var(--primary-dim); background: var(--card-2); transform: translateY(-2px); }
.redeem-card .emoji { font-size: 30px; }
.redeem-card .name { font-weight: 700; margin-top: 6px; }
.redeem-card .cost { color: var(--primary); font-size: 13.5px; font-weight: 700; margin: 5px 0 10px; }
.coupon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 13px;
  border: 1.5px dashed var(--primary-dim);
  background: linear-gradient(120deg, #fff8f2, #fff);
  border-radius: 14px;
  padding: 13px 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.coupon:hover { border-color: var(--primary); background: #fff6ee; }
.coupon:active { transform: scale(0.99); }
.coupon.used { border-color: var(--line); filter: grayscale(0.9); opacity: 0.65; }
/* 我的券 / 指定给我的券：电脑端一行两个，手机端单列 */
.coupon-list { display: grid; gap: 10px; }
@media (min-width: 769px) {
  .coupon-list { grid-template-columns: repeat(2, 1fr); }
}

/* 券说明弹窗：票面（本票信息 + 说明）+ 操作区 + 时间线 */
.coupon-info { display: flex; flex-direction: column; gap: 12px; }
.coupon-info .ci-ticket {
  display: flex;
  flex-direction: column;
  border: 1.5px dashed var(--primary-dim);
  border-radius: 14px;
  background: linear-gradient(120deg, #fff8f2, #fff);
  overflow: hidden;
}
/* 票面左侧（手机端为顶部）：积分 / 状态 / 来自谁 */
.coupon-info .ci-stub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 13px;
  border-bottom: 1.5px dashed var(--primary-dim);
}
.coupon-info .ci-cost { color: var(--primary); font-weight: 700; font-size: 15px; }
.coupon-info .ci-state { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--bg-2); color: var(--text-3); }
.coupon-info .ci-state.s-assigned { background: #fff3d9; color: var(--amber-deep); }
.coupon-info .ci-state.s-marked { background: #e4f0ff; color: #4a86d8; }
.coupon-info .ci-state.s-used { background: #f3eeea; color: #a99c92; }
.coupon-info .ci-state.s-ok { background: var(--green); color: var(--green-deep); }
.coupon-info .ci-state.s-short { background: #ffe9e6; color: #d05a4c; }
.coupon-info .ci-from { margin-left: auto; font-size: 12px; color: var(--text-3); }
.coupon-info .ci-desc { padding: 12px 13px; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }
/* 指定使用人：做成一眼可点的区域（白底按钮式 chip + ＋/✓ 前缀） */
.coupon-info .ci-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fdf3e9;
  border: 1px solid #f2ddc8;
  border-radius: 12px;
  padding: 11px 12px;
}
.coupon-info .ci-pick-head { color: var(--text); font-size: 13px; font-weight: 700; }
.coupon-info .ci-hint { color: var(--text-3); font-size: 12px; line-height: 1.5; }
.coupon-info .ci-pick .chips { gap: 8px; }
.coupon-info .ci-pick .chip {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  padding: 6px 13px;
  font-size: 13px;
  box-shadow: 0 1px 4px rgba(160, 108, 58, 0.1);
}
.coupon-info .ci-pick .chip:hover { border-color: var(--primary); color: var(--primary); }
.coupon-info .ci-pick .chip:not(.active)::before { content: '＋'; margin-right: 4px; color: var(--text-3); font-size: 11px; }
.coupon-info .ci-pick .chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.coupon-info .ci-pick .chip.active::before { content: '✓'; margin-right: 4px; font-size: 11px; }
/* 流程提示：单条文字，不再重复状态与人员 */
.coupon-info .ci-note { color: var(--primary); font-size: 13px; line-height: 1.5; }
.coupon-info .ci-note b { color: inherit; }
/* 底部时间线 */
.coupon-info .cp-meta {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
/* 电脑端：票面左右分栏（左本票信息，右说明） */
@media (min-width: 769px) {
  .modal.coupon-modal { max-width: 600px; }
  .modal.redeem-modal { max-width: 520px; }
  .redeem-modal .ci-cost { font-size: 20px; }
  .coupon-info .ci-ticket { display: grid; grid-template-columns: 108px 1fr; }
  .redeem-modal .ci-ticket { grid-template-columns: 132px 1fr; }
  .coupon-info .ci-stub {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 14px 8px;
    border-bottom: none;
    border-right: 1.5px dashed var(--primary-dim);
  }
  .coupon-info .ci-from { margin-left: 0; }
  .coupon-info .ci-desc { padding: 14px 16px; font-size: 14px; }
}
.coupon .emoji { font-size: 26px; flex-shrink: 0; }
.coupon .cp-body { flex: 1 1 200px; min-width: 0; }
.coupon .name { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.coupon .meta { color: var(--text-3); font-size: 12.5px; }
.coupon .cp-action { flex-shrink: 0; margin-left: auto; display: flex; align-items: center; white-space: nowrap; }
.coupon .spacer { flex: 1; }
.points-log { display: flex; flex-direction: column; }
.points-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px dashed var(--line); }
.points-row:last-child { border-bottom: none; }
.points-row .reason { flex: 1; font-size: 14px; }
.points-row .time { color: var(--text-3); font-size: 12px; }
.points-row .delta { font-weight: 700; }
.points-row .delta.plus { color: var(--green-deep); animation: floatUp 0.5s ease; }
.points-row .delta.minus { color: #d05a4c; }
/* 积分明细：查看更多 */
.points-more { width: 100%; margin-top: 10px; }

/* ---------------- 相册 / 统计 / 用户 ---------------- */
/* 相册按日期分组：每组宽度随照片数增加，电脑端一行最多 4 天、手机端最多 2 天 */
.album-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 14px; align-items: start; }
.album-date-group { min-width: 0; grid-column: span var(--span-d, 1); }
.album-date-title { font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.album-grid { display: grid; grid-template-columns: repeat(var(--span-d, 1), minmax(0, 1fr)); gap: 10px; }
/* 电脑端按 4:3 保持照片比例，避免宽屏下高度过矮 */
.album-grid .photo-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-card { text-align: center; padding: 18px 10px; }
.stat-card .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-card .label { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.rank-row { display: flex; align-items: center; gap: 11px; padding: 9px 2px; }
.rank-no {
  width: 25px; height: 25px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; background: var(--bg-2); color: var(--text-2); flex-shrink: 0;
}
.rank-no.top1 { background: linear-gradient(135deg, #ffd77a, #ffb347); color: #7a5200; }
.rank-no.top2 { background: #e8e8ee; color: #6b6b78; }
.rank-no.top3 { background: #f3d8c2; color: #8a5a34; }
.rank-name { width: 110px; font-size: 14px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { flex: 1; height: 11px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.rank-bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary-2), var(--primary)); transition: width 0.7s cubic-bezier(0.2, 0.9, 0.3, 1); }
.rank-count { width: 46px; text-align: right; color: var(--text-2); font-size: 13px; flex-shrink: 0; }
.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut-figure { position: relative; width: 200px; height: 200px; flex-shrink: 0; }
.donut-svg { width: 100%; height: 100%; display: block; }
.donut-seg {
  cursor: pointer;
  transition: stroke-dasharray 0.9s cubic-bezier(0.25, 0.8, 0.3, 1), stroke-width 0.18s ease, opacity 0.18s ease;
}
.donut-svg.is-hover .donut-seg { opacity: 0.25; }
.donut-svg.is-hover .donut-seg.hot { opacity: 1; stroke-width: 7.8; }
.donut-center {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.donut-center-num { font-size: 27px; font-weight: 800; color: var(--text); line-height: 1.1; transition: color 0.18s; }
.donut-center-label { font-size: 12px; color: var(--text-3); margin-top: 3px; max-width: 104px; transition: color 0.18s; }
.donut-legend {
  display: flex; flex-direction: column; gap: 4px; font-size: 13.5px;
  /* 图例过多时滚动，默认约显示 5.5 条（5 条完整 + 第 6 条露出一半，提示可滚动） */
  max-height: 190px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px;
}
.donut-legend .legend-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 10px; cursor: default;
  transition: background 0.18s, transform 0.18s;
}
.donut-legend .legend-item:hover { transform: translateX(3px); }
.donut-legend .dot { width: 10px; height: 10px; }
/* 饼图 / 图例 / 趋势图：禁止选中文字，避免点击或拖动时出现灰色选区矩形 */
.donut-figure, .donut-legend, .trend-chart { user-select: none; -webkit-user-select: none; }
.card-title-hint {
  padding: 2px 8px; border-radius: 999px;
  background: var(--bg-2); color: var(--text-3);
  font-size: 11.5px; font-weight: 600; vertical-align: 2px;
}
.dist-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 18px; }
.dist-block { flex: 1 1 100%; min-width: 0; }
/* 菜品分类 / 用餐方式：两块同行时各至少 440px，保证环形图（200px）+ 右侧图例（最长约 190px）放得下；
   近 6 个月趋势图独占一行 */
.dist-block.dist-share,
.dist-block.dist-method { flex: 1 1 440px; }
.dist-label { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 10px; }
.trend-chart { display: flex; align-items: flex-end; gap: 8px; padding: 8px 2px 2px; }
.trend-col { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trend-col::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translate(-50%, 4px);
  background: var(--text); color: #fff;
  padding: 4px 9px; border-radius: 8px; font-size: 12px; white-space: nowrap;
  opacity: 0; pointer-events: none; z-index: 2;
  transition: opacity 0.18s, transform 0.18s;
}
.trend-col:hover::after { opacity: 1; transform: translate(-50%, 0); }
.trend-val { font-size: 12px; font-weight: 700; color: var(--text-2); height: 16px; }
.trend-val.zero { color: var(--text-3); font-weight: 400; }
.trend-bar { width: 100%; max-width: 52px; height: 142px; display: flex; align-items: flex-end; }
.trend-bar > i {
  width: 100%; height: 0; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  transition: height 0.8s cubic-bezier(0.2, 0.9, 0.3, 1), filter 0.18s;
}
.trend-bar > i.zero { height: 4px; background: var(--bg-2); }
.trend-col:hover .trend-bar > i:not(.zero) { filter: brightness(1.1) saturate(1.1); }
.trend-x { font-size: 12px; color: var(--text-3); }

.user-grid {
  display: grid;
  /* 300px 起排；min() 保证窄屏不会因为固定最小列宽而溢出 */
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 14px;
}
/* 用户卡：左头像、中资料、右操作列；内容垂直居中，避免底部空白 */
.user-card { display: flex; align-items: center; gap: 12px; min-width: 0; }
.uc-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.uc-info { flex: 1 1 auto; min-width: 0; }
.user-card .avatar { width: 42px; height: 42px; font-size: 17px; flex-shrink: 0; }
.user-card .name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; overflow-wrap: anywhere; }
.user-card .meta { color: var(--text-3); font-size: 12.5px; line-height: 1.55; }
/* 加入日期不拆行；最近上线在下一行，空间不足时才换行 */
.join-date { white-space: nowrap; }
.last-seen { white-space: normal; }
.user-card .last-seen { display: block; }
/* 操作按钮竖排在右侧，避免占用资料行的横向空间 */
.uc-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; flex: 0 0 auto; }
.uc-actions .btn { white-space: nowrap; }
/* 超窄屏兜底：右侧确实放不下时，操作按钮换到资料下方一行 */
@media (max-width: 360px) {
  .user-card { flex-wrap: wrap; }
  .uc-main { flex: 1 1 100%; }
  .uc-actions { width: 100%; flex-direction: row; justify-content: flex-end; }
}
/* 在线中：绿点 + 文案（最近 90 秒内有请求） */
.online { color: #2f7d47; }
.online i {
  display: inline-block; width: 7px; height: 7px; margin-right: 4px;
  border-radius: 50%; background: var(--green-deep); vertical-align: 1px;
  animation: pulse 1.6s ease-in-out infinite;
}
/* 登录审计（表格：时间 / 用户 / 结果 / 源IP地址） */
.audit-table-wrap { overflow-x: auto; margin: 0 -2px; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.audit-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3);
  padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.audit-table td { padding: 7px 8px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.audit-table tbody tr:last-child td { border-bottom: none; }
.audit-at { color: var(--text-3); white-space: nowrap; }
.audit-at span + span { margin-left: 5px; }
.audit-user { font-weight: 700; overflow-wrap: anywhere; }
.audit-ok { color: #2f7d47; white-space: nowrap; }
.audit-fail { color: #d05a4c; white-space: nowrap; }
.audit-ip {
  color: var(--text-3); font-size: 12px; overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* 手机端：固定列宽 + 时间拆两行，保证 4 列完整显示 */
@media (max-width: 768px) {
  .audit-table { font-size: 11px; table-layout: fixed; }
  .audit-table th { font-size: 12px; }
  .audit-ip { font-size: 11px; }
  .audit-table th, .audit-table td { padding: 6px 3px; }
  .audit-table th:nth-child(1), .audit-table td:nth-child(1) { width: 24%; }
  .audit-table th:nth-child(2), .audit-table td:nth-child(2) { width: 20%; }
  .audit-table th:nth-child(3), .audit-table td:nth-child(3) { width: 14%; }
  .audit-table th:nth-child(4), .audit-table td:nth-child(4) { width: 42%; }
  .audit-at span { display: block; }
  .audit-at span + span { margin-left: 0; }
}
/* 个人资料卡右侧的账号操作按钮组 */
.account-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 手机端：头像+名称与账号操作按钮全部水平居中（按钮另起一行） */
@media (max-width: 768px) {
  .profile-card { justify-content: center; }
  .profile-card .spacer { display: none; }
  .profile-card .account-actions { flex-basis: 100%; justify-content: center; }
}

/* 更多功能入口（手机端） */
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.more-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
@media (hover: hover) and (pointer: fine) {
  .more-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
}
.more-card .more-icon { font-size: 26px; flex-shrink: 0; }
.more-card .more-name { font-weight: 700; font-size: 15px; }
.more-card .more-desc { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.more-card .more-arrow { margin-left: auto; color: var(--text-3); font-size: 18px; }

/* 通知列表 */
.notice-modal { max-width: 620px; }
.notice-modal .modal-body { max-height: 62vh; }
.notice-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.notice-tabs .chip b { font-weight: 700; margin-left: 2px; }
#notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice-item {
  display: flex;
  gap: 10px;
  padding: 8px 11px;
  cursor: pointer;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(214, 163, 116, 0.10);
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.notice-item:hover { border-color: #f1cdb4; box-shadow: var(--shadow); }
.notice-item.unread { background: #fff7f0; }
.notice-item.unread .n-title { font-weight: 700; }
.notice-item.read { opacity: 0.72; }
.notice-item.read .n-title { font-weight: 500; color: var(--text-2); }
.notice-item .n-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.notice-item .n-body { color: var(--text-2); font-size: 10.5px; line-height: 1.4; margin-top: 1px; }
.notice-item .n-time { color: var(--text-3); font-size: 10px; line-height: 1.3; margin-top: 1px; }
.notice-state {
  align-self: center;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 7px;
}
.notice-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; }

/* 选菜器 */
.picker-cats { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
/* 编辑订单：制餐人 / 选择菜品 / 用餐人数 固定同一行；宽度比例 6 : 14 : 5（制餐人比原 2/5 缩减 2/5，让给搜索框） */
.of-method-row { display: grid; grid-template-columns: 6fr 14fr 5fr; column-gap: 8px; row-gap: 5px; }
.of-group-label { font-size: 13px; color: var(--text-2); }
.of-method-row > .of-group-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-method-row input[type="search"] { width: 100%; min-width: 0; }

.picker-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  padding: 7px;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s;
}
.picker-item:hover { background: var(--bg-2); }
.picker-item.selected { background: var(--primary-soft); }
.picker-item .pi-main { flex: 1; min-width: 0; }
/* 菜名超过约 8 个汉字后向右淡隐 */
.picker-item .pi-name {
  width: 8em;
  max-width: 100%;
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
}
.picker-item .pi-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.picker-item .pi-count { color: var(--text-3); font-size: 12px; }
.picker-item .method-tag { padding: 1px 8px; font-size: 11px; border-radius: 6px; }
.picker-check {
  width: 20px; height: 20px; border-radius: 7px; border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: transparent;
  transition: all 0.18s; flex-shrink: 0;
}
.picker-item.selected .picker-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.selected-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--bg-2); border-radius: 12px; padding: 9px 12px; margin-top: 11px; font-size: 13px;
}
.selected-bar .sel-chip { display: inline-flex; align-items: center; gap: 5px; background: #fff; border-radius: 8px; padding: 3px 9px; box-shadow: var(--shadow); }
.selected-bar .sel-chip button { color: var(--text-3); font-size: 13px; }
.selected-bar .sel-chip button:hover { color: #d05a4c; }

/* ---------------- 响应式（900px / 768px 断点） ---------------- */
/* 窄屏订单卡：进度条独占一行；发起人/制餐人信息与按钮同一行，按钮靠右（放不下时自动换行） */
@media (max-width: 900px) {
  .order-bottom { align-items: center; gap: 8px; }
  .order-bottom .order-foot { flex: 1 1 auto; }
  .order-bottom.has-progress .od-progress { flex: 1 1 100%; min-width: 0; }
  .order-bottom.has-progress .order-foot-info { flex: 0 1 auto; min-width: 0; }
  .order-foot { flex-direction: row; align-items: flex-end; gap: 8px 10px; }
  .order-foot-info { flex: 1 1 120px; width: auto; min-width: 0; }
  .order-actions { margin-left: auto; justify-content: flex-end; }
}

@media (max-width: 768px) {
  /* 移动端改为纵向流式布局：否则顶栏与内容会被 flex 排成一行、互相挤压 */
  .app { display: block; }
  /* 订单详情：手机端一行固定两个菜品 */
  .od-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 订单详情：手机端重新加购 / 删除订单改为订单卡片左滑操作，详情内隐藏 */
  .order-detail-modal #od-readd,
  .order-detail-modal #od-delete { display: none; }
  /* 取消申请提示：手机端字号压小，避免占满卡片（比电脑端小 3.5 号） */
  .order-cancel-req { font-size: 9.5px; padding: 5px 9px; margin-top: 0; border-radius: 8px; }
  /* 手机端菜品选择器一行两个 */
  .picker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 手机端：制餐人 / 选择菜品搜索框 / 用餐人数 同一行，宽度按 2 : 2 : 1 划分 */
  .order-form-modal .of-method-row { column-gap: 6px; row-gap: 4px; }
  /* 点餐 / 编辑订单：手机端弹窗整体缩小（内边距 / 字号 / 按钮 / 标签 / 输入框） */
  .modal.order-form-modal { max-width: 100%; }
  .order-form-modal .modal-head { font-size: 12.5px; padding: 12px 13px 8px; }
  .order-form-modal .modal-close { font-size: 14px; }
  .order-form-modal .modal-body { padding: 2px 13px 10px; }
  .order-form-modal .modal-foot { gap: 8px; padding: 10px 13px 13px; }
  .order-form-modal .modal-foot .btn { font-size: 11.5px; padding: 7px 13px; border-radius: 10px; }
  .order-form-modal .field { margin-bottom: 9px; }
  .order-form-modal .field > label:not(.check) { font-size: 10.5px; margin-bottom: 5px; }
  .order-form-modal .field input[type="date"],
  .order-form-modal .field input[type="search"],
  .order-form-modal .date-pick-btn { padding: 7px 10px; font-size: 11.5px; border-radius: 10px; }
  /* 日期 + 四个餐次按钮固定同一行：日期定宽，餐次按剩余宽度四等分，不换行 */
  .order-form-modal .date-meal-row {
    display: grid;
    grid-template-columns: 122px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .order-form-modal .date-meal-row input[type="date"],
  .order-form-modal .date-meal-row .date-pick { flex: none; width: 100%; min-width: 0; }
  .order-form-modal .meal-slot { width: 100%; min-width: 0; }
  /* 手机端餐次按钮：文字紧凑排列（隐藏图标），与日期同一行 */
  .order-form-modal .meal-btns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    flex-wrap: nowrap;
  }
  .order-form-modal .meal-btns .chip {
    width: 100%;
    min-width: 0;
    padding: 10px 2px;
    font-size: 10px;
    white-space: nowrap;
  }
  .order-form-modal .meal-btns .mb-icon { display: none; }
  .order-form-modal .chip { padding: 5px 11px; font-size: 10.5px; }
  .order-form-modal .of-group-label { font-size: 10.5px; }
  .order-form-modal .sel-btn { padding: 7px 10px; font-size: 11.5px; gap: 6px; border-radius: 10px; }
  .order-form-modal .sel-arrow { font-size: 8px; }
  .sel-menu.sel-menu-sm .sel-opt { font-size: 13px; }
  .order-form-modal .picker-cats { gap: 5px; margin: 8px 0; }
  .order-form-modal .picker-list { gap: 5px; padding: 5px; border-radius: 11px; max-height: 220px; }
  .order-form-modal .picker-item { padding: 6px 8px; gap: 6px; border-radius: 9px; }
  .order-form-modal .picker-item .pi-name { font-size: 11px; }
  .order-form-modal .picker-item .pi-meta { gap: 5px; margin-top: 2px; flex-wrap: wrap; }
  .order-form-modal .picker-item .pi-count { font-size: 9px; }
  .order-form-modal .picker-item .method-tag { padding: 1px 6px; font-size: 9px; border-radius: 6px; }
  .order-form-modal .picker-check { width: 16px; height: 16px; font-size: 9px; border-radius: 6px; }
  .order-form-modal .empty { font-size: 13px; }
  .order-form-modal .selected-bar { padding: 7px 10px; margin-top: 9px; font-size: 10.5px; border-radius: 10px; gap: 6px; }
  .order-form-modal .selected-bar .sel-chip { font-size: 10.5px; padding: 2px 7px; gap: 4px; }
  .order-form-modal .selected-bar .sel-chip button { font-size: 10px; }
  /* 统计「美食分布」：手机端每个板块独占一行 */
  .dist-block, .dist-block.dist-share, .dist-block.dist-method { flex: 1 1 100%; }
  /* 统计页：手机端整体缩小字号 / 标签 / 图形，饼图与文字说明同行显示 */
  .stats-page .page-head h2 { font-size: 16px; }
  .stats-page .card { padding: 14px; }
  .stats-page .card-title { font-size: 14px; margin-bottom: 9px; }
  .stats-page .card-title-hint { font-size: 10.5px; padding: 1px 7px; }
  .stats-page .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .stats-page .stat-card { padding: 11px 6px; }
  .stats-page .stat-card .num { font-size: 20px; }
  .stats-page .stat-card .label { font-size: 11px; margin-top: 2px; }
  .stats-page .rank-row { gap: 8px; padding: 6px 2px; }
  .stats-page .rank-no { width: 20px; height: 20px; font-size: 10.5px; border-radius: 6px; }
  .stats-page .rank-name { width: 66px; font-size: 11.5px; }
  .stats-page .rank-bar { height: 8px; }
  .stats-page .rank-count { width: 38px; font-size: 11px; }
  .stats-page .empty { padding: 12px !important; font-size: 12px; }
  .stats-page .dist-label { font-size: 11.5px; margin-bottom: 7px; }
  .stats-page .donut-wrap { gap: 12px; flex-wrap: nowrap; }
  .stats-page .donut-figure { width: 126px; height: 126px; }
  .stats-page .donut-center-num { font-size: 17px; }
  .stats-page .donut-center-label { font-size: 9.5px; margin-top: 2px; max-width: 66px; }
  .stats-page .donut-legend { flex: 1; min-width: 0; gap: 2px; font-size: 11px; max-height: 137px; padding-right: 3px; }
  .stats-page .donut-legend .legend-item { padding: 3px 6px; border-radius: 8px; gap: 5px; }
  .stats-page .donut-legend .dot { width: 8px; height: 8px; }
  .stats-page .trend-chart { gap: 5px; padding: 6px 2px 2px; }
  .stats-page .trend-col { gap: 4px; }
  .stats-page .trend-val { font-size: 10.5px; height: 13px; }
  .stats-page .trend-bar { height: 104px; max-width: 36px; }
  .stats-page .trend-x { font-size: 10px; }

  /* 订单筛选：手机端默认收起，点「筛选」按钮弹出 */
  .filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.32);
  }
  .filter-toggle:hover { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%); filter: brightness(1.04); }
  .filter-toggle.active {
    color: #fff;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45), 0 4px 12px rgba(255, 140, 66, 0.4);
  }
  .filter-toggle svg { width: 12px; height: 12px; flex-shrink: 0; }
  /* 订单记录页头：手机端标题 / 数量 / 日期区间 / 筛选按钮统一调小 3px */
  .orders-page .page-head h2 { font-size: 15px; }
  .orders-page .order-count,
  .orders-page .order-range { font-size: 10px; }
  .orders-page .filter-toggle { font-size: 10.5px; padding: 5px 11px; border-radius: 999px; }
  .filter-card { padding: 11px; display: none; }
  .filter-card.open { display: block; animation: fadeSlideIn 0.22s ease; }
  /* 状态 / 发起人 / 制餐人三个下拉同一行，等分自适应；手机端整体缩小控件 */
  .filter-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .filter-row .filter-sel { width: 100%; min-width: 0; }
  .filter-row .sel-btn { padding: 4px 7px; font-size: 10.5px; gap: 3px; border-radius: 9px; }
  .filter-row .sel-arrow { font-size: 8px; }
  .filter-row .date-range { grid-column: 1 / -1; flex-wrap: wrap; gap: 5px; justify-content: center; }
  .filter-row .date-range .date-pick { flex: 0 1 auto; width: auto; min-width: 0; }
  .filter-row .date-range .date-pick-btn { padding: 4px 7px; gap: 3px; font-size: 10.5px; border-radius: 9px; }
  .filter-row .date-range .dp-icon { width: 12px; height: 12px; }
  .filter-row .date-range .date-sep { font-size: 10.5px; }
  /* 订单菜品：手机端固定一行四个，图片保持 4:3；间距收窄让单卡图片更大 */
  .order-dishes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .order-dish { width: auto; min-width: 0; }
  /* 订单卡片电脑端为自适应网格，手机端需覆盖回固定一行四个 */
  .order-card .order-dishes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  /* 一行四个时收窄内边距与字号，保证菜名尽量少换行 */
  .order-list .order-dish { padding: 5px; font-size: clamp(8.5px, 2.5vw, 10px); gap: 4px; }
  .order-list .order-dish i { font-size: clamp(9px, 2.5vw, 10.5px); }
  /* 订单卡片标签（日期 / 餐别 / 状态 / 菜品待制作）：统一调小并随屏宽自适应 */
  .order-list .order-top { gap: 6px 7px; }
  .order-list .method-tag,
  .order-list .tag,
  .order-list .status-badge { font-size: clamp(7px, 2vw, 8.5px); padding: 2px 8px; gap: 4px; }
  .order-list .order-points-tip { font-size: clamp(7px, 2vw, 8.5px); }
  /* 手机端：订单卡片内边距收紧，标签 / 菜品卡距卡片边缘更紧凑 */
  .order-list .oc-swipe { padding: 9px 10px; }
  /* 手机端：订单卡片底部按钮全部收进左滑托盘，随窗口大小实时切换 */
  .order-list .order-actions .btn { display: none; }
  /* 左滑托盘：每列最多 3 个按钮，超过自动增列；按钮整体缩小，尺寸随数量自适应 */
  .oc-tray {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
    grid-auto-columns: 60px;
    align-content: center;
    gap: 5px;
    width: auto;
    padding: 6px;
  }
  .oc-tray .oc-tray-btn {
    padding: 4px 3px;
    font-size: 10.5px;
    border-radius: 8px;
  }
  /* 手机端进度与按钮都不可见时，空底栏整体收起，避免卡片底部留白过大 */
  .order-list .order-bottom:not(.has-info) { display: none; }
  /* 手机端订单卡隐藏制作 / 点单进度条与文字（电脑端与订单详情弹窗保留） */
  .order-card .od-progress { display: none; }
  /* 日历当日餐食卡：卡片宽度随菜品自适应（不再整行撑满）；一行最多三个菜品，宽度按屏宽三等分保证三个正好放一行 */
  .meal-card .order-dishes { display: flex; flex-wrap: wrap; }
  .meal-card .order-dish { width: calc((100vw - 68px) / 3); }
  /* 手机端订单卡片阴影再加深一些，轮廓更清晰 */
  .order-card { box-shadow: 0 10px 28px rgba(146, 94, 44, 0.28), 0 3px 10px rgba(146, 94, 44, 0.15); }
  /* 菜品分类：竖排列表，左侧吸顶（贴屏幕左缘）；项之间用留白分隔，选中项用浅橙圆角底块强调 */
  /* 内容列左右各留 5px：左侧 gap 5px；右侧用负外边距把 .view 的 13px 内边距收紧为 5px，工具栏与菜品卡片同步 */
  .menu-body { display: flex; align-items: flex-start; gap: 5px; position: relative; margin-top: -14px; margin-right: -8px; }
  .menu-main { flex: 1 1 0; min-width: 0; }
  /* 分类栏与菜品卡片之间加一条细分隔线：向上贯通到工具栏顶部，底端渐隐避免生硬切割 */
  .menu-body::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 48px;
    width: 1px;
    z-index: 26;
    background: linear-gradient(180deg, rgba(160, 108, 58, 0.25) 0, rgba(160, 108, 58, 0.25) calc(100% - 16px), transparent 100%);
    pointer-events: none;
  }
  #menu-cats {
    flex: 0 0 auto;
    width: 60px;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0 0 0 -13px;
    padding: 2px 0;
    position: sticky;
    top: calc(var(--topbar-h) + 4px);
    z-index: 25;
    /* 扣掉底部导航及 iPhone 安全区，避免最底部按钮被导航栏遮住 */
    max-height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - env(safe-area-inset-bottom, 0px) - 8px);
    max-height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - env(safe-area-inset-bottom, 0px) - 8px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-padding-bottom: 8px;
    overscroll-behavior: contain;
  }
  #menu-cats::-webkit-scrollbar { display: none; }
  /* 分类过多需要滚动时：底部渐隐，滚动末尾留出空间，避免露出半截标签背景 */
  #menu-cats.scrollable {
    padding-bottom: 18px;
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 18px), transparent 100%);
  }
  /* 分类项：整行列表样式（占满一行宽度 + 分隔线），不再是圆角椭圆块 */
  #menu-cats .chip,
  #menu-cats .chip:not(.active),
  #menu-cats .chip.active {
    flex-shrink: 0;
    width: 100%;
    padding: 12px 4px;
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    word-break: break-all;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(160, 108, 58, 0.22);
    border-radius: 0;
    box-shadow: none;
  }
  #menu-cats .chip:first-child { border-top: 1px solid rgba(160, 108, 58, 0.22); }
  #menu-cats .chip:last-child { border-bottom: none; }
  #menu-cats .chip:active { transform: none; }
  #menu-cats .chip.active {
    color: var(--primary);
    font-weight: 700;
    background: var(--primary-soft);
  }
  /* 点餐切换 / 搜索 / 排序 / 管理操作：手机端一行自适应，控件统一高度并整体缩小
     （工具栏在手机端移入右侧菜品列并吸顶冻结，top 由 JS 按布局文档坐标设置；
      用实色背景，滚动时菜品从下方穿过；不用毛玻璃，避免部分手机浏览器闪出黑色细线伪影） */
  .menu-toolbar {
    gap: 4px;
    flex-wrap: nowrap;
    position: sticky;
    z-index: 24;
    /* 左右各外扩 5px：背景铺满整列直到屏幕边缘 */
    margin: 0 -5px;
    padding: 8px 5px;
    /* 按视口坐标取与页面相同的斜向渐变（fixed）：与背景无缝一致，避免出现色带 */
    background: linear-gradient(135deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 100%) fixed;
  }
  .menu-toolbar .mode-toggle,
  .menu-toolbar .search,
  .menu-toolbar .sel-btn,
  .menu-toolbar #manage-meta,
  .menu-toolbar #add-dish { height: 31px; font-size: 12.5px; border-radius: 8.5px; }
  /* 仅缩小「管理 / 搜索 / 排序」文字，其余控件字号保持不变 */
  .menu-toolbar .mode-toggle,
  .menu-toolbar .search,
  .menu-toolbar .sel-btn { font-size: 11.5px; }
  .menu-toolbar .menu-search-wrap { min-width: 0; flex: 1 1 0%; height: 31px; }
  .menu-toolbar .menu-search-wrap .search { height: 31px; padding-right: 29px; }
  .menu-toolbar .menu-search-clear { right: 4px; width: 21px; height: 21px; font-size: 15px; }
  /* 「分类/标签」「新增菜品」：高度始终与菜单搜索框一致（不随所在容器变化） */
  #manage-meta,
  #add-dish { height: 31px; }
  .menu-toolbar .mode-toggle { padding: 0 7px; gap: 3.5px; flex-shrink: 0; }
  .menu-toolbar .search { min-width: 0; flex: 1 1 0%; padding: 0 7px; }
  .menu-toolbar .sel-btn { padding: 0 6px; gap: 3.5px; }
  .menu-toolbar .sel-arrow { font-size: 12px; }
  .menu-toolbar .menu-sort-slot { width: auto; flex: 0 0 auto; }
  .menu-toolbar #manage-meta,
  .menu-toolbar #add-dish { min-width: 81px; padding-left: 3px; padding-right: 3px; white-space: nowrap; flex: 0 0 auto; }
  /* 购物车：手机端整体缩小标题 / 字号 / 标签 / 按钮，适配窄屏 */
  .cart-modal .modal-head { font-size: 13.5px; padding: 12px 13px 8px; }
  .cart-modal .modal-close { font-size: 15px; }
  .cart-modal .modal-body { padding: 2px 13px 10px; }
  #cart-list { gap: 6px; }
  .cart-item { gap: 7px; padding: 6px 7px; border-radius: 10px; }
  .cart-check .cb-box { width: 14px; height: 14px; border-radius: 5px; }
  .cart-check .cb-box::after { width: 7px; height: 4px; }
  .ci-img { width: 34px; height: 34px; border-radius: 8px; }
  .placeholder-mini { font-size: 13px; }
  .ci-name { gap: 4px; font-size: 13.5px; }
  .cart-modal .ci-name .method-tag,
  .cart-modal .ci-name .tag { font-size: 8px; padding: 0 4px; border-radius: 4px; gap: 2px; }
  .ci-edit { gap: 5px; margin-top: 4px; }
  .ci-edit .qty-btn { width: 20px; height: 20px; font-size: 11px; border-radius: 6px; }
  .ci-edit .qty-num { min-width: 18px; font-size: 11.5px; }
  .ci-budget { padding: 1px 5px 1px 6px; font-size: 10.5px; border-radius: 7px; }
  .ci-budget-input { width: 44px; font-size: 11px; }
  .ci-line-total { font-size: 10px; }
  .cart-remove { width: 26px; height: 26px; font-size: 12px; }
  .cart-total { font-size: 10.5px; padding: 7px 2px 0; }
  .cart-total b { font-size: 12px; }
  .cart-modal .ct-missing { font-size: 10px; }
  .cart-foot { gap: 7px; padding: 9px 2px 2px; margin-top: 6px; }
  .cart-foot .check { font-size: 11.5px; gap: 5px; }
  .cart-foot .btn { height: 29px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }
  /* 结算表单（日期与餐次 / 制餐人 / 本次结算）：手机端整体缩小，日期与餐次下拉固定同一行 */
  .checkout-modal .field > label:not(.check) { font-size: 11.5px; margin-bottom: 5px; }
  .checkout-modal .field input[type="date"],
  .checkout-modal .field input[type="search"] { padding: 7px 10px; font-size: 12.5px; border-radius: 10px; }
  .checkout-modal .date-pick-btn { font-size: 12.5px; border-radius: 10px; }
  /* 日期 + 四个餐次圆钮固定同一行：日期定宽，餐次按剩余宽度四等分，窄屏自动缩小圆钮 */
  .checkout-modal .date-meal-row {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .checkout-modal .date-meal-row input[type="date"],
  .checkout-modal .date-meal-row .date-pick { flex: none; width: 100%; min-width: 0; }
  .checkout-modal .date-pick-btn { padding: 7px 8px; }
  .checkout-modal .meal-slot { width: 100%; min-width: 0; }
  .checkout-modal .co-meal-btns {
    --co-ctl-h: calc(12.5px * 1.55 + 7px * 2 + 1.5px * 2);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
    justify-items: center;
    gap: 4px;
  }
  .checkout-modal .co-meal-btns .chip {
    width: min(var(--co-ctl-h), 100%);
    min-width: 0;
    height: auto;
    aspect-ratio: 1;
    font-size: 12px;
  }
  .checkout-modal .co-person-row { gap: 6px; }
  .checkout-modal .co-person-col > label { font-size: 11.5px; margin-bottom: 5px; }
  .checkout-modal .co-person-col.co-people-col { flex-basis: 88px; }
  .checkout-modal .sel-btn { padding: 7px 10px; font-size: 12.5px; gap: 6px; border-radius: 10px; }
  .checkout-modal .sel-arrow { font-size: 9px; }
  .checkout-modal .checkout-summary { font-size: 12.5px; padding: 8px 11px; border-radius: 10px; }
  .checkout-modal .modal-foot { gap: 8px; padding: 8px 13px 12px; }
  .checkout-modal .modal-foot .btn { height: 34px; padding: 0 15px; font-size: 12.5px; border-radius: 9px; }
  /* 加入购物车面板：手机端整体缩小标题 / 图片 / 标签 / 按钮 / 输入框，适配窄屏 */
  .add-sheet-modal .modal-head { font-size: 13.5px; padding: 12px 13px 8px; }
  .add-sheet-modal .modal-close { font-size: 15px; }
  .add-sheet-modal .modal-body { padding: 2px 13px 10px; }
  .add-sheet-modal .as-img { max-width: 210px; margin-bottom: 9px; border-radius: 10px; }
  .add-sheet-modal .field { margin-bottom: 9px; }
  .add-sheet-modal .field > label:not(.check) { font-size: 11.5px; margin-bottom: 5px; }
  .add-sheet-modal .as-required { font-size: 9.5px; }
  .add-sheet-modal .chips { gap: 5px; }
  .add-sheet-modal .chip { padding: 4px 10px; font-size: 11px; }
  .add-sheet-modal .as-method-row { gap: 7px; }
  .add-sheet-modal .as-add { height: 28px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }
  .rest-add-modal .ras-add { height: 24px; padding: 0 9px; font-size: 11px; border-radius: 7px; }
  /* 金额框与「加入购物车」按钮同一行：不换行，金额框自适应缩短 */
  .add-sheet-modal .as-qty-row { gap: 7px; flex-wrap: nowrap; }
  .add-sheet-modal .as-qty-row .qty-stepper { flex: none; }
  .add-sheet-modal .qty-btn { width: 22px; height: 22px; font-size: 12px; border-radius: 7px; }
  .add-sheet-modal .qty-num { min-width: 18px; font-size: 11.5px; }
  .add-sheet-modal .qty-stepper input.qty-num-input { width: 40px; }
  .add-sheet-modal .as-amount-input { flex: 1 1 0; height: 24px; padding: 0 9px; font-size: 11.5px; border-radius: 8px; }
  .add-sheet-modal .as-qty-row .as-add { flex: none; margin-left: 0; }
  .sidebar { display: none; }
  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    z-index: 30;
  }
  /* 顶栏：手机端整体压紧（高度 / 字号 / 通知标签缩小） */
  :root { --topbar-h: 46px; }
  .topbar .brand-logo { font-size: 21px; }
  .topbar .brand-name { font-size: 14px; }
  /* 顶栏右侧：餐厅快捷入口 + 消息提醒（紧挨铃铛左侧） */
  .topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .topbar .top-rest {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: linear-gradient(135deg, #fff1e4 0%, #ffe3ee 100%);
    border: 1.5px solid var(--primary-dim);
    transition: box-shadow 0.2s, transform 0.12s, filter 0.2s;
  }
  .topbar .top-rest:active { transform: scale(0.97); }
  .topbar .top-rest.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), #ff7a2f);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.32);
  }
  .topbar .bell { margin-left: 0; padding: 5px 8px; font-size: 12px; gap: 6px; }
  .topbar .bell .bell-text { display: none; }
  .topbar .bell .bell-badge { min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; border-radius: 8px; }
  .view {
    margin-left: 0;
    padding: 14px 13px calc(var(--tabbar-h) + 26px);
  }
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 40;
  }
  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-3);
    font-size: 10px;
    transition: color 0.2s;
  }
  .tab-item .nav-icon { font-size: 18px; width: auto; display: inline-flex; align-items: center; justify-content: center; }
  .tab-item .nav-icon svg { width: 1em; height: 1em; display: block; }
  /* 点单图标小一号 */
  .tab-item .nav-icon svg.ti-menu { width: 0.88em; height: 0.88em; }
  /* 订单角标：紧跟「订单」文字之后，比桌面端小一号 */
  .tab-item .tab-label { display: inline-flex; align-items: center; gap: 3px; }
  .tab-item .nav-badges { display: inline-flex; align-items: center; gap: 3px; }
  .tab-item .nav-badge { min-width: 12px; height: 12px; padding: 0 3px; font-size: 8.5px; line-height: 12px; border-radius: 6px; box-shadow: none; }
  .tab-item.active { color: var(--primary); font-weight: 700; }
  .page-head h2 { font-size: 18px; }
  /* 页头上下间距收紧 5px */
  .page-head { margin-top: -5px; margin-bottom: 13px; }
  .lottery-layout { grid-template-columns: 1fr; }
  /* 抽奖页：手机端整体缩小字号 / 按钮 / 标签 / 拉霸机，适配窄屏 */
  .lottery-page .page-head h2 { font-size: 16px; }
  .lottery-sub { font-size: 11.5px; }
  .lottery-page .card { padding: 14px; }
  .lottery-page .card-title { font-size: 14px; margin-bottom: 9px; }
  .lottery-method-head { gap: 8px; margin-bottom: 9px; }
  .lottery-method-head .card-title { margin-bottom: 0; }
  .lottery-method-head .btn { padding: 4px 10px; font-size: 11.5px; border-radius: 8px; }
  .lottery-page .chips { gap: 6px; }
  .lottery-page .chip { padding: 5px 11px; font-size: 11.5px; }
  .lottery-page .tag { padding: 2px 7px; font-size: 10.5px; }
  .lottery-page .order-meta { font-size: 11px; }
  .lottery-page .tabs { padding: 3px; border-radius: 11px; }
  .lottery-page .tab { padding: 6px 13px; font-size: 12.5px; border-radius: 8px; }
  .slot-machine { max-width: 100%; padding: 13px 16px 15px; gap: 9px; border-radius: 22px; }
  .machine-lights { gap: 9px; }
  .machine-lights i { width: 6px; height: 6px; }
  .slot-window { width: 132px; height: 85px; border-radius: 15px; }
  .slot-reel span { height: 85px; line-height: 85px; font-size: 42px; }
  .slot-result { font-size: 46px; }
  .slot-go { padding: 10px 14px; font-size: 14.5px; letter-spacing: 1.5px; border-radius: 12px; }
  .lottery-page .spec-row .sel-btn { padding: 7px 8px; font-size: 11.5px; gap: 5px; border-radius: 10px; }
  .lottery-page .spec-row .sel-arrow { font-size: 9px; }
  /* 手机端：抽奖区并入「套餐规格」卡片，去掉内层卡片样式，视觉上是一个整体 */
  .lottery-page #l-spec-card .lottery-stage {
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }
  .lottery-page #l-spec-card #l-spec-fields:not(.hidden) + .lottery-stage { margin-top: 14px; }
  .result-card { width: 122px; border-radius: 12px; }
  .result-card .rc-emoji { font-size: 22px; padding: 18px 10px 6px; }
  .result-card .rc-body { padding: 8px 10px 10px; }
  .result-card .rc-name { font-size: 13px; }

  /* 手机端：一行一道菜（左图右文：菜名 / 两行标签 / 一行简介）
     卡片高度固定，保证每张卡片都能完整显示菜名 + 最多两行标签 + 一行简介，列表参差更整齐 */
  .dish-grid { gap: 7px; }
  .dish-col { gap: 7px; }
  /* 圆角随图片放大同步适配：外圆角 = 图片圆角(9px) + 与卡片的最小间距(上下 5px)，两者视觉同心 */
  .dish-card { flex-direction: row; align-items: stretch; height: 96px; border-radius: 14px; }
  /* 图片固定为正方形缩略图并垂直居中：避免随卡片文字行数被拉伸，导致各卡片图片大小不一 */
  .dish-img { flex: 0 0 90px; width: 90px; height: 90px; align-self: center; aspect-ratio: auto; border-radius: 9px; margin: 3px 0 3px 3px; }
  .dish-img .placeholder { font-size: 26px; }
  .dish-count { top: 2px; left: 2px; font-size: 7px; padding: 1px 4px; }
  .dish-body { padding: 8px 10px; justify-content: flex-start; overflow: hidden; }
  .dish-name { font-size: 14px; line-height: 1.35; flex-wrap: nowrap; }
  .dish-name .dn-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dish-tags { order: 2; gap: 3px; margin-top: 4px; max-height: 33px; overflow: hidden; }
  /* 简介固定贴卡片底部：标签行数少时自动拉开间距，行数满时保留最小间距 */
  .dish-desc { order: 3; font-size: 10px; margin-top: auto; padding-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 点餐卡片：加购圆钮跟在简介行最右端（管理卡片仍是无圆钮的 .dish-desc） */
  .dish-desc-row { order: 3; margin-top: auto; padding-top: 2px; display: flex; align-items: center; gap: 6px; }
  .dish-desc-row .dish-desc { order: 0; margin-top: 0; padding-top: 0; flex: 1 1 auto; min-width: 0; }
  .dish-name .tag,
  .dish-tags .tag,
  .dish-tags .price-tag { font-size: 9px; padding: 0 5px; height: 15px; display: inline-flex; align-items: center; border-radius: 5px; }
  .dish-desc-row .dish-add { position: static; flex: 0 0 auto; width: 20px; height: 20px; font-size: 12px; }
  .dish-desc-row .dish-add.has-count { font-size: 10px; }
  /* 手机端点菜页 / 餐厅页：右下角共享购物车悬浮球（总数 + 菜品 / 餐厅两个角标），位置上移让开底部导航 */
  .cart-mfab {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  }
  .modal { max-height: 92vh; }
  /* 菜品制作详情：手机端再高一些，计数固定在底部预留行 */
  .field textarea.df-how { min-height: 240px; }
  /* 订单详情头部：标题与发起人 / 制餐人同一行，创建 / 开始制作 / 完成时间独占下一行，关闭按钮固定右上角 */
  .order-detail-modal .modal-head { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; padding: 14px 14px 10px; }
  .order-detail-modal .modal-head > span:first-child { flex: 0 0 auto; padding-right: 0; }
  .order-detail-modal .modal-head .od-people-meta { flex: 1 1 auto; min-width: 0; padding-right: 34px; }
  .order-detail-modal .modal-head .od-people-meta,
  .order-detail-modal .modal-head .od-time-meta { font-size: 8px; margin: 0; white-space: nowrap; }
  .order-detail-modal .modal-head .od-time-meta { flex: 1 1 100%; }
  .order-detail-modal .modal-head .od-time-meta::before { content: none; }
  .order-detail-modal .modal-head .spacer { display: none; }
  .order-detail-modal .modal-head .modal-close { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); font-size: 23px; }
  /* 订单详情：手机端卡片与「订单详情」标题左对齐（内边距一致）；间距收紧让卡片略大 */
  .order-detail-modal .modal-body { padding-left: 14px; padding-right: 14px; }
  .order-detail-modal .od-items { gap: 8px; }
  /* 订单详情：手机端字号整体收紧，尽量少换行 */
  .order-detail-modal .od-item-flip .od-flip-front { gap: 6px; padding: 8px 9px; }
  .order-detail-modal .od-item-head { gap: 5px; }
  .order-detail-modal .od-check { width: 20px; height: 20px; font-size: 11px; margin-top: 0; }
  .order-detail-modal .od-check.static { font-size: 12px; }
  .order-detail-modal .od-name-row { gap: 4px; }
  .order-detail-modal .od-name { font-size: 11px; }
  .order-detail-modal .od-item-tags { gap: 3px; margin-top: 4px; }
  .order-detail-modal .od-item-tags .tag { font-size: 8px; padding: 1px 4px; border-radius: 5px; }
  .order-detail-modal .od-state { font-size: 8px; padding: 1px 4px; }
  .order-detail-modal .od-budget { font-size: 7.5px; padding: 1px 6px; border-radius: 6px; }
  .order-detail-modal .od-budget-input { width: 52px; font-size: 7.5px; padding: 1px 6px; }
  .order-detail-modal .od-flip-title { font-size: 12px; }
  .order-detail-modal .od-flip-text { font-size: 11.5px; line-height: 1.5; }
  .order-detail-modal .od-flip-mask { font-size: 12px; }
  .order-detail-modal .od-total { font-size: 12px; gap: 4px; }
  .order-detail-modal .od-total b { font-size: 14px; }
  .order-detail-modal .od-actions { gap: 8px; margin-top: 12px; }
  .order-detail-modal .od-actions .btn { font-size: 12.5px; padding: 7px 11px; }
  /* 消息提醒：手机端标签 / 字体 / 按钮整体缩小 */
  .notice-modal .notice-tabs { gap: 6px; margin-bottom: 10px; }
  .notice-modal .notice-tabs .chip { padding: 5px 11px; font-size: 12px; }
  #notice-list { gap: 8px; }
  .notice-item { gap: 8px; padding: 7px 9px; border-radius: 10px; }
  .notice-item .n-title { font-size: 12.5px; }
  .notice-item .n-body { font-size: 9.5px; }
  .notice-item .n-time { font-size: 9px; }
  .notice-state { font-size: 10px; padding: 1px 6px; border-radius: 6px; }
  .notice-unread-dot { width: 7px; height: 7px; margin-top: 4px; }
  .notice-modal .modal-foot { gap: 8px; padding: 10px 14px 14px; }
  .notice-modal .modal-foot .btn { font-size: 12.5px; padding: 7px 12px; }
  /* 餐厅：手机端搜索框放大、「新增餐厅」按钮收紧为一行小条 */
  .rest-toolbar { gap: 6px; margin-bottom: 10px; }
  .rest-toolbar .search { height: 32px; font-size: 12.5px; border-radius: 10px; min-width: 0; padding: 0 11px; }
  .rest-toolbar .rest-sort-slot { width: auto; flex: 0 0 auto; }
  .rest-toolbar .sel-btn { height: 32px; padding: 0 9px; font-size: 11.5px; border-radius: 10px; }
  .rest-add-tile { flex-direction: row; min-height: 0; padding: 10px 14px; gap: 7px; font-size: 13px; border-radius: 12px; }
  .rest-add-plus { width: 28px; height: 28px; font-size: 17px; }
  /* 餐厅编辑弹窗：手机端整体缩小，输入框 / 标签不超出边框 */
  .rest-modal .modal-head { font-size: 16px; }
  .rest-modal .modal-body { padding: 4px 14px 14px; }
  .rest-modal .field { margin-bottom: 11px; }
  .rest-modal .field > label { font-size: 12px; margin-bottom: 5px; }
  .rest-modal .field input,
  .rest-modal .sel-btn { font-size: 12.5px; padding: 8px 10px; border-radius: 10px; }
  .rest-modal .rf-row { gap: 8px; }
  .rest-modal .rf-meal-btns { --rf-ctl-h: calc(12.5px * 1.55 + 8px * 2 + 1.5px * 2); gap: 5px; }
  .rest-modal .rf-meal-btns .chip { font-size: 11px; }
  .rest-modal .rf-label-hint { font-size: 10px; }
  .rest-modal .rf-name-field { grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 5px; }
  .rest-modal .rf-name-field > label { margin-bottom: 0; }
  .rest-modal .rf-mode-title { font-size: 10px; }
  .rest-modal .rf-mode-btns { gap: 6px; }
  .rest-modal .rf-mode-btn { width: 36px; height: 36px; font-size: 11px; }
  .rest-modal .rf-dish-list { gap: 5px; }
  .rest-modal .rf-dish-row { gap: 5px; }
  .rest-modal .rf-dish-input { font-size: 12.5px; padding: 8px 10px; }
  /* 备注 / 推荐菜带字数统计：手机端也要保留右侧计数空间 */
  .rest-modal .field .char-input-wrap input { padding-right: 54px; }
  .rest-modal .rest-act { width: 24px; height: 24px; font-size: 12px; }
  .rest-modal .modal-foot { padding: 10px 14px 14px; gap: 8px; }
  .rest-modal .modal-foot .btn { font-size: 12.5px; padding: 7px 14px; }
  /* 积分页：手机端整体缩小字号 / 按钮 / 标签，适配窄屏 */
  .points-page .page-head h2 { font-size: 16px; }
  .points-page .card { padding: 14px; }
  .points-page .card-title { font-size: 14px; margin-bottom: 9px; }
  .points-page .tag { padding: 2px 7px; font-size: 10.5px; }
  .points-page .order-meta { font-size: 11px; }
  .points-hero { padding: 15px 16px; gap: 8px; border-radius: 18px; }
  .points-hero .num { font-size: 30px; }
  .points-hero .num-label { font-size: 11px; }
  .points-hero .rule { font-size: 10px; line-height: 1.6; }
  /* 积分兑换：手机端固定一行四个，卡片与按钮压缩自适应 */
  .redeem-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .redeem-card { padding: 8px 3px; border-radius: 9px; }
  .redeem-card .emoji { font-size: 19px; }
  .redeem-card .name { font-size: 11px; margin-top: 3px; }
  .redeem-card .cost { font-size: 10px; margin: 2px 0 6px; }
  .redeem-card .btn.sm { width: 100%; padding: 3px 1px; font-size: 10px; border-radius: 7px; }
  /* 券行：手机端强制单行展示，不换行 */
  .coupon { flex-wrap: nowrap; padding: 9px 10px; gap: 6px 8px; }
  .coupon .emoji { font-size: 18px; }
  .coupon .cp-body { flex: 1 1 auto; overflow: hidden; }
  .coupon .name { flex-wrap: nowrap; font-size: 12px; }
  .coupon .meta { font-size: 10px; }
  .coupon .cp-action { flex-shrink: 0; }
  .coupon .cp-action .tag, .coupon .cp-action .btn { white-space: nowrap; font-size: 10px; padding: 2px 7px; }
  /* 券说明弹窗：手机端字号 / 间距收紧 */
  .coupon-modal .modal-head { font-size: 16px; }
  .coupon-info { gap: 10px; }
  .coupon-info .ci-cost { font-size: 14px; }
  .coupon-info .ci-stub { padding: 9px 11px; gap: 7px; }
  .coupon-info .ci-state { font-size: 11px; padding: 1px 8px; }
  .coupon-info .ci-from { font-size: 11px; }
  .coupon-info .ci-desc { padding: 10px 11px; font-size: 12.5px; line-height: 1.6; }
  .coupon-info .ci-pick { gap: 7px; padding: 9px 10px; }
  .coupon-info .ci-pick-head { font-size: 12px; }
  .coupon-info .ci-hint { font-size: 11px; }
  .coupon-info .ci-pick .chip { font-size: 12px; padding: 5px 11px; }
  .coupon-info .ci-note { font-size: 12px; }
  .coupon-info .cp-meta { font-size: 10px; padding-top: 8px; }
  /* 兑换说明弹窗：手机端标题收紧、按钮等宽平铺 */
  .redeem-modal .modal-head { font-size: 16px; }
  .redeem-modal .ci-cost { font-size: 16px; }
  .redeem-modal .modal-foot { gap: 8px; padding: 10px 14px 14px; }
  .redeem-modal .modal-foot .btn { flex: 1; padding: 8px 0; font-size: 13px; }
  /* 积分明细行：手机端收紧 */
  .points-row { padding: 8px 2px; gap: 8px; }
  .points-row .reason { font-size: 12px; }
  .points-row .time { font-size: 10px; }
  .points-row .delta { font-size: 12px; }
  .cal-cell { aspect-ratio: 1 / 1.05; padding: 5px 3px 3px; border-radius: 10px; }
  .cal-day { font-size: 13px; }
  .cal-dots { gap: 2px; margin-top: 3px; }
  .cal-dots .dot { width: 5px; height: 5px; }
  /* 日历图例：手机端字号与色点缩小 */
  .cal-legend { gap: 9px; padding: 10px 4px 2px; font-size: 11px; }
  .cal-legend .item { gap: 4px; }
  .cal-legend .dot { width: 6px; height: 6px; }
  .cal-hint { font-size: 11px; padding: 6px 0 2px; }
  .rank-name { width: 78px; font-size: 13px; }
  .account-actions { width: 100%; justify-content: flex-end; }
  .photo-thumb { width: 78px; height: 78px; }
  .photo-strip { grid-template-columns: repeat(2, 1fr); }
  .album-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .album-date-group { grid-column: span var(--span-m, 1); }
  .album-grid { grid-template-columns: repeat(var(--span-m, 1), minmax(0, 1fr)); gap: 8px; }
  .album-grid .photo-thumb { height: 108px; aspect-ratio: auto; }
}

@media (max-width: 380px) {
  .tab-item { font-size: 10px; }
}

/* 极窄屏：顶栏积分 / 餐厅入口收成图标，避免品牌名换行 */
@media (max-width: 350px) {
  .topbar-actions { gap: 6px; }
  .topbar-actions .top-rest { padding: 5px 8px; }
  .topbar-actions .top-rest span { display: none; }
}

/* 系统设置页：两张分组卡片，组内用分隔线和区块标题组织 */
.transfer-page .tf-card { min-width: 0; }
.transfer-page .tf-section + .tf-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.transfer-page .tf-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.transfer-page .tf-section-head .card-title { margin-bottom: 0; }
.transfer-page .tf-count {
  margin-left: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
}
.transfer-page .tf-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.transfer-page .tf-head-actions .check { font-size: 13px; white-space: nowrap; }

.transfer-page .tf-size { margin-bottom: 10px; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.transfer-page .tf-size:empty { display: none; }
.transfer-page .tf-file-line {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-all;
}
.transfer-page .tf-file-line:empty,
.transfer-page .tf-preview:empty,
.transfer-page #ug-status:empty { display: none; }
.transfer-page .tf-preview { margin-top: 6px; color: var(--text-3); font-size: 12.5px; line-height: 1.6; }
.transfer-page .tf-meta-line { color: var(--text-3); font-size: 12.5px; line-height: 1.6; }
.transfer-page #ug-status { margin-top: 6px; }
.transfer-page .tf-mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.transfer-page .tf-mode-row .chips { flex: 0 1 auto; }
.transfer-page .tf-mode-row #tf-import { margin-left: 0; }

.transfer-page .tf-version-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.transfer-page .tf-ver-label { flex: 0 0 auto; font-size: 13px; color: var(--text-2); }
.transfer-page .tf-ver-text { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.transfer-page .tf-ver-text.is-empty { color: var(--text-3); font-weight: 500; }
.transfer-page .tf-ver-editor { display: flex; align-items: center; gap: 4px; }
.transfer-page .tf-ver-prefix { font-size: 14px; font-weight: 700; color: var(--text-2); }
.transfer-page .tf-ver-dot { font-size: 14px; font-weight: 700; color: var(--text-3); }
.transfer-page .tf-ver-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.transfer-page .tf-ver-group:focus-within {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.14);
}
.transfer-page .tf-ver-group input {
  width: 34px;
  padding: 7px 2px;
  border: none;
  background: transparent;
  outline: none;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none;
  appearance: none;
}
.transfer-page .tf-ver-group input::-webkit-outer-spin-button,
.transfer-page .tf-ver-group input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.transfer-page .tf-ver-btns {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
}
.transfer-page .tf-ver-btns button {
  width: 22px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  color: var(--text-3);
  background: transparent;
  transition: background 0.15s, color 0.15s;
}
.transfer-page .tf-ver-btns button:first-child { border-bottom: 1px solid var(--line); }
.transfer-page .tf-ver-btns button:hover { background: var(--bg-2); color: var(--primary); }
.transfer-page .tf-ver-btns button:active { background: var(--primary-soft); }
.transfer-page .tf-ver-btns button:disabled { color: var(--text-3); opacity: 0.35; background: transparent; cursor: not-allowed; }
.transfer-page .tf-ver-editor.is-locked .tf-ver-group { background: var(--bg-2); }
.transfer-page .tf-ver-editor.is-locked .tf-ver-group input { color: var(--text-3); cursor: default; }

.transfer-page .tf-empty { color: var(--text-3); font-size: 12.5px; }
.transfer-page .tf-backup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.transfer-page .tf-backup-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 3px 9px;
  flex-wrap: wrap;
}
.transfer-page .tf-backup-time { font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.transfer-page .tf-backup-size { color: var(--text-3); font-size: 12.5px; }
.transfer-page .tf-backup-ver {
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.transfer-page .tf-backup-ver.legacy { color: var(--text-3); background: var(--bg-2); font-weight: 600; }
.transfer-page .tf-backup-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.transfer-page .tf-backup-actions .btn {
  background: var(--bg-2);
  border: none;
  box-shadow: none;
  color: var(--text-2);
  font-weight: 500;
}
.transfer-page .tf-backup-actions .btn:hover { background: var(--primary-soft); }
.transfer-page .tf-backup-actions .tf-act-primary { color: var(--primary); }
.transfer-page .tf-backup-actions .tf-act-success { color: var(--green-deep); }
.transfer-page .tf-backup-actions .tf-act-danger { color: var(--red-deep); }
.transfer-page .tf-backup-actions .btn.sm {
  min-width: 56px;
  height: 30px;
  padding: 0 12px;
  justify-content: center;
}

/* 手机端：分区标题与操作可换行，字号 / 控件整体缩小 */
@media (max-width: 768px) {
  .transfer-page .page-head { margin-bottom: 12px; }
  .transfer-page .page-head h2 { font-size: 16px; }
  .transfer-page .tf-card + .tf-card { margin-top: 12px; }
  .transfer-page .card { padding: 13px; }
  .transfer-page .tf-section + .tf-section { margin-top: 12px; padding-top: 12px; }
  .transfer-page .tf-section-head { gap: 8px; margin-bottom: 10px; }
  .transfer-page .card-title { font-size: 13.5px; }
  .transfer-page .tf-count { font-size: 10.5px; }
  .transfer-page .tf-head-actions { gap: 6px; }
  .transfer-page .tf-head-actions .check { font-size: 11.5px; }
  .transfer-page .tf-size { margin-bottom: 8px; font-size: 11px; }
  .transfer-page .tf-file-line { font-size: 11.5px; }
  .transfer-page .tf-preview,
  .transfer-page .tf-meta-line { font-size: 11px; }
  .transfer-page .tf-mode-row { gap: 8px; margin-top: 8px; }
  .transfer-page .tf-version-row { gap: 8px; margin-bottom: 8px; }
  .transfer-page .tf-ver-label { font-size: 11.5px; }
  .transfer-page .tf-ver-text { font-size: 12.5px; }
  .transfer-page .tf-ver-prefix,
  .transfer-page .tf-ver-dot { font-size: 12px; }
  .transfer-page .tf-ver-editor { gap: 3px; }
  .transfer-page .tf-ver-group { border-radius: 8px; }
  .transfer-page .tf-ver-group input { width: 30px; padding: 5px 1px; font-size: 12px; }
  .transfer-page .tf-ver-btns button { width: 20px; height: 14px; font-size: 8px; }
  .transfer-page .tf-backup-item { padding: 8px 0; gap: 6px 8px; }
  .transfer-page .tf-backup-time { font-size: 12px; }
  .transfer-page .tf-backup-size { font-size: 10.5px; }
  .transfer-page .tf-backup-ver { font-size: 10.5px; padding: 1px 6px; }
  .transfer-page .tf-backup-actions { gap: 6px; }
  .transfer-page .tf-backup-actions .btn.sm { min-width: 48px; height: 26px; padding: 0 9px; }
  .transfer-page .btn { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
  .transfer-page .btn.sm { padding: 4px 9px; font-size: 11px; border-radius: 8px; }
  .transfer-page .chip { font-size: 11px; padding: 4px 9px; }
}

/* 餐厅加购弹窗：所有元素整体加大一号 */
.rest-add-modal .modal-head { padding: 19px 22px 14px; font-size: 19px; }
.rest-add-modal .modal-close { font-size: 22px; }
.rest-add-modal .modal-body { padding: 4px 22px 18px; }
.rest-add-modal .field { margin-bottom: 15px; }
.rest-add-modal .field > label:not(.check) { font-size: 14.5px; margin-bottom: 7px; }
.rest-add-modal .chips { gap: 9px; }
.rest-add-modal .chip { padding: 8px 16px; font-size: 15px; }
.rest-add-modal .as-qty-row { gap: 12px; }
.rest-add-modal .qty-btn { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
.rest-add-modal .qty-stepper input.qty-num-input { width: 36px; font-size: 16px; }
.rest-add-modal .as-amount-input { height: 35px; padding: 0 14px; font-size: 15px; border-radius: 11px; }
.rest-add-modal .ras-add { height: 35px; padding: 0 18px; font-size: 14px; border-radius: 11px; }

@media (max-width: 768px) {
  .rest-add-modal .modal-head { padding: 13px 15px 9px; font-size: 15px; }
  .rest-add-modal .modal-close { font-size: 18px; }
  .rest-add-modal .modal-body { padding: 3px 15px 12px; }
  .rest-add-modal .field { margin-bottom: 10px; }
  .rest-add-modal .field > label:not(.check) { font-size: 12.5px; margin-bottom: 6px; }
  .rest-add-modal .chips { gap: 6px; }
  .rest-add-modal .chip { padding: 5px 12px; font-size: 12.5px; }
  .rest-add-modal .as-qty-row { gap: 8px; }
  .rest-add-modal .qty-btn { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
  .rest-add-modal .qty-stepper input.qty-num-input { width: 34px; font-size: 13px; }
  .rest-add-modal .as-amount-input { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
  .rest-add-modal .ras-add { height: 28px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
}

/* 餐厅：搜索工具栏冻结在顶部（点单 / 管理切换按钮在搜索框右侧） */
.rest-toolbar {
  position: sticky;
  top: 0;
  z-index: 24;
  margin-left: -34px;
  margin-right: -34px;
  margin-bottom: 0;
  padding: 8px 34px 14px;
  background: linear-gradient(135deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 100%) fixed;
}
.rest-toolbar .mode-toggle { padding: 9px 14px; }
@media (max-width: 768px) {
  /* 餐厅页：标题与搜索框之间收紧间距 */
  .page-head.rest-head { margin-bottom: 4px; }
  .rest-toolbar {
    top: var(--topbar-h);
    margin-left: -13px;
    margin-right: -13px;
    padding: 4px 13px 10px;
  }
  .rest-toolbar .mode-toggle { height: 32px; padding: 0 10px; font-size: 11.5px; border-radius: 10px; }

  /* 餐厅卡片：手机端保持一行一个，卡片内所有元素整体调小 */
  .rest-grid { grid-template-columns: 1fr; gap: 10px; }
  .rest-grid .rest-card { padding: 12px; gap: 7px; border-radius: 14px; }
  /* 手机端：图片在左并占满「名称 / 简介 / 标签」三行，右侧三行依次展示 */
  .rest-body {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 10px;
    row-gap: 5px;
    align-items: stretch;
  }
  .rest-thumb {
    display: flex;
    position: relative;
    grid-column: 1;
    grid-row: 1 / 4;
    align-items: center;
    justify-content: center;
    min-height: 66px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--bg-2);
  }
  .rest-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
  .rest-thumb-ph { font-size: 26px; opacity: 0.55; }
  .rest-body .rest-top { grid-column: 2; grid-row: 1; }
  .rest-body .rest-note { grid-column: 2; grid-row: 2; }
  .rest-body .rest-meta { grid-column: 2; grid-row: 3; }
  .rest-top { gap: 6px; }
  .rest-head-main { gap: 5px; }
  .rest-name { font-size: 15.5px; }
  .rest-card .tag { font-size: 10px; padding: 2px 6px; border-radius: 6px; }
  .rest-card .rest-cart-add { width: 28px; height: 28px; font-size: 13px; }
  .rest-card .rest-act { width: 24px; height: 24px; font-size: 11px; }
  .rest-note { font-size: 11.5px; line-height: 1.45; padding-left: 7px; border-left-width: 2px; }
  .rest-meta { gap: 4px; }
  .rest-fields { gap: 5px; padding-top: 7px; }
  .rest-field { gap: 6px; }
  .rest-label { font-size: 10px; padding-top: 2px; }
  .rest-empty { font-size: 11px; padding-top: 1px; }
  .rest-dishes { gap: 4px; }
  .rest-card .dish-tag { padding: 2px 7px; }
}

/* 电脑端：饭店页改用纯淡入（去掉位移动画的影响），确保吸顶工具栏的固定背景与大背景一致 */
@media (min-width: 769px) {
  .rest-page { animation: restPageFade 0.3s ease; }
}
@keyframes restPageFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 餐厅表单：简介输入框右侧的餐厅照片上传按钮 */
.rf-note-row { display: flex; align-items: flex-start; gap: 8px; }
.rf-note-row .char-input-wrap { flex: 1; min-width: 0; }
.rf-note-row .df-img-box-wrap { flex-shrink: 0; }
.rf-note-row .df-img-plus { font-size: 18px; }

@media (max-width: 768px) {
  .rest-modal .rf-note-row .df-img-box { height: 38px; }
  .rest-modal .rf-note-row .df-img-clear { width: 17px; height: 17px; font-size: 10px; top: -6px; right: -6px; }

  /* 用户中心：用户列表字体与元素同步加大 2px */
  .user-grid { gap: 11px; }
  .user-grid .user-card { padding: 13px; gap: 9px; }
  .user-grid .uc-main { gap: 9px; }
  .user-grid .user-card .avatar { width: 36px; height: 36px; font-size: 15px; }
  .user-grid .user-card .name { font-size: 14px; gap: 5px; }
  .user-grid .user-card .name .tag { font-size: 11px; padding: 3px 7px; border-radius: 7px; }
  .user-grid .user-card .meta { font-size: 12px; line-height: 1.4; }
  .user-grid .uc-actions { flex-direction: row; align-items: center; justify-content: flex-end; gap: 6px; }
  .user-grid .uc-actions .btn.sm { font-size: 13px; padding: 6px 12px; border-radius: 10px; }
  .user-grid .online i { width: 7px; height: 7px; margin-right: 5px; }
}
