/* ==========================================================================
   Food-Yun Web · 设计系统 v2
   风格：高端餐饮质感 · 玫瑰粉主调 · 奶油白底 · 柔和阴影 · 微交互动效
   配色依据：暖色（红/粉/珊瑚）激发食欲；奶油白留白；深李子可可色作文字锚点
   ========================================================================== */

:root {
  /* ---- 品牌色阶（玫瑰 / 珊瑚，食欲系） ---- */
  --brand: #cf4a67;            /* 主色：莓果玫瑰（降饱和，更沉稳） */
  --brand-2: #e57b90;          /* 亮玫瑰 */
  --brand-coral: #e08a68;      /* 珊瑚（渐变搭档） */
  --brand-deep: #9c2a45;       /* 酒红（按压/强调） */
  --brand-soft: #fbe8ed;       /* 浅玫瑰底 */
  --brand-veil: rgba(207, 74, 103, .10);

  /* ---- 辅助色 ---- */
  --honey: #f5a623;            /* 蜂蜜金：评分/价格/时间 */
  --honey-soft: #fff4e0;
  --mint: #3fa98a;             /* 薄荷：新鲜/已完成 */
  --mint-soft: #e6f7f1;

  /* ---- 中性色（带粉调，避免冷硬） ---- */
  --bg: #fff8f6;               /* 奶油白页面底 */
  --bg-2: #fffdfc;
  --card: #ffffff;
  --text: #2c1620;             /* 深李子可可 */
  --text-2: #6e4b56;
  --text-3: #7f5f6a;             /* 对比度 ≥5.3:1（奶油底），满足 WCAG AA */
  --border: rgba(44, 22, 32, .07);
  --border-strong: rgba(44, 22, 32, .12);

  /* ---- 语义色 ---- */
  --primary: var(--brand);
  --primary-dark: var(--brand-deep);
  --primary-light: var(--brand-soft);
  --danger: #e5484d;
  --warn: var(--honey);

  /* ---- 形状与阴影 ---- */
  --radius: 18px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(94, 35, 50, .05);
  --shadow-sm: 0 4px 14px rgba(150, 60, 85, .07), 0 1px 3px rgba(94, 35, 50, .04);
  --shadow-md: 0 10px 28px rgba(150, 60, 85, .10), 0 2px 6px rgba(94, 35, 50, .05);
  --shadow-lg: 0 20px 44px rgba(150, 60, 85, .16), 0 4px 12px rgba(94, 35, 50, .06);
  --shadow-brand: 0 10px 24px rgba(232, 80, 110, .30);

  /* ---- 字体 ---- */
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
             "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC",
                  Georgia, "Times New Roman", serif;

  /* ---- 动效曲线 ---- */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --tabbar-h: 76px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 1rem; color: var(--text); }
::selection { background: var(--brand-soft); color: var(--brand-deep); }

/* 页面外壳：顶部玫瑰光晕，奶油底 */
#app {
  max-width: 640px; margin: 0 auto; min-height: 100vh; position: relative;
  background:
    radial-gradient(120% 60% at 50% -20%, rgba(255, 138, 101, .16), transparent 60%),
    radial-gradient(80% 40% at 100% 0%, rgba(232, 80, 110, .12), transparent 55%),
    var(--bg);
}
/* 注意：页面容器绝不能留 transform —— 即使单位矩阵也会成为 fixed 子元素的包含块，
   导致 .bottom-bar / tabbar 定位错位（曾出现提交按钮被 tabbar 遮挡点不到）。
   所以这里只做透明度过渡，位移交给内部的卡片揭示动画。 */
#app > .page, #app > .login-page { animation: pageFade .36s var(--ease); }

@keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 启动屏 ---------- */
.boot-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 14px; color: var(--text-3); font-size: 14px; letter-spacing: .08em;
}
.boot-logo { font-size: 60px; animation: floatY 2.4s ease-in-out infinite; filter: drop-shadow(0 12px 20px rgba(232,80,110,.25)); }
@keyframes floatY { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }

/* ---------- 页面结构 ---------- */
.page { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 28px); }
.page.no-tabbar { padding-bottom: calc(var(--safe-bottom) + 52px); }

/* 毛玻璃头部 */
.page-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 12px;
  background: rgba(255, 248, 246, .78);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--border);
}
.page-header .back-btn {
  width: 34px; height: 34px; border-radius: 50%; font-size: 18px; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  background: var(--card); box-shadow: var(--shadow-xs); border: 1px solid var(--border);
  transition: transform .2s var(--ease-spring), box-shadow .2s;
}
.page-header .back-btn:active { transform: scale(.9); }
.page-header .title {
  flex: 1; text-align: center; font-size: 16px; font-weight: 600; letter-spacing: .1em;
  color: var(--text);
}
.page-header .header-action { min-width: 40px; font-size: 14px; color: var(--brand); font-weight: 500; text-align: right; }
.page-header .header-action span { transition: opacity .2s; }
.page-header .header-action:active span { opacity: .6; }

