/* ==========================================================================
   朕的御膳房 · 视觉系统
   配色取自 DESIGN.md：暖橙 + 翠绿 + 宣纸米白 + 檀木深褐
   ========================================================================== */

:root {
  --orange: #FF8C42;
  --orange-deep: #F07A30;
  --orange-soft: #FFF0E6;
  --green: #07C160;
  --green-deep: #06AD56;
  --green-soft: #E8F8F0;
  --bg: #FFF9F5;
  --card: #FFFFFF;
  --ink: #2D1B12;
  --ink-soft: #8B7355;
  --ink-mute: #B8A594;
  --line: #F2E4D8;
  --red: #D64541;
  --amber: #C8873A;

  --radius: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 10px rgba(139, 115, 85, .08);
  --shadow: 0 6px 22px rgba(139, 115, 85, .12);
  --shadow-lg: 0 16px 44px rgba(139, 115, 85, .18);
  --ease: cubic-bezier(.22, .8, .3, 1);

  --tabbar-h: 60px;
  --topbar-h: 52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  overscroll-behavior-y: none;
}

h1, h2, h3, .serif {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", "PingFang SC", serif;
  font-weight: 700;
}

button { font-family: inherit; font-size: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--orange-soft); }

.num { font-variant-numeric: tabular-nums; }

/* ---------- 页面骨架 ---------- */
#app { min-height: 100dvh; display: flex; flex-direction: column; position: relative; }

#topbar {
  position: sticky; top: 0; z-index: 40;
  min-height: var(--topbar-h);
  background: rgba(255, 249, 245, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

#view { flex: 1; padding-bottom: calc(var(--tabbar-h) + 22px); animation: fade .32s var(--ease); }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶栏 ---------- */
.bar { max-width: 720px; margin: 0 auto; padding: 0 12px; height: var(--topbar-h); display: flex; align-items: center; gap: 8px; }
.bar .icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; color: var(--ink-soft); transition: .2s var(--ease);
}
.bar .icon-btn:hover { background: var(--orange-soft); color: var(--orange); }
.bar .icon-btn:active { transform: scale(.92); }
.bar-title { flex: 1; text-align: center; font-size: 16px; letter-spacing: .06em; }
.bar-right { min-width: 40px; display: flex; justify-content: flex-end; }
.bar-action { font-size: 14px; font-weight: 600; color: var(--orange); padding: 8px 10px; border-radius: 10px; transition: .2s var(--ease); }
.bar-action:hover { background: var(--orange-soft); }
.bar-action:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- 底部导航（印章意象） ---------- */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-mute); font-size: 11px; letter-spacing: .04em;
  transition: color .2s var(--ease); position: relative;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.9; }
.tab.on { color: var(--orange); }
.tab.on::after {
  content: ''; position: absolute; top: 6px; width: 26px; height: 26px;
  border: 2px solid var(--orange); border-radius: 50%; opacity: .28;
  animation: seal .4s var(--ease);
}
@keyframes seal { from { transform: scale(.5) rotate(-14deg); opacity: 0; } to { transform: none; opacity: .28; } }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}

