/* ══════════════════════════════════════════════════════════
   奶蛙吃山财 · 样式（独立文件，方便后期调色改版）
   设计语言：圆润可爱 · 温暖治愈 · 简洁不幼稚（信息密度够）
   配色：奶蛙绿 #B4E7CE / 奶黄 #FFF4D6 / 橙 #FF8C42
   动画统一用 transform，避免 position 引发重排
   ══════════════════════════════════════════════════════════ */

/* ---------- 设计变量（改色只动这里） ---------- */
:root {
  --green:   #B4E7CE;   /* 主色：清新奶蛙绿 */
  --green-d: #7FC9A6;   /* 深一档，用于描边/强调文字 */
  --green-l: #E4F6EC;   /* 极浅绿，做底色块 */
  --yellow:  #FFF4D6;   /* 辅色：温暖奶黄 */
  --orange:  #FF8C42;   /* 强调色：食欲橙 */
  --orange-d:#F2781F;
  --ink:     #2E3A33;   /* 主文字（深墨绿） */
  --muted:   #7C8B82;   /* 次要文字 */
  --card:    #FFFFFF;   /* 卡片底 */
  --cream:   #FFFDF7;   /* 暖白底 */
  --line:    rgba(46,58,51,.08);

  --sh-1: 0 4px 12px rgba(46,90,70,.10);   /* 卡片常规阴影（柔和） */
  --sh-2: 0 10px 26px rgba(46,90,70,.16);  /* 悬浮/弹层阴影 */
  --r-lg: 22px;   /* 大圆角（卡片/按钮） */
  --r-md: 16px;   /* 中圆角 */
  --r-sm: 12px;   /* 小圆角 */
  --tab-h: 64px;  /* 底部导航高度（固定） */
  --gap: 16px;    /* 卡片间距 */
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #d9efe2;                      /* 桌面端两侧留白的底色 */
  line-height: 1.5;                         /* 行高 1.5 倍 */
  font-size: 14px;                          /* 正文 14px */
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; font-size: 14px; }

/* ---------- 手机视口容器（桌面端居中） ---------- */
#app {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
  height: 100dvh;                           /* 动态视口高度，避开刘海/底栏 */
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, var(--green) 0%, var(--yellow) 100%); /* 奶蛙绿→奶黄 */
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,.06);
}

/* ============ 顶部标题区 ============ */
.topbar {
  flex: 0 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* 窄屏（尤其 320/360/375）标题区 + 数字胶囊放不下时，
     让胶囊折到第二行。不加这句的话 flex 会把压缩量全摊给标题 —— */
  flex-wrap: wrap;
  row-gap: 6px;
}
/* flex:0 0 auto 是必须的：否则 .brand 会被压缩，
   而它内部标题没有 nowrap 保护，文字就会一个字一行竖排下来。 */
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-width: 0; }
.brand-txt { min-width: 0; }
/* 奶蛙真图 logo：圆形裁切 */
.logo {
  width: 36px; height: 36px;
  border-radius: 50%; object-fit: cover; display: block;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.12));
  animation: floaty 3.2s ease-in-out infinite;   /* 奶蛙轻轻浮动 */
}
/* 关键：标题和小字都必须 nowrap。
   没有它，窄屏下文字会被逐字换行，标题直接竖排成「奶/蛙/吃/山/财」。 */
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }  /* 标题 18px 粗 */
.brand-sub  { font-size: 12px; color: var(--ink); opacity: .7; white-space: nowrap; }            /* 小字 12px */
.today-pill {
  font-size: 11px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.8);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.today-pill b { color: var(--orange-d); font-weight: 800; }