/* ---------- 底部导航（悬浮胶囊） ---------- */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom));
  z-index: 50; max-width: 616px; margin: 0 auto;
  height: 62px; padding: 6px; display: flex; gap: 2px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: saturate(1.8) blur(20px);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 16px 34px -12px rgba(120, 40, 60, .30), var(--shadow-sm);
}
/* 导航上方渐隐：让滚动内容自然淡出，避免被“切断”的生硬感 */
.tabbar::before {
  content: ''; position: absolute; left: -12px; right: -12px; bottom: -10px;
  height: 58px; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, var(--bg) 34%, rgba(255, 248, 246, .55) 62%, transparent);
}
.tabbar-item {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 16px; color: var(--text-3); font-size: 10.5px; letter-spacing: .04em;
  transition: color .28s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease), transform .2s var(--ease);
}
.tabbar-item .tab-icon {
  font-size: 20px; line-height: 1;
  transition: transform .38s var(--ease-spring), filter .3s;
}
.tabbar-item:active { transform: scale(.94); }
.tabbar-item.active {
  color: #fff;
  background: linear-gradient(135deg, #d96680, #a83050);
  box-shadow: 0 8px 18px -6px rgba(160, 45, 72, .5);
}
.tabbar-item.active .tab-icon { transform: translateY(-1px) scale(1.12); }
.tabbar-item .badge {
  position: absolute; top: 3px; right: calc(50% - 24px);
  min-width: 17px; height: 17px; padding: 0 4px;
  background: linear-gradient(135deg, #ff9d5c, #e5484d); color: #fff;
  border-radius: 9px; font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(229, 72, 77, .45);
  animation: badgePop .4s var(--ease-spring);
}
@keyframes badgePop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- 预览模式提示条 ---------- */
.preview-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; font-size: 12px;
  color: #9a5a1a;
  background: linear-gradient(90deg, #fff6e5, #ffeccc);
  border-bottom: 1px solid rgba(245, 166, 35, .22);
}
.preview-bar .login-link { margin-left: auto; color: var(--brand); font-weight: 600; white-space: nowrap; }

/* ---------- 按钮 ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 600; letter-spacing: .04em;
  transition: transform .22s var(--ease-spring), box-shadow .28s var(--ease), opacity .2s, background .25s;
}
.btn:active { transform: scale(.965); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #e07d90 0%, var(--brand) 52%, #a52e4b 100%);
  box-shadow: 0 10px 24px rgba(160, 45, 72, .28);
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.42) 48%, transparent 62%);
  transform: translateX(-130%);
}
@media (hover: hover) {
  .btn-primary:hover { box-shadow: 0 14px 30px rgba(232, 80, 110, .38); transform: translateY(-1px); }
  .btn-primary:hover::after { animation: sheen .8s var(--ease); }
}
@keyframes sheen { to { transform: translateX(130%); } }

.btn-outline {
  color: var(--brand); background: rgba(255, 255, 255, .9);
  border: 1.5px solid rgba(232, 80, 110, .38);
}
@media (hover: hover) { .btn-outline:hover { background: var(--brand-soft); border-color: var(--brand); } }

.btn-danger { color: #fff; background: linear-gradient(135deg, #f2636a, var(--danger)); box-shadow: 0 8px 20px rgba(229,72,77,.28); }
.btn-danger-outline { color: var(--danger); background: rgba(255,255,255,.9); border: 1.5px solid rgba(229,72,77,.32); }
.btn-plain { color: var(--text); background: rgba(44, 22, 32, .06); }
@media (hover: hover) { .btn-plain:hover { background: rgba(44, 22, 32, .08); } }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 15px; font-size: 13px; font-weight: 500; }
.btn-lg { padding: 15px 26px; font-size: 16.5px; letter-spacing: .12em; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn > .ripple {
  position: absolute; border-radius: 50%; transform: scale(0); pointer-events: none;
  background: rgba(255, 255, 255, .45); animation: ripple .6s var(--ease) forwards;
}
.btn-plain > .ripple, .btn-outline > .ripple { background: rgba(232, 80, 110, .22); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}

/* ---------- 菜谱卡片 ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 12px 16px 4px; }
.recipe-card {
  position: relative; overflow: hidden;
  background: var(--card); border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .38s var(--ease), box-shadow .38s var(--ease);
  will-change: transform;
}
@media (hover: hover) {
  .recipe-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
  .recipe-card:hover .rc-img { transform: scale(1.06); }
  .recipe-card:hover .rc-name { color: var(--brand-deep); }
}
.recipe-card:active { transform: scale(.98); }
.recipe-card .rc-img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  background: linear-gradient(140deg, #fff1e6, #ffdfe6);
  transition: transform .6s var(--ease);
}
.recipe-card .rc-img-placeholder {
  display: flex; align-items: center; justify-content: center; font-size: 46px;
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(255, 176, 140, .55), transparent 60%),
    linear-gradient(140deg, #ffeef2, #ffe3e8 50%, #fff3e4);
  filter: drop-shadow(0 6px 12px rgba(232, 80, 110, .12));
}
.recipe-card .rc-body { padding: 11px 13px 13px; }
.recipe-card .rc-name {
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .25s;
}
.recipe-card .rc-desc {
  margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.9em;
}
.recipe-card .rc-meta {
  display: flex; align-items: center; gap: 8px; margin-top: 9px;
  font-size: 11px; color: var(--text-3);
}
.recipe-card .rc-creator { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1; }
.recipe-card .rc-creator span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-card .rc-meta > span:last-child { color: var(--honey); font-weight: 500; white-space: nowrap; }

.avatar {
  width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: linear-gradient(140deg, var(--brand-soft), #ffe1c9);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 1px 4px rgba(150, 60, 85, .12);
}
.avatar-lg { width: 54px; height: 54px; }
.avatar-xl { width: 74px; height: 74px; border-width: 2px; }
.avatar-placeholder { display: flex; align-items: center; justify-content: center; color: var(--brand-deep); font-weight: 600; font-size: 12px; }
.avatar-lg.avatar-placeholder { font-size: 20px; }
.avatar-xl.avatar-placeholder { font-size: 26px; }

/* 横向卡片 */
.recipe-row {
  display: flex; gap: 13px; margin: 0 16px 12px; padding: 12px;
  background: var(--card); border-radius: 18px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .34s var(--ease), box-shadow .34s var(--ease);
}
@media (hover: hover) { .recipe-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); } }
.recipe-row:active { transform: scale(.985); }
.recipe-row .rr-img {
  width: 88px; height: 88px; border-radius: 14px; object-fit: cover; flex-shrink: 0;
  background: linear-gradient(140deg, #fff1e6, #ffdfe6);
}
.recipe-row .rr-img-placeholder {
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  background: linear-gradient(140deg, #ffeef2, #ffe3e8 60%, #fff3e4);
}
.recipe-row .rr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.recipe-row .rr-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.recipe-row .rr-desc {
  margin-top: 4px; font-size: 12px; color: var(--text-3); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.recipe-row .rr-meta { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--text-3); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 8px; font-size: 11px; font-weight: 500;
  letter-spacing: .02em; white-space: nowrap;
}
.tag-scene { color: #b03060; background: linear-gradient(135deg, #ffe4ec, #ffd6e2); }
.tag-ing { color: #2f7d63; background: linear-gradient(135deg, #e2f7ef, #cdefe3); }
.tag-opt { color: #a4700f; background: linear-gradient(135deg, #fff3dc, #ffe9c4); }
.tag-opt.flavor { color: #a83258; background: linear-gradient(135deg, #ffe6ee, #ffd8e4); }

/* ---------- 筛选 chips ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row.has-more {
  -webkit-mask-image: linear-gradient(to right, #000 72%, rgba(0,0,0,.08) 100%);
  mask-image: linear-gradient(to right, #000 72%, rgba(0,0,0,.08) 100%);
}
.chip {
  flex-shrink: 0; padding: 8px 15px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: all .3s var(--ease);
}
.chip:active { transform: scale(.94); }
.chip.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #d96680, #a83050);
  box-shadow: 0 8px 18px -6px rgba(160, 45, 72, .48);
  transform: translateY(-1px);
}

/* ---------- 表单 ---------- */
.form-section {
  margin: 12px 16px; padding: 18px;
  background: var(--card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.form-section .fs-title {
  display: flex; align-items: center; gap: 7px; margin-bottom: 15px;
  font-size: 15px; font-weight: 600; letter-spacing: .03em;
}
.form-section .fs-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}
.form-item { margin-bottom: 15px; }
.form-item:last-child { margin-bottom: 0; }
.form-item label { display: block; margin-bottom: 7px; font-size: 12.5px; color: var(--text-2); letter-spacing: .03em; }
.form-item label .required { color: var(--brand); }

.input, .textarea, .select {
  width: 100%; padding: 12px 14px; font-size: 15px;
  background: #fffaf9;
  border: 1.5px solid var(--border-strong); border-radius: 14px;
  outline: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.input::placeholder, .textarea::placeholder { color: #8d6f7a; opacity: 1; }
.input:focus, .textarea:focus, .select:focus {
  background: #fff; border-color: rgba(232, 80, 110, .55);
  box-shadow: 0 0 0 4px rgba(232, 80, 110, .10);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.select { appearance: none; }

.option-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.option-item {
  padding: 8px 15px; border-radius: var(--radius-pill); font-size: 13px;
  background: #fffaf9; color: var(--text-2);
  border: 1.5px solid var(--border-strong);
  transition: all .28s var(--ease);
}
.option-item:active { transform: scale(.94); }
.option-item.selected {
  color: var(--brand-deep); font-weight: 600;
  background: linear-gradient(135deg, #fff1f4, #ffe4ec);
  border-color: rgba(232, 80, 110, .6);
  box-shadow: 0 6px 16px -8px rgba(232, 80, 110, .6);
}

.list-edit-item { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 9px; animation: fadeUp .32s var(--ease) both; }
.list-edit-item .input { flex: 1; }
.list-edit-item .remove-btn { padding: 10px 4px; color: var(--text-3); font-size: 18px; line-height: 1; transition: color .2s, transform .2s; }
.list-edit-item .remove-btn:active { transform: scale(.85); color: var(--danger); }
.add-item-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 8px 14px;
  font-size: 13.5px; font-weight: 600; color: var(--brand);
  border-radius: var(--radius-pill);
  background: rgba(232, 80, 110, .07);
  transition: background .25s, transform .2s var(--ease-spring);
}
.add-item-btn:active { transform: scale(.95); background: rgba(232, 80, 110, .13); }

/* 图片上传 */
.img-upload-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.img-upload-item {
  position: relative; width: 84px; height: 84px; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-xs); animation: pop .34s var(--ease-spring) both;
}
.img-upload-item img { width: 100%; height: 100%; object-fit: cover; }
.img-upload-item .del {
  position: absolute; top: 4px; right: 4px; width: 21px; height: 21px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; line-height: 1;
  background: rgba(44, 22, 32, .55); backdrop-filter: blur(4px);
}
.img-upload-add {
  width: 84px; height: 84px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; color: var(--text-3);
  background: #fffaf9;
  border: 1.5px dashed rgba(232, 80, 110, .35);
  transition: border-color .25s, background .25s, transform .2s var(--ease-spring);
}
.img-upload-add:active { transform: scale(.95); border-color: var(--brand); background: #fff3f5; }
.img-upload-add .plus { font-size: 21px; color: var(--brand); line-height: 1; }

/* 开关 */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch {
  position: relative; flex-shrink: 0; width: 48px; height: 28px; border-radius: 14px;
  background: rgba(44, 22, 32, .14);
  transition: background .3s var(--ease);
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(94, 35, 50, .25);
  transition: left .32s var(--ease-spring);
}
.switch.on { background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 4px 12px -2px rgba(232,80,110,.5); }
.switch.on::after { left: 23px; }

/* ---------- 空状态 / 骨架屏 ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: clamp(240px, 50vh, 520px); padding: 48px 24px;
  text-align: center; color: var(--text-3); font-size: 13.5px;
  animation: fadeUp .45s var(--ease) both;
}
/* 空状态放在网格里时占满整行，保证真正居中 */
.recipe-grid > .empty,
.skeleton-grid > .empty { grid-column: 1 / -1; width: 100%; }
.empty .empty-icon {
  width: 92px; height: 92px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; line-height: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #ffffff, #fff2f5 72%);
  box-shadow: 0 10px 24px -12px rgba(160, 45, 72, .35), inset 0 0 0 1px rgba(255, 255, 255, .9);
  animation: floatY 3.2s ease-in-out infinite;
}
.loading-wrap { padding: 44px; text-align: center; color: var(--text-3); font-size: 13px; }
.loading-spinner {
  display: inline-block; width: 26px; height: 26px; margin-bottom: 10px;
  border: 2.5px solid rgba(232, 80, 110, .16);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架屏 */
.skeleton-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 12px 16px; }
.sk-card { border-radius: 20px; overflow: hidden; background: var(--card); border: 1px solid var(--border); }
.sk-box { position: relative; overflow: hidden; background: #f7eef0; }
.sk-box::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.85) 50%, transparent 80%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sk-img { width: 100%; aspect-ratio: 1 / 1; }
.sk-line { height: 12px; margin: 11px 13px 0; border-radius: 6px; }
.sk-line.short { width: 55%; margin-bottom: 13px; }

.load-more { padding: 16px; text-align: center; font-size: 12.5px; color: var(--text-3); letter-spacing: .06em; }

/* ---------- Toast / Modal ---------- */
.toast {
  position: fixed; left: 50%; top: 42%; z-index: 999;
  transform: translate(-50%, -50%);
  max-width: 78%; padding: 12px 22px;
  border-radius: 16px; font-size: 14px; text-align: center; color: #fff;
  background: rgba(44, 22, 32, .88);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(44, 22, 32, .3);
  animation: toastIn .34s var(--ease-spring);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.9); } }

.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(44, 22, 32, .58);
  backdrop-filter: blur(8px) saturate(1.1);
  animation: maskIn .25s ease both;
}
@keyframes maskIn { from { opacity: 0; } }
.modal-mask.center { align-items: center; }
.modal-box {
  width: 100%; max-width: 640px; max-height: 84vh; overflow-y: auto;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -12px 40px rgba(94, 35, 50, .2);
  animation: sheetUp .42s var(--ease) both;
}
.modal-mask.center .modal-box {
  width: calc(100% - 72px); max-width: 360px;
  border-radius: 24px; background: #fff;
  box-shadow: 0 28px 60px -18px rgba(44, 22, 32, .5), 0 0 0 1px rgba(255, 255, 255, .6);
  animation: popIn .38s var(--ease-spring) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(10px); } }
.modal-title {
  margin-bottom: 18px; text-align: center;
  font-size: 17px; font-weight: 700; letter-spacing: .06em;
}
.modal-actions { display: flex; gap: 12px; margin-top: 22px; }
.modal-actions .btn { flex: 1; }

/* ---------- 首页 ---------- */
.home-hero {
  position: relative; overflow: hidden;
  margin: 12px 16px 0; padding: 26px 22px 44px;
  border-radius: 26px; color: #fff;
  background:
    radial-gradient(110% 120% at 88% 0%, rgba(245, 190, 140, .40), transparent 55%),
    radial-gradient(90% 110% at 6% 100%, rgba(96, 16, 42, .55), transparent 62%),
    linear-gradient(140deg, #e8909f 0%, #cf4a67 42%, #8d2340 100%);
  box-shadow: 0 22px 44px -18px rgba(120, 28, 54, .48);
}
.home-hero::before {
  content: ''; position: absolute; top: -60px; right: -40px;
  width: 190px; height: 190px; border-radius: 50%;
  background: rgba(255, 255, 255, .18); filter: blur(2px);
  animation: blobDrift 14s ease-in-out infinite;
}
.home-hero::after {
  content: ''; position: absolute; bottom: -70px; left: -30px;
  width: 170px; height: 170px; border-radius: 50%;
  background: rgba(255, 214, 150, .28); filter: blur(6px);
  animation: blobDrift 18s ease-in-out infinite reverse;
}
@keyframes blobDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(14px, -12px) scale(1.1); }
  66% { transform: translate(-12px, 10px) scale(.94); }
}
.home-hero .hero-brand {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: 10px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; letter-spacing: .12em;
  color: #fff; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
}
.home-hero .hero-title {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-size: 27px; font-weight: 700;
  letter-spacing: .06em; text-shadow: 0 2px 12px rgba(150, 20, 60, .25);
}
.home-hero .hero-sub { position: relative; z-index: 1; margin-top: 7px; font-size: 13px; opacity: .92; letter-spacing: .04em; }

.home-search {
  display: flex; align-items: center; gap: 9px;
  margin: -24px 30px 0; padding: 13px 18px;
  border-radius: var(--radius-pill); font-size: 13.5px; color: var(--text-3);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 14px 30px -12px rgba(150, 60, 85, .35);
  transition: transform .25s var(--ease-spring);
}
.home-search:active { transform: scale(.985); }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px 16px 10px;
  font-size: 16.5px; font-weight: 700; letter-spacing: .08em;
}
.section-title::before {
  content: ''; width: 3px; height: 15px; border-radius: 2px;
  margin-right: 8px; align-self: center;
  background: linear-gradient(180deg, var(--brand-2), var(--brand-deep));
  display: none;
}
.section-title .more { font-size: 12px; font-weight: 400; letter-spacing: .02em; color: var(--text-2); }

.quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 4px 12px 8px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 0; font-size: 11.5px; color: var(--text-2); letter-spacing: .02em;
  transition: transform .25s var(--ease-spring);
}
.quick-item:active { transform: scale(.92); }
.quick-item .qi-icon {
  width: 50px; height: 50px; border-radius: 17px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: linear-gradient(150deg, #fff, #fff4f6);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s, transform .3s var(--ease-spring);
}
@media (hover: hover) {
  .quick-item:hover .qi-icon { box-shadow: 0 12px 24px -10px rgba(232, 80, 110, .45); transform: translateY(-2px); }
}

/* ---------- 菜谱详情 ---------- */
.detail-hero { position: relative; height: 340px; overflow: hidden; background: linear-gradient(140deg, #ffeef2, #ffdfe6); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; animation: heroZoom 1.1s var(--ease) both; }
@keyframes heroZoom { from { transform: scale(1.08); opacity: .7; } }
.detail-hero .hero-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 84px;
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(255, 176, 140, .55), transparent 60%),
    linear-gradient(140deg, #ffeef2, #ffe3e8 50%, #fff3e4);
}
.detail-hero .hero-mask {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(44, 22, 32, .28), transparent 34%, transparent 52%, rgba(44, 22, 32, .62));
}
.detail-hero .hero-nav { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 14px 16px; }
.hero-nav-btn {
  width: 38px; height: 38px; border-radius: 50%; font-size: 17px; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 6px 16px rgba(44, 22, 32, .18);
  transition: transform .22s var(--ease-spring);
}
.hero-nav-btn:active { transform: scale(.9); }
.detail-hero .hero-info { position: absolute; bottom: 26px; left: 20px; right: 20px; color: #fff; }
.detail-hero .hero-name {
  font-family: var(--font-display); font-size: 27px; font-weight: 700;
  letter-spacing: .04em; line-height: 1.25;
  text-shadow: 0 2px 16px rgba(44, 22, 32, .45);
}
.detail-content {
  position: relative; margin-top: -22px; padding: 22px 16px 8px;
  background: var(--bg); border-radius: 26px 26px 0 0;
  box-shadow: 0 -8px 24px rgba(44, 22, 32, .08);
  min-height: 40vh;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.info-cell {
  padding: 14px 8px; text-align: center;
  border-radius: 16px;
  background: linear-gradient(160deg, #fff, #fff7f5);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: transform .25s var(--ease-spring);
}
.info-cell:active { transform: scale(.96); }
.info-cell .ic-value { font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.info-cell .ic-label { margin-top: 3px; font-size: 11px; color: var(--text-3); letter-spacing: .06em; }

.detail-section { margin-bottom: 22px; }
.detail-section .ds-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; font-size: 15.5px; font-weight: 700; letter-spacing: .06em;
}
.detail-section .ds-title > span { font-size: 12px; font-weight: 500; color: var(--brand); letter-spacing: .02em; }

.ingredient-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 7px; padding: 11px 14px;
  font-size: 14.5px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-xs);
  transition: all .3s var(--ease), transform .2s var(--ease-spring);
}
.ingredient-item:active { transform: scale(.985); }
.ingredient-item .ing-amount { font-size: 13px; color: var(--text-3); }
.ingredient-item.checked {
  color: var(--text-3); text-decoration: line-through;
  background: var(--mint-soft); border-color: rgba(63, 169, 138, .35);
  text-decoration-thickness: 1px;
}

.step-item { display: flex; gap: 13px; margin-bottom: 16px; position: relative; animation: fadeUp .4s var(--ease) both; }
.step-item:not(:last-child)::after {
  content: ''; position: absolute; left: 13px; top: 32px; bottom: -12px; width: 1.5px;
  background: linear-gradient(180deg, rgba(232, 80, 110, .28), rgba(232, 80, 110, .04));
}
.step-item .step-num {
  position: relative; z-index: 1; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 4px 12px -2px rgba(232, 80, 110, .5);
}
.step-item .step-body { flex: 1; padding-bottom: 2px; font-size: 14.5px; line-height: 1.72; color: var(--text-2); }
.step-item .step-img { width: 100%; margin-top: 10px; border-radius: 14px; box-shadow: var(--shadow-sm); }

.detail-actions { display: flex; gap: 11px; padding: 4px 16px 18px; }
.detail-actions .btn { flex: 1; }

/* ---------- 点餐 ---------- */
.meal-tabs {
  display: flex; gap: 8px; margin: 12px 16px;
  padding: 6px; border-radius: 20px;
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.meal-tab {
  flex: 1; padding: 11px 0; text-align: center; border-radius: 15px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  transition: all .32s var(--ease);
}
.meal-tab:active { transform: scale(.96); }
.meal-tab.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(135deg, #d96680, #a83050);
  box-shadow: 0 8px 18px -6px rgba(160, 45, 72, .48);
}
.order-recipe-card {
  display: flex; align-items: center; gap: 12px;
  margin: 0 16px 12px; padding: 13px;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-xs);
  transition: transform .32s var(--ease), box-shadow .32s var(--ease);
}
@media (hover: hover) { .order-recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); } }
.order-recipe-card img { width: 80px; height: 80px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.order-recipe-card .img-ph {
  width: 80px; height: 80px; flex-shrink: 0; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: linear-gradient(140deg, #ffeef2, #ffe3e8 60%, #fff3e4);
}
.order-recipe-card .orc-body { flex: 1; min-width: 0; }
.order-recipe-card .orc-name { font-size: 14.5px; font-weight: 600; }
.order-recipe-card .orc-meta {
  margin-top: 3px; font-size: 11.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.add-btn {
  flex-shrink: 0; padding: 8px 15px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #d96680, #a83050);
  box-shadow: 0 6px 16px -8px rgba(160, 45, 72, .55);
  transition: all .3s var(--ease-spring);
}
.add-btn:active { transform: scale(.9); }
.add-btn.added {
  color: var(--brand-deep); background: var(--brand-soft);
  box-shadow: none; border: 1px solid rgba(232, 80, 110, .3);
}
.add-btn.pulse { animation: addPulse .45s var(--ease-spring); }
@keyframes addPulse { 0% { transform: scale(.88); } 55% { transform: scale(1.1); } 100% { transform: scale(1); } }

.bottom-bar {
  position: fixed; left: 0; right: 0; z-index: 40;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 2px);
  max-width: 640px; margin: 0 auto; padding: 8px 16px;
}
.bottom-bar.no-tabbar { bottom: calc(var(--safe-bottom) + 10px); }
.cart-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 15px; border-radius: var(--radius-pill);
  font-size: 15.5px; font-weight: 600; letter-spacing: .06em; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand) 55%, var(--brand-deep));
  box-shadow: 0 14px 30px -10px rgba(232, 80, 110, .75);
  transition: transform .22s var(--ease-spring), box-shadow .3s;
}
.cart-btn:active { transform: scale(.97); }
.cart-btn[style*="#d1d5db"], .cart-btn.ghost {
  color: var(--text-2) !important;
  background: #f2e7ea !important;
  box-shadow: none !important;
}

.cart-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.cart-item img { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; }
.cart-item .ci-body { flex: 1; min-width: 0; }
.cart-item .ci-del { padding: 5px 9px; font-size: 12.5px; color: var(--danger); border-radius: 8px; background: rgba(229, 72, 77, .07); }

.assignee-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 3px 0; }
.assignee-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius-pill);
  font-size: 13px; color: var(--text-2);
  background: #fffaf9; border: 1.5px solid var(--border-strong);
  transition: all .28s var(--ease);
}
.assignee-item.selected {
  color: var(--brand-deep); font-weight: 600;
  background: linear-gradient(135deg, #fff1f4, #ffe4ec);
  border-color: rgba(232, 80, 110, .55);
  box-shadow: 0 6px 16px -8px rgba(232, 80, 110, .6);
}

/* 飞入购物车动画元素 */
.fly-dot {
  position: fixed; z-index: 999; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 6px 16px rgba(232, 80, 110, .6);
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
}

/* ---------- 订单 ---------- */
.status-tabs {
  position: sticky; top: 0; z-index: 12;
  display: flex; padding: 4px 8px;
  background: rgba(255, 248, 246, .85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.status-tab {
  position: relative; flex: 1; padding: 13px 0; text-align: center;
  font-size: 13.5px; color: var(--text-3);
  transition: color .25s;
}
.status-tab.active { color: var(--brand-deep); font-weight: 700; }
.status-tab.active::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  animation: tabSlide .34s var(--ease-spring) both;
}
@keyframes tabSlide { from { width: 0; opacity: 0; } }

.order-card {
  margin: 12px 16px; padding: 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .32s var(--ease), box-shadow .32s var(--ease);
}
@media (hover: hover) { .order-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); } }
.order-card .oc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.order-card .oc-meal { font-size: 15.5px; font-weight: 700; letter-spacing: .04em; }
.status-pill {
  padding: 4px 11px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid rgba(44, 22, 32, .05);
}
.order-card .oc-recipe { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 13.5px; }
.order-card .oc-recipe img, .order-card .oc-recipe .mini-ph {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; object-fit: cover;
}
.order-card .oc-recipe .mini-ph {
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: linear-gradient(140deg, #ffeef2, #ffe3e8 60%, #fff3e4);
}
.order-card .oc-recipe .ocr-time { margin-left: auto; font-size: 11px; color: var(--honey); font-weight: 500; }
.order-card .oc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 11px; border-top: 1px dashed var(--border-strong); }
.order-card .oc-time { font-size: 11.5px; color: var(--text-3); }
.order-card .oc-actions { display: flex; gap: 8px; }