.btn {
  height: 48px; border-radius: 14px; font-weight: 600; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: .2s var(--ease); width: 100%;
}
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 6px 18px rgba(255, 140, 66, .32); }
.btn-primary:hover { background: var(--orange-deep); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 6px 18px rgba(7, 193, 96, .28); }
.btn-green:hover { background: var(--green-deep); }
.btn-ghost { background: #F4EDE6; color: var(--ink-soft); }
.btn-ghost:hover { background: #EDE3D9; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 999px; font-size: 13px;
  background: #F6EFE8; color: var(--ink-soft);
  border: 1px solid transparent; transition: .18s var(--ease); white-space: nowrap;
}
.chip[aria-pressed="true"], .chip.on { background: var(--orange); color: #fff; border-color: var(--orange); }
.chip:active { transform: scale(.95); }

.chip-green { background: var(--green-soft); color: var(--green-deep); }
.chip-orange { background: var(--orange-soft); color: var(--orange-deep); }

.pill { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; }
.pill-o { background: var(--orange-soft); color: var(--orange-deep); }
.pill-g { background: var(--green-soft); color: var(--green-deep); }

.scroller { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }

.empty { text-align: center; padding: 56px 20px; color: var(--ink-mute); }
.empty .big { font-size: 52px; margin-bottom: 12px; opacity: .55; }

.sect-h { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 12px; }
.sect-h h2 { font-size: 17px; letter-spacing: .05em; }
.sect-h .sub { font-size: 12px; color: var(--ink-mute); }

/* ---------- 朕阅（浏览） ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #FF8C42 0%, #FFA559 55%, #FFBE7D 100%);
  color: #fff; padding: 22px 20px; margin-top: 16px; box-shadow: var(--shadow);
}
.hero::before {
  content: ''; position: absolute; right: -30px; top: -34px; width: 150px; height: 150px;
  border: 1.5px solid rgba(255, 255, 255, .3); border-radius: 50%;
}
.hero::after {
  content: ''; position: absolute; right: 16px; bottom: -46px; width: 108px; height: 108px;
  border: 1.5px solid rgba(255, 255, 255, .22); border-radius: 50%;
}
.hero h1 { font-size: 22px; letter-spacing: .1em; margin-bottom: 6px; }
.hero p { font-size: 13px; color: rgba(255, 255, 255, .9); position: relative; z-index: 1; }
.hero .stat { display: flex; gap: 22px; margin-top: 16px; position: relative; z-index: 1; }
.hero .stat div b { font-size: 20px; font-variant-numeric: tabular-nums; }
.hero .stat div span { font-size: 11px; color: rgba(255, 255, 255, .82); display: block; }

.filters { position: sticky; top: var(--topbar-h); z-index: 30; background: var(--bg); padding: 12px 0 2px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin-top: 6px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 15px; } }

.dish-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .26s var(--ease), box-shadow .26s var(--ease);
  text-align: left; display: flex; flex-direction: column;
}
.dish-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.dish-card:active { transform: translateY(-1px) scale(.99); }
.dish-thumb { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #FFE9D6, #FFF3E8); overflow: hidden; }
.dish-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.dish-card:hover .dish-thumb img { transform: scale(1.06); }
.dish-thumb .fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; opacity: .5; }
.dish-thumb .kbadge {
  position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px;
  background: rgba(45, 27, 18, .62); color: #fff; font-size: 11px; backdrop-filter: blur(4px);
  font-variant-numeric: tabular-nums;
}
.dish-thumb .fav {
  position: absolute; right: 7px; top: 7px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, .9); display: grid; place-items: center; color: var(--ink-mute);
  box-shadow: var(--shadow-sm); transition: .2s var(--ease);
}
.dish-thumb .fav:hover { color: var(--red); transform: scale(1.1); }
.dish-thumb .fav.on { color: var(--red); }
.dish-thumb .fav svg { width: 15px; height: 15px; }
.dish-body { padding: 10px 12px 13px; }
.dish-body h3 { font-size: 15px; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish-body .meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-mute); }
.dish-body .tags { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.dish-body .tags span { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: var(--orange-soft); color: var(--orange-deep); }

/* ---------- 翻牌 ---------- */
.flip-stage { position: relative; padding-top: 8px; }
.flip-progress { text-align: center; margin-bottom: 14px; }
.flip-progress p { font-size: 13px; color: var(--ink-soft); }
.flip-progress p b { color: var(--orange); font-size: 16px; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #EADFD3; transition: .28s var(--ease); }
.dots i.on { background: var(--orange); transform: scale(1.18); }

.flip-card {
  position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: calc(100dvh - 320px);
  margin: 0 auto; border-radius: var(--radius-lg); overflow: hidden; background: #241610;
  box-shadow: var(--shadow-lg); cursor: grab; user-select: none; touch-action: pan-y;
}
.flip-card:active { cursor: grabbing; }
.flip-card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.flip-card .noimg { width: 100%; height: 100%; display: grid; place-items: center; font-size: 76px; opacity: .45;
  background: linear-gradient(135deg, #FFE3C9, #FFF4E9); }
.flip-card .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.12) 46%, transparent 72%); pointer-events: none; }
.flip-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 18px 20px; color: #fff; pointer-events: none; }
.flip-info h2 { font-size: 23px; letter-spacing: .04em; margin-bottom: 9px; }
.flip-info .row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 9px; }
.flip-info .row span { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.24); backdrop-filter: blur(6px); font-size: 11.5px; }
.flip-info p { font-size: 12.5px; color: rgba(255,255,255,.82); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.stamp {
  position: absolute; top: 22px; z-index: 5; padding: 7px 15px; border-radius: 12px;
  font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .06em;
}
.stamp.like { left: 20px; background: rgba(7,193,96,.92); transform: rotate(-11deg); }
.stamp.skip { right: 20px; background: rgba(214,69,65,.92); transform: rotate(11deg); }

.flip-hint { text-align: center; font-size: 12px; color: var(--ink-mute); margin: 16px 0 8px; }
.flip-hint .g { color: var(--green); font-weight: 600; }
.flip-hint .r { color: var(--red); font-weight: 600; }
.flip-hint .sep { margin: 0 12px; color: #E2D5C8; }

.picked { margin-top: 14px; }
.picked > p { font-size: 12px; color: var(--ink-mute); margin-bottom: 8px; }
.picked-row { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.picked-row::-webkit-scrollbar { display: none; }
.picked-item { position: relative; width: 62px; height: 62px; border-radius: 14px; overflow: hidden; flex: none; background: var(--orange-soft); box-shadow: var(--shadow-sm); }
.picked-item img { width: 100%; height: 100%; object-fit: cover; }
.picked-item .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 24px; opacity: .5; }
.picked-item .badge { position: absolute; right: 2px; bottom: 2px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; color: #fff; }

/* ---------- 菜单结果 ---------- */
.menu-card {
  border-radius: var(--radius-lg); padding: 22px 20px; color: #fff;
  background: linear-gradient(140deg, #FF8C42, #FFA559 60%, #FFB877);
  box-shadow: 0 16px 40px rgba(255, 140, 66, .3); position: relative; overflow: hidden;
}
.menu-card::after { content: ''; position: absolute; left: -40px; bottom: -60px; width: 160px; height: 160px; border: 1.5px solid rgba(255,255,255,.22); border-radius: 50%; }
.menu-card .head { text-align: center; margin-bottom: 18px; position: relative; z-index: 1; }
.menu-card .head h2 { font-size: 23px; letter-spacing: .12em; }
.menu-card .head p { font-size: 12.5px; color: rgba(255,255,255,.88); margin-top: 5px; }
.menu-list { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.menu-item { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.2); border-radius: 15px; padding: 10px 12px; backdrop-filter: blur(6px); }
.menu-item .idx { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.3); display: grid; place-items: center; font-weight: 700; flex: none; }
.menu-item .txt { flex: 1; min-width: 0; }
.menu-item .txt h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .txt span { font-size: 11.5px; color: rgba(255,255,255,.85); }
.menu-item .adv { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.92); }
.menu-total { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.25); display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.menu-total span { font-size: 13px; color: rgba(255,255,255,.9); }
.menu-total b { font-size: 21px; font-variant-numeric: tabular-nums; }
.menu-mark { text-align: center; margin-top: 14px; font-size: 10.5px; color: rgba(255,255,255,.6); position: relative; z-index: 1; }

.tip-box { display: flex; gap: 11px; padding: 15px; border-radius: var(--radius); background: var(--green-soft); border: 1px solid #CBEBD9; margin-top: 16px; }
.tip-box .ico { font-size: 20px; line-height: 1.2; }
.tip-box h3 { font-size: 13.5px; color: var(--green-deep); margin-bottom: 3px; }
.tip-box p { font-size: 12.5px; color: #3E7A5C; }

/* ---------- 详情页 ---------- */
.hero-img { position: relative; width: 100%; aspect-ratio: 4/3; background: linear-gradient(135deg, #FFE3C9, #FFF4E9); overflow: hidden; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-img .noimg { width: 100%; height: 100%; display: grid; place-items: center; font-size: 72px; opacity: .45; }
.hero-img .back {
  position: absolute; left: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.9); display: grid; place-items: center; box-shadow: var(--shadow); color: var(--ink);
}
.hero-img .fav {
  position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.9); display: grid; place-items: center; box-shadow: var(--shadow); color: var(--ink-mute);
}
.hero-img .fav.on { color: var(--red); }

.detail-sheet { margin-top: -26px; position: relative; z-index: 2; background: var(--bg); border-radius: 26px 26px 0 0; padding: 24px 0 0; }
.detail-sheet h1 { font-size: 25px; letter-spacing: .04em; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }

.nutri-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 12px; }
.nutri-cell { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 11px 8px; text-align: center; }
.nutri-cell .k { font-size: 11.5px; color: var(--ink-mute); }
.nutri-cell .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

.steps { counter-reset: step; margin-top: 12px; }
.steps li {
  list-style: none; position: relative; padding: 0 0 16px 34px; font-size: 14px; color: #4A3527;
  border-left: 1.5px dashed #EBDCCD; margin-left: 11px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -11px; top: -3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--orange); color: #fff; font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}

.advice-panel { border-radius: var(--radius); padding: 16px; margin-top: 10px; }

/* ---------- 打卡 ---------- */
.drop-zone {
  border: 2px dashed #E6D5C4; border-radius: var(--radius); background: var(--card);
  aspect-ratio: 4/3; display: grid; place-items: center; text-align: center; padding: 20px;
  transition: .22s var(--ease); cursor: pointer; position: relative; overflow: hidden;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--orange); background: var(--orange-soft); }
.drop-zone .ph { font-size: 46px; margin-bottom: 10px; opacity: .55; }
.drop-zone p { font-size: 13.5px; color: var(--ink-soft); }
.drop-zone small { font-size: 11.5px; color: var(--ink-mute); }
.drop-zone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.field { margin-top: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.field label i { color: var(--orange); font-style: normal; }
.field input[type=text], .field input[type=password], .field input[type=date],
.field input[type=email], .field input[type=tel], .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--card); outline: none; transition: .2s var(--ease); font-size: 14px;
  color: var(--ink); font-family: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,140,66,.13); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-mute); opacity: 1; }