/* ============ 视图容器 ============ */
#views { position: relative; flex: 1 1 auto; overflow: hidden; }
.view {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  padding: 4px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.view.active { display: flex; }

/* 视图内区块标题 */
.view-head { padding: 8px 2px 4px; }
.view-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.view-desc { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* ============ 聊天页：奶蛙形象区 ============ */
.mascot {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; margin: 10px 0 4px;
}
.mascot-emoji {
  width: 120px; height: 120px;
  border-radius: 50%; object-fit: cover; display: block;
  filter: drop-shadow(0 6px 10px rgba(46,90,70,.18));
  animation: pop 1s ease both, floaty 3.6s ease-in-out 1s infinite;
}
.mascot-bubble {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 10px 16px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--sh-1);
  position: relative;
}
/* 气泡小尾巴 */
.mascot-bubble::after {
  content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-bottom-color: var(--card);
}
/* 开始提问后，把大吉祥物收成一行小头像，给对话区腾出空间
   （推荐卡高 400~500px，不收的话一屏只能看到卡片一角，得反复滚） */
#view-home.chatting .mascot { flex-direction: row; gap: 8px; margin: 2px 0; align-self: flex-start; }
#view-home.chatting .mascot-emoji { width: 44px; height: 44px; }
#view-home.chatting .mascot-bubble { font-size: 12px; padding: 7px 12px; }
#view-home.chatting .mascot-bubble::after { display: none; }

/* ============ 聊天页：快速提问气泡 ============ */
.quick { margin: 8px 0 4px; }
.quick-title { font-size: 13px; font-weight: 700; color: var(--ink); opacity: .8; margin-bottom: 8px; }
.bubbles { display: flex; flex-wrap: wrap; gap: 10px; }
/* 开始提问后收起快速提问区。
   它是空状态的引导，提问后就该让位 —— 不收的话在 320×568 实测会把
   对话区挤到只剩 20px（卡有 552px 高，等于透过一条缝看结果）。 */
#view-home.chatting .quick { display: none; }
.bubble {
  background: var(--card);
  border: 1.5px solid var(--green);
  color: var(--ink);
  font-size: 13px; font-weight: 600;
  padding: 9px 14px;
  border-radius: 999px;
  min-height: 44px;              /* Apple HIG 最小点击区 44pt，原来 40px 偏小 */
  display: inline-flex; align-items: center;
  box-shadow: var(--sh-1);
  transition: transform .15s ease, background .15s ease;
}
.bubble:active { transform: scale(.95); background: var(--green-l); }

/* ============ 对话区 ============ */
.msgs { flex: 1 1 auto; overflow-y: auto; padding: 12px 2px 8px; display: flex; flex-direction: column; gap: var(--gap); }
/* 关键修复：flex 列容器里的子项默认 flex-shrink:1，而 .rcard 带 overflow:hidden，
   会让它的 min-height:auto 退化成 0 —— 卡片被压成高度 0，用户看不到任何推荐结果。
   必须显式禁止收缩。 */
.msgs > * { flex: 0 0 auto; }

/* 奶蛙文字气泡（回复正文） */
.msg {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  font-size: 14px;
  box-shadow: var(--sh-1);
  white-space: pre-wrap;
  animation: slideUp .4s ease both;
}

/* 思考动画：奶蛙表情循环 + 3 个圆点跳动 */
.thinking {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: var(--sh-1);
  font-size: 13px; color: var(--muted); font-weight: 600;
}
.think-avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  animation: pop .3s ease both;               /* 换表情时小弹一下 */
  transition: opacity .2s ease;
}
.thinking .dots { display: inline-flex; gap: 5px; }
.thinking .dots i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green-d);
  animation: dot 1s ease-in-out infinite;
}
.thinking .dots i:nth-child(2) { animation-delay: .15s; background: var(--orange); }
.thinking .dots i:nth-child(3) { animation-delay: .3s; background: var(--green-d); }