/* ---------- 好友 ---------- */
.search-bar-row { display: flex; gap: 9px; padding: 12px 16px; }
.search-bar-row .input { flex: 1; border-radius: var(--radius-pill); background: rgba(255,255,255,.9); }
.icon-btn {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 15px; font-size: 17px; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 8px 20px -8px rgba(232, 80, 110, .8);
  transition: transform .22s var(--ease-spring);
}
.icon-btn:active { transform: scale(.9); }

.friend-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--card); border-bottom: 1px solid var(--border);
  transition: background .22s;
}
.friend-item:last-child { border-bottom: none; }
@media (hover: hover) { .friend-item:hover { background: #fffaf9; } }
.friend-item .fi-body { flex: 1; min-width: 0; }
.friend-item .fi-name { font-size: 15px; font-weight: 600; }
.friend-item .fi-sub { margin-top: 3px; font-size: 11.5px; color: var(--text-3); }

/* ---------- 个人中心 ---------- */
.profile-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  margin: 12px 16px 0; padding: 24px 20px;
  border-radius: 24px; color: #fff;
  background:
    radial-gradient(120% 120% at 90% 0%, rgba(245, 190, 140, .38), transparent 55%),
    linear-gradient(140deg, #e08a9b, #c04562 48%, #8b2340);
  box-shadow: 0 20px 40px -18px rgba(120, 28, 54, .48);
}
.profile-hero::after {
  content: ''; position: absolute; top: -50px; right: -30px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  animation: blobDrift 16s ease-in-out infinite;
}
.profile-hero .ph-name { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: .04em; }
.profile-hero .ph-code { margin-top: 5px; font-size: 11.5px; opacity: .9; }
.profile-hero .ph-code span { text-decoration: underline; text-underline-offset: 2px; }
.profile-hero .hero-nav-btn { position: relative; z-index: 1; }

.stat-row {
  display: flex; margin: 14px 16px; padding: 18px 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.stat-cell { position: relative; flex: 1; text-align: center; }
.stat-cell:not(:last-child)::after {
  content: ''; position: absolute; right: 0; top: 15%; height: 70%; width: 1px;
  background: var(--border);
}
.stat-cell .st-num {
  font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.1;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-deep));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-cell .st-label { margin-top: 4px; font-size: 11px; color: var(--text-3); letter-spacing: .06em; }

.menu-list {
  margin: 14px 16px; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.menu-item {
  display: flex; align-items: center; gap: 13px;
  padding: 16px; font-size: 15px;
  border-bottom: 1px solid var(--border);
  transition: background .22s, padding-left .22s var(--ease);
}
.menu-item:last-child { border-bottom: none; }
@media (hover: hover) { .menu-item:hover { background: #fffaf9; padding-left: 20px; } }
.menu-item:active { background: #fff5f6; }
.menu-item .mi-icon {
  width: 32px; height: 32px; border-radius: 11px; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #fff1f4, #ffe6ec);
}
.menu-item .mi-arrow { margin-left: auto; color: var(--text-3); font-size: 17px; }

/* ---------- 登录页 ---------- */
.login-page {
  position: relative; overflow: hidden;
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: 68px 30px 34px; background: var(--bg);
}
.login-page::before, .login-page::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none; filter: blur(50px);
}
.login-page::before {
  width: 320px; height: 320px; top: -110px; right: -90px;
  background: radial-gradient(circle, rgba(255, 138, 101, .55), transparent 70%);
  animation: blobDrift 16s ease-in-out infinite;
}
.login-page::after {
  width: 300px; height: 300px; bottom: -120px; left: -100px;
  background: radial-gradient(circle, rgba(232, 80, 110, .42), transparent 70%);
  animation: blobDrift 20s ease-in-out infinite reverse;
}
.login-logo {
  position: relative; z-index: 1; font-size: 66px;
  animation: floatY 3s ease-in-out infinite;
  filter: drop-shadow(0 16px 26px rgba(232, 80, 110, .32));
}
.login-title {
  position: relative; z-index: 1; margin: 14px 0 5px;
  font-family: var(--font-display); font-size: 29px; font-weight: 700; letter-spacing: .08em;
}
.login-sub { position: relative; z-index: 1; margin-bottom: 38px; font-size: 12.5px; color: var(--text-3); letter-spacing: .1em; }
.login-form {
  position: relative; z-index: 1;
  width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 13px;
  padding: 22px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  box-shadow: 0 24px 50px -20px rgba(150, 60, 85, .35);
}
.login-tabs { display: flex; gap: 26px; margin-bottom: 4px; }
.login-tab { position: relative; padding-bottom: 7px; font-size: 16px; color: var(--text-3); transition: color .25s; }
.login-tab.active { color: var(--text); font-weight: 700; }
.login-tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  animation: tabSlide .34s var(--ease-spring) both;
}
.preview-entry { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--text-2); letter-spacing: .02em; }
.preview-entry span { color: var(--brand); font-weight: 600; }

/* ---------- 搜索页 ---------- */
.history-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px; }
.hidden-input { display: none; }

/* 带悬浮购物车栏的页面（点餐）需要额外底部留白 */
.page.with-cart { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 132px); }

/* ---------- 滚动揭示动画 ---------- */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity .5s var(--ease), transform .62s var(--ease);
  transition-delay: var(--d, 0ms);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

/* ---------- 桌面适配 ---------- */
@media (min-width: 641px) {
  body { background: #f4e9ec; }
  #app { box-shadow: 0 0 60px rgba(94, 35, 50, .14); border-radius: 0; }
}

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 涟漪容器（按钮需要定位上下文） ---------- */
.cart-btn, .add-btn, .icon-btn, .chip, .option-item { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0); animation: ripple .6s var(--ease) forwards; }
.chip > .ripple, .option-item > .ripple, .icon-btn > .ripple, .add-btn > .ripple, .cart-btn > .ripple { background: rgba(255, 255, 255, .5); }

/* ---------- 搜图选择器 ---------- */
.img-pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.img-pick {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 12px;
  border: 2px solid transparent; background: #f7eef0;
  transition: transform .25s var(--ease-spring), border-color .25s, box-shadow .25s;
}
.img-pick img { width: 100%; height: 100%; object-fit: cover; }
.img-pick:active { transform: scale(.95); }
.img-pick.ok { border-color: rgba(63, 169, 138, .75); }
.img-pick.warn { border-color: rgba(245, 166, 35, .7); }
.img-pick.bad { border-color: rgba(229, 72, 77, .55); opacity: .72; }
@media (hover: hover) { .img-pick:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); } }
.ip-badge {
  position: absolute; left: 5px; bottom: 5px;
  padding: 2px 7px; border-radius: 8px; font-size: 10.5px; font-weight: 600;
  background: rgba(255, 255, 255, .92); color: var(--text); backdrop-filter: blur(6px);
}
.ip-badge.ok { color: #2f7d63; }
.ip-badge.warn { color: #a4700f; }
.ip-badge.bad { color: #b02a2f; }
.img-pick.broken { display: flex; align-items: center; justify-content: center; }
.ip-broken { font-size: 10.5px; color: var(--text-3); text-align: center; padding: 0 6px; line-height: 1.4; }

/* ---------- AI 生成菜谱 ---------- */
.ai-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, #b06ad9, #7a3fb8 70%, #5e2e93);
  box-shadow: 0 6px 14px -6px rgba(122, 63, 184, .7);
  transition: transform .22s var(--ease-spring), box-shadow .25s;
}
.ai-btn:active { transform: scale(.94); }
@media (hover: hover) { .ai-btn:hover { box-shadow: 0 10px 20px -8px rgba(122, 63, 184, .8); } }

.ai-sources {
  margin-top: 10px; padding: 12px 14px;
  background: rgba(122, 63, 184, .05);
  border: 1px solid rgba(122, 63, 184, .16);
  border-radius: 14px;
}
.ai-src-title { font-size: 12px; font-weight: 600; color: #6b3aa0; margin-bottom: 7px; letter-spacing: .04em; }
.ai-src-item {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 11.5px; line-height: 1.55; color: var(--text-2);
  padding: 3px 0; text-decoration: none;
}
.ai-src-item::before { content: '· '; color: var(--text-3); }
@media (hover: hover) { .ai-src-item:hover { color: #6b3aa0; } }

/* AI 生成中的加载提示 */
.ai-loading {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  background: rgba(122, 63, 184, .06); border-radius: 14px;
}
.ai-loading-tip { font-size: 11.5px; font-weight: 400; color: var(--text-3); }

/* 未启用的功能入口 */
.ai-btn.disabled, .btn.disabled {
  filter: grayscale(.85); opacity: .55; box-shadow: none !important; cursor: not-allowed;
}

/* ---------- 点餐：购物车页 ---------- */
.cart-summary {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-strong);
  text-align: right; font-size: 12.5px; color: var(--text-2);
}
.cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px 10px 22px; text-align: center;
}
.cart-empty .empty-icon {
  width: 76px; height: 76px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #ffffff, #fff2f5 72%);
  box-shadow: 0 10px 24px -12px rgba(160, 45, 72, .35), inset 0 0 0 1px rgba(255, 255, 255, .9);
}
.cart-item .img-ph { flex-shrink: 0; }

/* ---------- 订单详情操作栏（避免三个按钮挤在一行折行） ---------- */
.od-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 0 16px 8px;
}
.od-actions .od-btn {
  flex: 1 1 calc(50% - 5px); min-width: 0;
  padding: 12px 10px; font-size: 13.5px; letter-spacing: 0;
  white-space: nowrap;
}
.od-actions .od-btn:first-child:nth-last-child(1) { flex-basis: 100%; }

/* 订单详情的次要操作（取消）弱化，避免与主操作争焦点 */
.od-actions .od-btn-soft {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border-strong);
}
.od-actions .od-btn-soft:active { background: rgba(44, 22, 32, .05); }

/* 底部操作栏：加一层与页面底色衔接的渐隐，滚动时内容不会"穿"过按钮下方 */
.bottom-bar {
  padding-top: 22px;
  background: linear-gradient(to top,
    var(--bg) 0%, var(--bg) 66%, rgba(255, 248, 246, .95) 82%, rgba(255, 248, 246, 0) 100%);
}

/* ---------- 详情页悬浮返回（滚出首屏后出现） ---------- */
.float-back {
  position: fixed; top: 14px; left: 14px; z-index: 60;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(14px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 0 8px 22px -6px rgba(44, 22, 32, .38), 0 1px 2px rgba(44, 22, 32, .1);
  opacity: 0; transform: translateY(-8px) scale(.9); pointer-events: none;
  transition: opacity .26s var(--ease), transform .3s var(--ease-spring);
}
.float-back.show { opacity: 1; transform: none; pointer-events: auto; }
.float-back:active { transform: scale(.9); }
@media (min-width: 641px) {
  .float-back { left: calc(50% - 320px + 14px); }
}

/* ---------- 参考链接（B站 / 小红书 / 下厨房） ---------- */
.ref-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; margin-bottom: 7px;
  background: #fffaf9; border: 1px solid var(--border-strong); border-radius: 12px;
  font-size: 13px;
}
.ref-item .ref-title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-2);
}
.ref-item .remove-btn {
  flex-shrink: 0; color: var(--text-3); font-size: 17px;
  padding: 0 2px; line-height: 1;
}