.field textarea { resize: vertical; min-height: 84px; line-height: 1.65; }
.field .hint { font-size: 11.5px; color: var(--ink-mute); margin-top: 6px; }

/* recipe 自动识别结果 */
.parse-box { margin-top: 12px; border-radius: var(--radius); border: 1px solid #CBEBD9; background: var(--green-soft); padding: 14px 15px; }
.parse-box h3 { font-size: 13.5px; color: var(--green-deep); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.parse-box .kv { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 记录/收藏 ---------- */
.list-row { display: flex; gap: 13px; padding: 13px; align-items: center; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .th { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; flex: none; background: var(--orange-soft); }
.list-row .th img { width: 100%; height: 100%; object-fit: cover; }
.list-row .th .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 26px; opacity: .5; }
.list-row .bd { flex: 1; min-width: 0; }
.list-row .bd h3 { font-size: 15px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .bd .m { font-size: 11.5px; color: var(--ink-mute); display: flex; gap: 8px; flex-wrap: wrap; }
.list-row .bd .note { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-row .del { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-mute); transition: .2s; }
.list-row .del:hover { background: #FCEBEB; color: var(--red); }

.seg { display: flex; gap: 6px; background: #F4EDE6; padding: 4px; border-radius: 14px; margin: 12px 0 4px; }
.seg button { flex: 1; height: 38px; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); transition: .2s var(--ease); }
.seg button.on { background: var(--card); color: var(--orange); box-shadow: var(--shadow-sm); }

/* ---------- 我的 ---------- */
.profile-head { text-align: center; padding: 24px 0 18px; }
.avatar {
  position: relative; width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px;
  background: linear-gradient(135deg, #FF8C42, #FFB877); display: grid; place-items: center;
  font-size: 34px; color: #fff; box-shadow: var(--shadow); font-family: "Noto Serif SC", serif;
  padding: 0; overflow: visible; transition: .2s var(--ease); cursor: pointer;
}
.avatar:active { transform: scale(.96); }
.avatar .ch { line-height: 1; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .cam {
  position: absolute; right: -2px; bottom: -2px;
  width: 28px; height: 28px; border-radius: 50%; font-size: 14px;
  display: grid; place-items: center;
  background: #fff; border: 1.5px solid var(--line); box-shadow: var(--shadow-sm);
}
.avatar:hover { box-shadow: var(--shadow-lg); }
.avatar:hover .cam { border-color: var(--orange); }
.profile-head h2 { font-size: 20px; }
.profile-head .sig { font-size: 13px; color: var(--ink-mute); margin-top: 4px; }
.profile-head .nick { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.stat-cell { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 8px; text-align: center; box-shadow: var(--shadow-sm); }
.stat-cell b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--orange); display: block; }
.stat-cell span { font-size: 11.5px; color: var(--ink-mute); }

.menu-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 3px; }
.menu-row + .menu-row { border-top: 1px solid var(--line); }
.menu-row .l { display: flex; align-items: center; gap: 11px; font-size: 14.5px; }
.menu-row .l .e { font-size: 18px; width: 26px; text-align: center; }
.menu-row .r { font-size: 13px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 60; background: rgba(45,27,18,.5);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: maskIn .22s var(--ease);
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 400px; max-height: 86dvh; background: var(--card);
  border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: sheetIn .3s var(--ease);
}
@keyframes sheetIn { from { transform: translateY(18px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { padding: 20px 20px 14px; text-align: center; }
.sheet-head .e { font-size: 34px; margin-bottom: 8px; }
.sheet-head h3 { font-size: 18px; }
.sheet-head p { font-size: 12px; color: var(--ink-mute); margin-top: 4px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 20px 4px; overscroll-behavior: contain; }
.sheet-foot { flex: none; padding: 14px 20px 20px; display: flex; gap: 10px; border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }

.adv-level { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 11px; border-radius: 14px; margin-bottom: 13px; }
.adv-level b { font-size: 15.5px; }
.adv-text { font-size: 13.5px; color: #4A3527; line-height: 1.7; text-align: center; margin-bottom: 14px; }
.adv-block { border-radius: 14px; padding: 13px; margin-bottom: 11px; }
.adv-block h4 { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.adv-block .cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.adv-block .cells div { background: #fff; border-radius: 10px; padding: 7px 4px; text-align: center; }
.adv-block .cells .k { font-size: 10.5px; color: var(--ink-mute); }
.adv-block .cells .v { font-size: 12px; font-weight: 600; }
.adv-block p { font-size: 12.5px; color: #4A3527; line-height: 1.65; }

.bg-o { background: rgba(255,140,66,.09); }
.bg-g { background: rgba(7,193,96,.09); }
.bg-a { background: rgba(200,135,58,.11); }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 26px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(45,27,18,.9); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .28s var(--ease); max-width: 88%;
}
.toast.err { background: rgba(214,69,65,.94); }
.toast.ok { background: rgba(7,193,96,.94); }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 骨架屏 ---------- */
.skel { background: linear-gradient(90deg, #F3E9DF 25%, #FAF3EC 50%, #F3E9DF 75%); background-size: 200% 100%; animation: skel 1.3s infinite; border-radius: 10px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spin { width: 22px; height: 22px; border: 2.5px solid rgba(255,140,66,.3); border-top-color: var(--orange); border-radius: 50%; animation: spin .7s linear infinite; }
.spin.w { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-page { min-height: 60dvh; display: grid; place-items: center; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ==========================================================================
   认证页（登录 / 注册）
   ========================================================================== */
body.auth-mode { background:
  radial-gradient(120% 70% at 50% -10%, #FFF3E8 0%, var(--bg) 55%); }

.auth-wrap {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 22px calc(40px + env(safe-area-inset-bottom));
  gap: 22px;
}

.auth-hero { text-align: center; animation: authIn .5s var(--ease); }
.auth-seal {
  width: 68px; height: 68px; margin: 0 auto 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--orange), var(--orange-deep));
  color: #fff; font-family: "Noto Serif SC", serif;
  font-size: 32px; font-weight: 700; border-radius: 20px;
  box-shadow: 0 10px 26px rgba(255,140,66,.36);
}
.auth-hero h1 { font-size: 25px; letter-spacing: .06em; color: var(--ink); }
.auth-sub { font-size: 13px; color: var(--ink-soft); margin-top: 8px; letter-spacing: .02em; }

.auth-card {
  width: 100%; max-width: 380px; background: var(--card);
  border-radius: var(--radius-lg); padding: 22px 20px 20px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  animation: authIn .55s var(--ease) both; animation-delay: .05s;
}
@keyframes authIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.auth-seg {
  display: flex; background: #F6EEE7; border-radius: 12px; padding: 3px;
  margin-bottom: 18px;
}
.auth-seg button {
  flex: 1; border: 0; background: transparent; padding: 9px 0;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  border-radius: 10px; cursor: pointer; transition: all .22s var(--ease);
  font-family: inherit;
}
.auth-seg button.on { background: #fff; color: var(--orange); box-shadow: 0 2px 8px rgba(139,115,85,.12); }

.auth-err {
  background: #FDECEB; color: var(--red); font-size: 13px;
  padding: 10px 13px; border-radius: 11px; margin-bottom: 14px;
  border: 1px solid #F7D5D3; line-height: 1.5;
  animation: authIn .25s var(--ease);
}

.auth-submit { width: 100%; margin-top: 22px; padding: 14px; font-size: 15.5px; letter-spacing: .1em; }

.auth-tip { text-align: center; font-size: 12.5px; color: var(--ink-mute); margin-top: 16px; }
.auth-foot { font-size: 11.5px; color: var(--ink-mute); letter-spacing: .04em; }

/* 我的页顶部用户信息条 */
.user-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; margin-bottom: 12px;
  background: var(--orange-soft); border-radius: 14px;
  font-size: 12.5px; color: var(--ink-soft);
}
.user-strip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px rgba(7,193,96,.16); }
.user-strip b { color: var(--ink); font-weight: 600; }
.user-strip .spacer { flex: 1; }
.user-strip .out {
  border: 1px solid #EAD9C9; background: #fff; color: var(--ink-soft);
  font-size: 12px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font-family: inherit; transition: all .2s var(--ease);
}
.user-strip .out:hover { border-color: var(--orange); color: var(--orange); }

/* 页面级加载态 */
.boot-loading { min-height: 70dvh; display: grid; place-items: center; text-align: center; color: var(--ink-mute); }

/* ==========================================================================
   身体状态（微信「状态」意象）：我的页状态行 + 编辑弹层 + 朕阅荐膳位
   ========================================================================== */

/* 我的页 · 状态行（点击打开状态弹层） */
.status-row {
  width: 100%; margin-top: 14px; padding: 11px 14px;
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-sm); transition: .2s var(--ease); cursor: pointer;
}
.status-row:hover { border-color: #F0D9C4; box-shadow: var(--shadow); }
.status-row:active { transform: scale(.985); }
.status-row .st-emoji {
  flex: none; width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center; font-size: 21px;
  background: var(--orange-soft);
}
.status-row .st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.status-row .st-label {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.status-row .st-rec {
  font-size: 12px; color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.status-row .st-go { flex: none; font-size: 20px; color: var(--ink-mute); line-height: 1; }
.status-row.empty-state { background: #FDF8F3; border-style: dashed; }
.status-row.empty-state .st-emoji { background: #F6EDE4; }
.status-row .dim { color: var(--ink-mute); font-weight: 500; }
.status-row .st-emoji.dim { font-size: 19px; opacity: .7; }

/* 状态弹层 · 分组 */
.st-group { margin-top: 4px; }
.st-group + .st-group { margin-top: 16px; }
.st-group-name {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  letter-spacing: .08em; margin-bottom: 9px;
  display: flex; align-items: center; gap: 8px;
}
.st-group-name::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.st-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: #F6EFE8; color: var(--ink-soft);
  border: 1.5px solid transparent; transition: .18s var(--ease); cursor: pointer;
  font-family: inherit;
}
.st-chip .e { font-size: 15px; line-height: 1; }
.st-chip:hover { background: #F0E5D9; }
.st-chip:active { transform: scale(.95); }
.st-chip.on {
  background: var(--orange-soft); color: var(--orange-deep);
  border-color: var(--orange); font-weight: 600;
}

/* 状态弹层 · 条件输入区 */
.st-extra { animation: authIn .25s var(--ease); }
.st-extra.hidden { display: none; }

/* 状态弹层 · 实时荐膳预览 */
.st-preview {
  margin-top: 18px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,140,66,.1), rgba(255,190,125,.07));
  border: 1px solid #F5E2D0;
  display: flex; flex-direction: column; gap: 6px;
}
.st-preview .pv-t { font-size: 12px; font-weight: 700; color: var(--orange-deep); letter-spacing: .04em; }
.st-preview .pv-item { font-size: 12.5px; color: #6B543F; line-height: 1.5; }
.st-preview.none { background: #F7F1EA; border-color: var(--line); }
.st-preview.none .pv-t { color: var(--ink-soft); }
.st-preview.none .pv-item { color: var(--ink-mute); }

/* 记膳页 · label 右侧的管理入口 */
.label-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.label-row label { margin-bottom: 0; }
.label-act {
  font-size: 12.5px; font-weight: 600; color: var(--orange);
  cursor: pointer; font-family: inherit; background: none; border: none;
  padding: 2px 0; transition: .2s var(--ease);
}
.label-act:hover { color: var(--orange-deep); }

/* 朕阅 · 依身体状态荐膳位 */
.rec-sect { margin-top: 6px; }
.rec-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin: 22px 0 4px;
}
.rec-head h2 { font-size: 17px; letter-spacing: .05em; }
.rec-head p { font-size: 12px; color: var(--ink-soft); margin-top: 5px; line-height: 1.5; }
.rec-head .chip { flex: none; margin-top: 2px; }
.rec-head #status-from-browse { background: var(--orange-soft); color: var(--orange-deep); font-weight: 600; }
.rec-head #status-from-browse:hover { background: #FFE3CC; }

/* 荐膳卡片：叠加等级徽标 */
.rec-cell { position: relative; }
.rec-badge {
  position: absolute; left: 9px; top: 9px; z-index: 3;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px; color: #fff;
  box-shadow: 0 2px 8px rgba(45,27,18,.18); pointer-events: none;
}
.rec-badge.lv-more { background: #2196F3; }
.rec-badge.lv-normal { background: #4CAF50; }
.rec-badge.lv-limit { background: var(--orange); }
.rec-badge.lv-avoid { background: #EF4444; }
.boot-loading .spin { margin: 0 auto 14px; }

/* ==========================================================================
   头像更换弹层
   ========================================================================== */
.av-stage { display: flex; justify-content: center; padding: 6px 0 2px; }
.av-preview {
  width: 108px; height: 108px; border-radius: 50%;
  background: linear-gradient(135deg, #FF8C42, #FFB877);
  display: grid; place-items: center; overflow: hidden;
  font-size: 44px; color: #fff; font-family: "Noto Serif SC", serif;
  box-shadow: var(--shadow); border: 3px solid #fff;
  animation: authIn .3s var(--ease);
}
.av-preview img { width: 100%; height: 100%; object-fit: cover; }
.av-preview .ch { line-height: 1; }

.av-presets-title {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  letter-spacing: .08em; margin: 10px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.av-presets-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.av-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.av-preset {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 11px 0 9px; border-radius: 14px; font-size: 24px; color: var(--ink-soft);
  background: #FAF4EE; border: 1.5px solid transparent;
  transition: .18s var(--ease); cursor: pointer; font-family: inherit;
}
.av-preset:hover { background: var(--orange-soft); border-color: #F5DCC6; }
.av-preset:active { transform: scale(.95); }
.av-preset span { font-size: 11px; }

/* ==========================================================================
   AI 增强（大模型）—— 统一的卡片 / 加载 / 降级样式
   ========================================================================== */
.ai-card {
  margin-top: 20px; border-radius: 18px; padding: 15px 16px 16px;
  background: linear-gradient(135deg, rgba(255,140,66,.09), rgba(255,190,125,.05));
  border: 1px solid #F3DFCB;
  position: relative; animation: authIn .3s var(--ease);
}
.ai-card .ai-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 11px;
}
.ai-card .ai-head .tag {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, #FF8C42, #FFA95E);
  display: inline-flex; align-items: center; gap: 4px;
}
.ai-card .ai-head h4 { font-size: 14px; color: var(--orange-deep); letter-spacing: .03em; }
.ai-card .ai-head .ai-re {
  margin-left: auto; font-size: 12px; color: var(--orange); background: none;
  border: none; cursor: pointer; font-family: inherit; font-weight: 600;
}
.ai-card .ai-head .ai-re:hover { color: var(--orange-deep); }

.ai-line { font-size: 13.5px; color: #4A3527; line-height: 1.75; margin-bottom: 9px; }
.ai-line:last-child { margin-bottom: 0; }
.ai-line b { color: var(--orange-deep); font-weight: 600; }
.ai-line .lead { color: var(--ink-soft); font-size: 12.5px; }

/* 评分条 */
.ai-scores { display: flex; gap: 12px; margin: 4px 0 10px; }
.ai-score { flex: 1; }
.ai-score .k { font-size: 11.5px; color: var(--ink-soft); margin-bottom: 5px; display: flex; justify-content: space-between; }
.ai-score .k b { color: var(--orange-deep); font-weight: 700; }
.ai-score .bar { height: 6px; border-radius: 999px; background: #EFE3D8; overflow: hidden; }
.ai-score .bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #FF8C42, #FFBE7D);
  transition: width .5s var(--ease);
}

/* AI 推荐的菜品行 */
.ai-pick {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; border-radius: 14px; background: #fff;
  border: 1px solid #F1E4D6; margin-bottom: 8px;
}
.ai-pick:last-child { margin-bottom: 0; }
.ai-pick .idx {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: var(--orange-soft); color: var(--orange-deep);
  font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 1px;
}
.ai-pick .txt { flex: 1; min-width: 0; }
.ai-pick .txt h5 { font-size: 13.5px; color: var(--ink); margin-bottom: 3px; }
.ai-pick .txt p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.ai-pick .txt .tip { color: var(--green); font-size: 12px; margin-top: 3px; }

/* 加载态 */
.ai-loading { display: flex; align-items: center; gap: 10px; padding: 8px 0 4px; }
.ai-loading .spin {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid #F1DCC8; border-top-color: var(--orange);
  animation: aiSpin .8s linear infinite;
}
.ai-loading p { font-size: 12.5px; color: var(--ink-soft); }
@keyframes aiSpin { to { transform: rotate(360deg); } }

/* 骨架屏 */
.ai-skel { display: flex; flex-direction: column; gap: 9px; padding: 2px 0; }
.ai-skel i {
  display: block; height: 11px; border-radius: 6px;
  background: linear-gradient(90deg, #F3E7DA 25%, #FAF1E7 37%, #F3E7DA 63%);
  background-size: 400% 100%; animation: aiShimmer 1.4s ease infinite;
}
.ai-skel i:nth-child(2) { width: 88%; }
.ai-skel i:nth-child(3) { width: 64%; }
@keyframes aiShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 失败/降级提示 */
.ai-err {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.6;
}
.ai-err .ic { flex: none; }
.ai-err button {
  margin-left: auto; flex: none; font-size: 12px; font-weight: 600;
  color: var(--orange); background: none; border: none; cursor: pointer; font-family: inherit;
}

/* AI 入口按钮（详情页 / 朕阅） */
.ai-enter {
  display: flex; align-items: center; gap: 7px; justify-content: center;
  width: 100%; padding: 12px; border-radius: 14px; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--orange-deep); background: var(--orange-soft);
  border: 1px dashed #F2C9A5; transition: .2s var(--ease);
}
.ai-enter:hover { background: #FFE3CC; border-color: var(--orange); }
.ai-enter:disabled { opacity: .55; cursor: default; }