/* ============ 推荐结果卡片 ============ */
.rcard {
  background: var(--card);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
  animation: slideUp .45s ease both;          /* 默认滑入，stagger 用内联 delay */
}
.rc-photo { position: relative; width: 100%; height: 156px; background: var(--green-l); }
/* 「楼层实拍」角标：照片来自楼层照片池（不绑定具体窗口），避免同学误以为是该窗口的图 */
.ph-tag { position: absolute; left: 6px; bottom: 6px; z-index: 2; font-size: 10px; font-weight: 700;
  color: #fff; background: rgba(46,58,51,.55); padding: 2px 8px; border-radius: 999px; pointer-events: none; }
.rc-photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }
/* 图加载失败/无图时露出的 emoji 兜底 */
.rc-photo .ph-emoji {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 56px;
}
.rc-photo .rank {
  position: absolute; z-index: 2; left: 12px; top: 12px;
  background: rgba(0,0,0,.45); color: #fff; font-weight: 800; font-size: 13px;
  padding: 4px 10px; border-radius: 999px;
}
.rc-photo .flame {
  position: absolute; z-index: 2; right: 12px; top:12px;
  background: rgba(0,0,0,.45); color: #fff; font-weight: 800; font-size: 13px;
  padding: 4px 10px; border-radius: 999px;
}
/* 卡片顶部：奶蛙说 */
.rc-say {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px 0;
  font-size: 13px; font-weight: 800; color: var(--green-d);
}
.rc-body { padding: 10px 14px 14px; }
.rc-name { font-size: 18px; font-weight: 800; }              /* 窗口名 18px 粗 */
.rc-rc { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.rc-loc  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.mi { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink); }
.mi b { font-weight: 800; }
.mi.price {                       /* 饿了么式橙色圆角价格标签 */
  background: var(--orange); color: #fff; font-weight: 800;
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
}
.star { color: var(--orange); letter-spacing: 1px; }          /* 点评式星级，橙色 */
.rc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tg {
  background: var(--green-l); color: var(--green-d);
  font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px;
}
/* 热评气泡 */
.rc-comment {
  background: var(--yellow); border-radius: var(--r-md);
  padding: 10px 12px; font-size: 13px; margin-top: 8px;
}
.rc-comment .who { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
/* 卡片底部：奶蛙评语 */
.rc-dragon {
  margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--green-d);
  display: flex; align-items: center; gap: 6px;
}
.rc-acts { display: flex; gap: 10px; margin-top: 12px; }
.rc-acts button {
  flex: 1; min-height: 48px; border-radius: var(--r-md); font-weight: 700; font-size: 13px;
  background: var(--green-l); color: var(--ink); transition: transform .15s ease;
}
.rc-acts button:active { transform: scale(.96); }
.rc-acts .pri { background: var(--orange); color: #fff; }

/* ============ 减脂餐推荐卡片 ============ */
.fatcard {
  background: var(--card); border-radius: var(--r-lg);
  padding: 14px; box-shadow: var(--sh-1); animation: slideUp .45s ease both;
}
.fatcard h3 { margin: 0 0 10px; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.fat-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.fat-item:last-of-type { border-bottom: none; }
.fat-item .fi-name { font-size: 14px; font-weight: 600; }
.fat-item .fi-macro { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fat-item .fi-price { font-size: 13px; font-weight: 800; color: var(--orange-d); }
.fat-total {
  margin-top: 10px; background: var(--green-l); border-radius: var(--r-md);
  padding: 10px 12px; font-size: 13px; font-weight: 700;
}
.fat-total span { color: var(--orange-d); }
.fat-dragon { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--green-d); display: flex; align-items: center; gap: 6px; }

/* 营养条（评估模式） */
.nutri { background: var(--card); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--sh-1); animation: slideUp .45s ease both; }
.nutri-bar { height: 10px; border-radius: 999px; background: var(--green-l); overflow: hidden; margin: 6px 0 12px; }
.nutri-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-d), var(--orange)); transform-origin: left; animation: grow .8s ease both; }
.nutri-row { display: flex; justify-content: space-between; font-size: 13px; margin: 4px 0; }
.nutri-row b { font-weight: 800; }

/* ============ 底部输入条（聊天页） ============ */
.composer {
  flex: 0 0 auto;
  display: flex; gap: 10px; align-items: center;
  padding: 10px 0 4px;
}
.composer-input {
  flex: 1; min-height: 48px;                      /* 最小 48px 可点 */
  border: 2px solid #fff;
  background: rgba(255,255,255,.9);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--ink);
  box-shadow: var(--sh-1);
  outline: none;
}
.composer-input:focus { border-color: var(--green-d); }
/* 大按钮、圆角、渐变色 */
.composer-send {
  flex: 0 0 auto; min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--orange-d));
  color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: var(--sh-1);
  transition: transform .15s ease;
}
.composer-send:active { transform: scale(.95); }
.composer-send:disabled { opacity: .55; }

/* 大圆角主按钮（广场/减脂页） */
.big-btn {
  width: 100%; min-height: 52px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--orange), var(--orange-d));
  color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: var(--sh-1);
  transition: transform .15s ease;
  margin: 6px 0 12px;
}
.big-btn:active { transform: scale(.97); }
.big-btn:disabled { opacity: .55; }