.ref-link {
  display: flex; align-items: center; gap: 8px;
  width: 100%; box-sizing: border-box;
  padding: 11px 13px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-xs); text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.ref-link:last-of-type { margin-bottom: 0; }
.ref-link:active { transform: scale(.985); }
.ref-link .ref-title {
  flex: 1; min-width: 0;
  font-size: 13.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ref-link .ref-arrow { flex-shrink: 0; color: var(--text-3); font-size: 14px; }

/* 来源标签：浅底彩字，扫一眼区分平台 */
.ref-site {
  flex-shrink: 0;
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: #e8eefc; color: #3b62b8;
}

@media (hover: hover) {
  .ref-link:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
}

/* ---------- 加载体验：顶部进度条 / 图片懒加载淡入 ---------- */
.top-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999;
  pointer-events: none; opacity: 0;
  transition: opacity .2s ease;
}
.top-progress.show { opacity: 1; }
.top-progress > i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--brand-2), var(--brand) 60%, var(--brand-deep));
  transform: scaleX(0); transform-origin: left center;
  transition: transform .25s var(--ease);
  box-shadow: 0 0 8px rgba(207, 74, 103, .5);
}

/* 图片：先占位（微光扫过），加载完淡入 */
img.lazy-img {
  opacity: 0;
  background: linear-gradient(100deg, #f7eef0 20%, #fffaf9 45%, #f7eef0 70%);
  background-size: 220% 100%;
  animation: imgShimmer 1.5s ease-in-out infinite;
  transition: opacity .45s ease;
}
img.lazy-img.loaded { opacity: 1; animation: none; }
img.lazy-img.img-broken {
  background: linear-gradient(140deg, #ffeef2, #ffe3e8 60%, #fff3e4);
  opacity: 1;
}
@keyframes imgShimmer {
  0% { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}

/* 自动加载更多时，按钮位置显示"正在加载" */
.load-more.is-loading::after { content: '加载中…'; }
.load-more.is-loading button { display: none; }

@media (prefers-reduced-motion: reduce) {
  img.lazy-img { animation: none; opacity: 1; }
}

/* ---------- 搜索框清空按钮 ---------- */
.search-field { position: relative; flex: 1; display: flex; }
.search-field .input { width: 100%; padding-right: 38px; }
.search-field .clear-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; color: var(--text-3);
  background: rgba(44, 22, 32, .07);
  transition: background .2s, color .2s;
}
.search-field .clear-btn.show { display: flex; }
.search-field .clear-btn:active { background: rgba(44, 22, 32, .14); }

/* 骨架屏放在网格容器里时占满整行（列表页初始加载） */
.recipe-grid > .skeleton-grid { grid-column: 1 / -1; width: 100%; padding: 0; }