/* ============ 食堂：搜索 + 列表 ============ */
.search { padding: 6px 0 10px; }
.search-input {
  width: 100%; min-height: 48px;
  border: 2px solid #fff; background: rgba(255,255,255,.92);
  border-radius: var(--r-md); padding: 0 16px;
  box-shadow: var(--sh-1); outline: none;
}
.search-input:focus { border-color: var(--green-d); }
.canteen-list { display: flex; flex-direction: column; gap: var(--gap); padding-bottom: 12px; }
/* 同 .msgs：列表项一律不许被 flex 压扁 */
.canteen-list > *, .fav-list > * { flex: 0 0 auto; }

/* ---------- 食堂 tab：楼层照片墙（窗口名已隐藏） ---------- */
.floor-sec { background: var(--card); border-radius: var(--r-md); padding: 12px; box-shadow: var(--sh-1); }
.floor-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.floor-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.floor-count { font-size: 12px; color: var(--ink-3); }
.floor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.floor-ph { margin: 0; position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden;
  background: var(--green-l); cursor: zoom-in; transition: transform .15s ease; }
.floor-ph:hover { transform: translateY(-2px); }
.floor-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 放大镜提示：手机上不显示，免得挡照片 */
.floor-zoom { position: absolute; right: 4px; bottom: 4px; font-size: 12px; opacity: 0;
  background: rgba(0,0,0,.45); color: #fff; border-radius: 999px; padding: 2px 6px; transition: opacity .15s ease; }
.floor-ph:hover .floor-zoom { opacity: 1; }

/* ---------- 照片放大层 ---------- */
body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center; }
/* 同 .sheet-mask：display:flex 会覆盖 hidden，必须显式关掉 */
.lightbox[hidden] { display: none; }
.lb-img { max-width: 92vw; max-height: 88vh; border-radius: var(--r-md); box-shadow: 0 8px 40px rgba(0,0,0,.6); }
.lb-close { position: absolute; top: 14px; right: 16px; width: 38px; height: 38px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; font-size: 18px; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: none;
  border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 26px; cursor: pointer; }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; background: rgba(0,0,0,.5); padding: 4px 10px; border-radius: 999px; }
@media (max-width: 480px) { .lb-nav { width: 38px; height: 38px; } }

.cwin {
  display: flex; gap: 12px; background: var(--card);
  border-radius: var(--r-md); padding: 10px; box-shadow: var(--sh-1);
  transition: transform .15s ease;
  animation: slideUp .4s ease both;
}
.cwin:active { transform: scale(.98); }
.cwin-ph { flex: 0 0 72px; height: 72px; border-radius: var(--r-sm); background: var(--green-l); overflow: hidden; position: relative; }
.cwin-ph img { width: 100%; height: 100%; object-fit: cover; }
.cwin-ph .ph-emoji { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.cwin-info { flex: 1; min-width: 0; }
.cwin-name { font-size: 15px; font-weight: 800; }
.cwin-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cwin-meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.cwin-tags { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.cwin-tags .tg { font-size: 11px; padding: 2px 7px; }

/* ============ 广场/减脂页 hero ============ */
.fatloss-hero { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.fatloss-emoji { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: block; animation: floaty 3s ease-in-out infinite; }
.fatloss-tip { font-size: 13px; color: var(--ink); opacity: .85; }

/* ============ 我的页 ============ */
.me-card {
  background: var(--card); border-radius: var(--r-lg); padding: 14px 16px;
  display: flex; flex-direction: row; align-items: center; gap: 12px;
  box-shadow: var(--sh-1); margin: 6px 0 14px;
}
.me-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: block; border: 3px solid var(--yellow); background: var(--yellow); flex: 0 0 auto; }

/* 会员找回码卡片：换手机时凭码恢复账号 */
.redeem-card { background: var(--card); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--sh-1); margin: 0 0 10px; }
.rc-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.rc-title { font-size: 15px; font-weight: 800; }
.rc-hint { font-size: 11px; color: var(--muted); }
.rc-code {
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 28px; font-weight: 800;
  letter-spacing: 5px; color: var(--green-d); background: #F4FBF7;
  border: 1.5px dashed var(--green); border-radius: var(--r-md);
  padding: 12px 8px; text-align: center; user-select: all; margin-bottom: 10px;
}
.rc-copy { width: 100%; min-height: 40px; border-radius: var(--r-md); border: none; background: var(--green); color: #fff; font-size: 14px; font-weight: 700; }
.rc-copy:active { transform: scale(.98); }
.rc-note { margin-top: 8px; font-size: 11px; color: #C2554A; line-height: 1.5; }
.redeem-in { display: flex; gap: 8px; margin: 0 0 14px; }
.redeem-input {
  flex: 1; min-width: 0; min-height: 44px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--bg); padding: 0 14px; font-size: 16px; letter-spacing: 3px;
  font-family: var(--font-mono, ui-monospace, monospace); outline: none;
}
.redeem-input:focus { border-color: var(--green); }
.redeem-go { flex: 0 0 auto; min-height: 44px; padding: 0 20px; border-radius: var(--r-md); border: none; background: var(--yellow); color: var(--ink); font-size: 14px; font-weight: 800; }
.me-info { flex: 1; min-width: 0; }
.me-name { font-size: 16px; font-weight: 800; }
.me-badge { display: inline-block; font-size: 12px; color: var(--orange-d); font-weight: 700; background: var(--yellow); padding: 3px 10px; border-radius: 999px; margin-top: 5px; }
.me-login { flex: 0 0 auto; min-height: 38px; padding: 0 18px; border-radius: 999px; background: var(--green); color: #fff; font-size: 13px; font-weight: 800; }
.me-login.out { background: var(--green-l); color: var(--green-d); }
.prefs { background: var(--card); border-radius: var(--r-lg); padding: 6px 14px; box-shadow: var(--sh-1); margin-bottom: 14px; }
.pref-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pref-row:last-child { border-bottom: none; }
.pref-row span { font-size: 14px; font-weight: 600; }
.pref-row select, .pref-budget { border: 1.5px solid var(--green); border-radius: var(--r-sm); padding: 8px 10px; background: var(--cream); outline: none; }
.pref-budget { width: 80px; }
.fav-head { font-size: 14px; font-weight: 800; margin: 4px 2px 10px; }
.fav-list { display: flex; flex-direction: column; gap: 10px; }
.fav-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 20px; }
.fav-item { display: flex; gap: 10px; background: var(--card); border-radius: var(--r-md); padding: 10px; box-shadow: var(--sh-1); }
.fav-item-ph { flex: 0 0 56px; height: 56px; border-radius: var(--r-sm); overflow: hidden; background: var(--green-l); position: relative; }
.fav-item-ph .ph-tag { display: none; }  /* 56px 缩略图太小，角标会糊，藏掉 */
.fav-item-ph img { width: 100%; height: 100%; object-fit: cover; }
.fav-item-info { flex: 1; }
.fav-item-name { font-size: 14px; font-weight: 800; }
.fav-item-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mock-note { margin-top: 16px; font-size: 11px; color: var(--muted); text-align: center; opacity: .8; }

/* ============ 底部导航（固定 64px，真图 icon） ============ */
.tabbar {
  flex: 0 0 auto;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); transition: color .15s ease, transform .15s ease;
}
.tab-ico { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; display: block; transition: transform .2s ease; }
.tab-txt { font-size: 11px; font-weight: 600; }
/* 选中：图标变橙 + 文字加粗 + 图标上浮放大 */
.tab.active { color: var(--orange-d); }
.tab.active .tab-txt { font-weight: 800; }
.tab.active .tab-ico { transform: translateY(-2px) scale(1.12); box-shadow: 0 0 0 2px var(--orange); }

/* ============ 弹层（窗口详情） ============ */
.sheet-mask {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end;
  animation: fade .2s ease both;
}
/* 关键：CSS 的 display:flex 会覆盖 hidden 属性的默认隐藏，
   必须显式补这条，否则遮罩永远盖住全屏、挡住所有点击 */
.sheet-mask[hidden] { display: none; }
.sheet {
  width: 100%; background: var(--cream);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 8px 18px calc(env(safe-area-inset-bottom) + 24px);
  box-shadow: var(--sh-2);
  max-height: 78%; overflow-y: auto;
  animation: slideUpSheet .3s ease both;
}
.sheet-bar { width: 40px; height: 5px; border-radius: 999px; background: var(--line); margin: 4px auto 12px; }
.sheet-body h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.sheet-body .sb-loc { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.sheet-body .sb-block { margin: 12px 0; }
.sheet-body .sb-block .sb-title { font-size: 13px; font-weight: 800; color: var(--green-d); margin-bottom: 6px; }
.sheet-body .sb-menu-item { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.sheet-close { width: 100%; min-height: 48px; margin-top: 12px; border-radius: var(--r-md); background: var(--green-l); font-weight: 800; }

/* ============ toast ============ */
.toast {
  position: absolute; left: 50%; bottom: calc(var(--tab-h) + 20px);
  transform: translateX(-50%);
  background: rgba(46,58,51,.92); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  z-index: 40; box-shadow: var(--sh-2);
  animation: pop .25s ease both;
}

/* ============ 动画关键帧（全部基于 transform） ============ */
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pop    { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideUp{ 0% { transform: translateY(16px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes slideUpSheet { 0% { transform: translateY(100%); } 100% { transform: translateY(0); } }
@keyframes fade   { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes grow   { 0% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
@keyframes dot    { 0%,100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-6px); opacity: 1; } }

/* 聊天内奶蛙小头像（卡片里） */
.mini-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; vertical-align: middle; }

/* 桌面端微调：视图更聚拢 */
@media (min-width: 560px) {
  #app { border-radius: 28px; height: 92dvh; margin: 4dvh auto; }
}

/* ============ 会员卡 + 会员中心 ============ */
.member-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(135deg, var(--yellow), #FFE9C2);
  border-radius: var(--r-lg); padding: 14px 16px; margin: 6px 0 14px;
  box-shadow: var(--sh-1);
}
.member-card.is-member { background: linear-gradient(135deg, var(--green), #9FE0BF); }
.mc-plan { font-size: 16px; font-weight: 800; }
.member-card.is-member .mc-plan::after { content: " 🐸✨"; }
.mc-quota { font-size: 12px; color: var(--ink); opacity: .75; margin-top: 2px; }
.mc-btn {
  flex: 0 0 auto; border: none; cursor: pointer;
  background: var(--orange); color: #fff; font-weight: 800; font-size: 13px;
  padding: 10px 16px; border-radius: 999px; box-shadow: var(--sh-1);
  min-height: 44px;   /* 点击区 */
}
.mc-btn:active { transform: scale(.96); }
.mc-btn.wide { width: 100%; margin-top: 10px; }
.mc-btn.gray { background: var(--muted); }

.member-center { margin: 0 0 14px; }
.mc-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.mc-tab {
  flex: 1; border: none; cursor: pointer; min-height: 44px;
  background: var(--green-l); color: var(--ink); font-weight: 700; font-size: 13px;
  border-radius: 999px; padding: 8px 4px;
}
.mc-tab.active { background: var(--green-d); color: #fff; }
.mc-panel {
  background: var(--card); border-radius: var(--r-lg); padding: 14px;
  box-shadow: var(--sh-1);
}

.pf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pf-row:last-of-type { border-bottom: none; }
.pf-row select, .pf-row input {
  width: 120px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  font-size: 14px; background: var(--cream); color: var(--ink); text-align: right;
}
.mc-hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* ============ 身体档案（广场） ============ */
.body-card { display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1.5px solid var(--green-l); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--sh-1); }
.bc-left { flex: 1; min-width: 0; }
.bc-title { font-size: 14px; font-weight: 800; color: var(--ink); }
.bc-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.bc-btn { flex: 0 0 auto; border: none; border-radius: 999px; padding: 9px 16px; min-height: 38px;
  background: var(--green-d); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; }
.bc-btn:active { transform: scale(.96); }

.sheet-desc { font-size: 12px; color: var(--muted); margin: 6px 0 12px; line-height: 1.5; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-cell { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.pf-cell select, .pf-cell input { width: 100%; padding: 10px; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); background: #fff; color: var(--ink); font-size: 14px; }
.pf-cell select { text-align: left; }
.pf-tastes { margin-top: 14px; font-size: 12px; color: var(--muted); }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pf-chip { padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
  font-size: 13px; color: var(--ink); cursor: pointer; }
.pf-chip.on { background: var(--green-l); border-color: var(--green-d); color: var(--green-d); font-weight: 700; }
.pf-result { margin-top: 14px; background: var(--green-l); border-radius: var(--r-md); padding: 12px 14px; }
.pf-result h4 { font-size: 13px; color: var(--green-d); margin-bottom: 6px; }
.pf-kv { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--ink); }
.pf-kv b { font-weight: 800; }
.pf-tip { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .sheet-close { flex: 0 0 40%; margin-top: 0; }
.ban-warn { background: #FFF1E8 !important; color: #B4531F !important; border: 1.5px solid #FFC9A8; line-height: 1.55; }
.ban-warn b { color: #8A3410; }
.sheet-save { flex: 1; min-height: 48px; margin-top: 0; border: none; border-radius: var(--r-md);
  background: var(--green-d); color: #fff; font-weight: 800; font-size: 15px; }
@media (max-width: 360px) { .pf-grid { grid-template-columns: 1fr; } }

.rc-stats { display: flex; gap: 8px; margin-bottom: 10px; }
.rc-stat { flex: 1; background: var(--green-l); border-radius: var(--r-md); padding: 10px; text-align: center; }
.rc-stat b { display: block; font-size: 17px; color: var(--green-d); }
.rc-stat span { font-size: 11px; color: var(--muted); }
.rc-history { max-height: 320px; overflow-y: auto; }
.rc-item { padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.rc-item:last-child { border-bottom: none; }
.rc-item .rci-msg { color: var(--ink); }
.rc-item .rci-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.rc-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0; }

.wt-input, .ck-input { display: flex; gap: 8px; margin-bottom: 10px; }
.wt-input input, .ck-input input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); font-size: 14px; background: var(--cream); color: var(--ink);
}
.wt-chart { margin: 6px 0 10px; }
.wt-chart svg { width: 100%; height: auto; display: block; }
.wt-list { font-size: 12px; color: var(--muted); max-height: 120px; overflow-y: auto; }
.wt-list div { padding: 3px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; }

.ck-board { margin-bottom: 10px; }
.ck-board-title { font-size: 12px; font-weight: 800; color: var(--orange-d); margin-bottom: 6px; }
.ck-board-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 2px; border-bottom: 1px dashed var(--line); }
.ck-board-row.top1 { color: var(--orange-d); font-weight: 800; }
.ck-feed { max-height: 300px; overflow-y: auto; }
.ck-item { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ck-item:last-child { border-bottom: none; }
.ck-item .ck-emoji { font-size: 18px; flex: 0 0 auto; }
.ck-item .ck-name { font-size: 11px; color: var(--muted); }

/* ============ 会员升级弹层 / 额度用完弹层 ============ */
.pay-sheet, .quota-sheet { border-radius: 24px 24px 0 0; }
.pay-body, .quota-body { padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); text-align: center; }
.pay-title { font-size: 19px; font-weight: 800; margin: 8px 0 12px; }
.pay-price { color: var(--orange-d); }
.pay-benefits { text-align: left; margin: 0 0 16px; padding: 0; list-style: none; }
.pay-benefits li { font-size: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--ink); }
.pay-btn {
  width: 100%; border: none; cursor: pointer; min-height: 48px;
  background: linear-gradient(135deg, var(--orange), var(--orange-d)); color: #fff;
  font-size: 16px; font-weight: 800; border-radius: 999px; box-shadow: var(--sh-1);
}
.pay-btn:active { transform: scale(.97); }
.pay-btn[disabled] { opacity: .6; }
.pay-note { font-size: 11px; color: var(--muted); margin-top: 8px; }
.pay-close {
  margin-top: 10px; border: none; background: none; cursor: pointer;
  color: var(--muted); font-size: 13px; min-height: 44px; padding: 6px 20px;
}
.quota-emoji { font-size: 40px; margin: 10px 0 4px; }
.quota-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.quota-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.6; }

/* ============ 拍照识别餐盘 ============ */
.composer-cam {
  flex: 0 0 auto; border: none; cursor: pointer; background: var(--green-l);
  font-size: 20px; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.composer-cam:active { transform: scale(.92); }
.img-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--yellow); border-radius: var(--r-md);
  padding: 6px 10px; margin: 4px 0 6px; font-size: 12px;
}
.img-chip[hidden] { display: none; }
.img-chip img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.img-chip-txt { flex: 1; color: var(--ink); }
.img-chip-x { border: none; background: rgba(0,0,0,.08); border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-size: 12px; }
