/* ============================================================
 * 家里的菜 · 样式（移动优先）
 * ============================================================ */
:root {
  --bg: #FBF6EE;
  --card: #FFFFFF;
  --ink: #2E2823;
  --ink-2: #5A5148;
  --muted: #8C8279;
  --line: #F0E7DA;
  --brand: #C75B39;
  --brand-dark: #A6462A;
  --brand-soft: #FBEAE2;
  --green: #4C8A54;
  --green-soft: #E9F2E6;
  --amber: #B57C10;
  --amber-soft: #FBF1D8;
  --red: #BE4438;
  --red-soft: #FBE7E4;
  --shadow: 0 2px 10px rgba(96, 71, 43, .06), 0 12px 28px rgba(96, 71, 43, .05);
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

body {
  background-image:
    radial-gradient(circle at 8% -4%, rgba(199, 91, 57, .10), transparent 46%),
    radial-gradient(circle at 96% 2%, rgba(76, 138, 84, .10), transparent 42%);
  background-repeat: no-repeat;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input, textarea, select { outline: none; }
img { display: block; max-width: 100%; }

/* ---------------- 布局骨架 ---------------- */
#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 16px calc(96px + var(--safe-b));
  position: relative;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  margin: 0 -16px;
  padding: 14px 20px 12px;
  background: linear-gradient(180deg, rgba(251, 246, 238, .97) 62%, rgba(251, 246, 238, 0));
  backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 10px;
}
.topbar .brandmark {
  width: 38px; height: 38px; border-radius: 13px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 20px;
  flex: 0 0 auto;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: .2px; }
.topbar .sub { font-size: 11.5px; color: var(--muted); margin-top: -2px; }

.page { display: none; animation: fade .22s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(240, 231, 218, .8);
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 20px 2px 10px;
}
.section-head h2 { font-size: 15px; margin: 0; font-weight: 700; }
.section-head .hint { font-size: 12px; color: var(--muted); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  transition: .15s;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border-radius: 14px;
  font-size: 14.5px; font-weight: 600;
  background: var(--brand); color: #fff;
  transition: transform .12s, background .15s;
  min-height: 46px;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 13px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.danger { background: var(--red-soft); color: var(--red); }

/* ---------------- 库存 ---------------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.stat {
  background: var(--card); border-radius: 18px; padding: 12px 10px; text-align: center;
  box-shadow: var(--shadow); border: 1px solid rgba(240, 231, 218, .8);
}
.stat .num { font-size: 22px; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .lab { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat.warn .num { color: var(--amber); }
.stat.exp .num { color: var(--red); }

.item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border-radius: 18px; padding: 13px 14px; margin-bottom: 9px;
  box-shadow: var(--shadow); border: 1px solid rgba(240, 231, 218, .8);
  position: relative; overflow: hidden;
}
.item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--green);
}
.item.s-warn::before { background: var(--amber); }
.item.s-exp::before { background: var(--red); }
.item .badge-ico {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--green-soft);
}
.item.s-warn .badge-ico { background: var(--amber-soft); }
.item.s-exp .badge-ico { background: var(--red-soft); }
.item .body { flex: 1; min-width: 0; }
.item .name { font-weight: 650; font-size: 15.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.item .days { font-weight: 700; font-variant-numeric: tabular-nums; }
.item .days.ok { color: var(--green); }
.item .days.warn { color: var(--amber); }
.item .days.exp { color: var(--red); }
.item .acts { display: flex; gap: 6px; margin-top: 8px; }
.item .acts button {
  font-size: 12px; padding: 5px 10px; border-radius: 9px;
  background: #F7F2EA; color: var(--ink-2);
}
.item .acts button.primary { background: var(--green-soft); color: var(--green); }
.tag {
  font-size: 10.5px; padding: 1px 7px; border-radius: 6px;
  background: var(--red-soft); color: var(--red); font-weight: 600;
}
.tag.amber { background: var(--amber-soft); color: var(--amber); }

.empty {
  text-align: center; padding: 44px 20px; color: var(--muted);
}
.empty .ico { font-size: 44px; opacity: .55; margin-bottom: 10px; }
.empty p { margin: 4px 0; font-size: 13.5px; }

/* ---------------- 菜单 ---------------- */
.dish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.dish {
  background: var(--card); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(240, 231, 218, .8);
  display: flex; flex-direction: column;
  transition: transform .12s;
}
.dish:active { transform: scale(.98); }
.dish .art { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #F4EEE4; }
.dish .info { padding: 9px 11px 11px; }
.dish .nm { font-weight: 650; font-size: 14.5px; line-height: 1.3; }
.dish .sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.dish .miss {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; padding: 2px 7px; border-radius: 6px; margin-top: 6px;
  background: var(--red-soft); color: var(--red); font-weight: 600;
}
.dish .miss.ready { background: var(--green-soft); color: var(--green); }

/* ---------------- 日历 ---------------- */
.today-card {
  background: linear-gradient(145deg, #FFF9F2 0%, #FBEFE4 55%, #F6E7D8 100%);
  border-radius: 24px; padding: 18px 18px 16px; position: relative; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(199, 91, 57, .12);
}
.today-card::after {
  content: ''; position: absolute; right: -30px; top: -40px; width: 140px; height: 140px;
  border-radius: 50%; background: radial-gradient(circle, rgba(199, 91, 57, .13), transparent 70%);
}
.today-card .line1 { font-size: 12px; color: var(--brand-dark); font-weight: 600; letter-spacing: .5px; }
.today-card .big { font-size: 40px; font-weight: 780; letter-spacing: -1px; line-height: 1.1; margin: 2px 0; font-variant-numeric: tabular-nums; }
.today-card .big span { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-left: 6px; letter-spacing: 0; }
.today-card .lunar { font-size: 13.5px; color: var(--ink-2); }
.today-card .extras { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .75); color: var(--brand-dark); font-weight: 600;
  border: 1px solid rgba(199, 91, 57, .16);
}
.pill.green { color: var(--green); border-color: rgba(76, 138, 84, .22); }

.week-strip { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.week-strip::-webkit-scrollbar { display: none; }
.wday {
  flex: 0 0 auto; width: 58px; padding: 10px 4px; border-radius: 15px; text-align: center;
  background: #fff; border: 1px solid var(--line);
}
.wday.today { background: var(--ink); color: #fff; border-color: var(--ink); }
.wday .w { font-size: 11px; opacity: .7; }
.wday .d { font-size: 17px; font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; }
.wday .t { font-size: 9.5px; height: 13px; margin-top: 1px; overflow: hidden; }
.wday.today .t { color: #FFE0CF; }
.wday .t.fest { color: var(--brand); font-weight: 600; }
.wday.today .t.fest { color: #FFD3BD; }

.rec {
  display: flex; gap: 12px; padding: 12px; border-radius: 18px; background: #fff;
  box-shadow: var(--shadow); margin-bottom: 9px; border: 1px solid rgba(240, 231, 218, .8);
  align-items: center;
}
.rec img { width: 62px; height: 62px; border-radius: 14px; object-fit: cover; flex: 0 0 auto; }
.rec .rn { font-weight: 650; font-size: 15px; }
.rec .rd { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rec .why { font-size: 11px; color: var(--brand-dark); background: var(--brand-soft); padding: 2px 8px; border-radius: 6px; display: inline-block; margin-top: 5px; }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + var(--safe-b)); width: min(528px, calc(100% - 24px));
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 253, 250, .92);
  backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(240, 231, 218, .9);
  border-radius: 22px; padding: 6px;
  box-shadow: 0 8px 30px rgba(96, 71, 43, .13);
  z-index: 40;
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 6px; border-radius: 16px; color: var(--muted); font-size: 10px; font-weight: 600;
  transition: .15s;
}
.tabbar button .i { font-size: 19px; line-height: 1; filter: grayscale(.4); opacity: .75; }
.tabbar button.on { color: var(--brand); background: var(--brand-soft); }
.tabbar button.on .i { filter: none; opacity: 1; }

/* ---------------- 弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(46, 40, 35, .38);
  z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s;
  backdrop-filter: blur(2px);
}
.sheet-mask.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 102%);
  width: min(560px, 100%); max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 26px 26px 0 0;
  z-index: 61; transition: transform .28s cubic-bezier(.3, .9, .3, 1);
  padding: 8px 18px calc(24px + var(--safe-b));
  box-shadow: 0 -10px 40px rgba(96, 71, 43, .16);
}
.sheet.on { transform: translate(-50%, 0); }
.sheet .grab { width: 40px; height: 4px; border-radius: 3px; background: #E4D9C9; margin: 6px auto 12px; }
.sheet h3 { margin: 0 0 14px; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.sheet h3 .x { font-size: 20px; color: var(--muted); padding: 0 4px; }

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input[type=text], .field input[type=number], .field input[type=date], .field textarea, .field select {
  width: 100%; padding: 12px 13px; border-radius: 13px; border: 1px solid var(--line);
  background: #fff; font-size: 15px; transition: border-color .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.field .tip { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; gap: 6px; background: #F3ECE1; padding: 4px; border-radius: 13px; }
.seg button {
  flex: 1; padding: 9px 0; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); font-weight: 600;
}
.seg button.on { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 4px rgba(0, 0, 0, .07); }

/* 标签卡 */
.label-card {
  background: #FFFDF9; border-radius: 22px; padding: 20px;
  border: 1px dashed rgba(199, 91, 57, .35); position: relative; overflow: hidden;
}
.label-card .cap { font-size: 11px; letter-spacing: 2px; color: var(--brand); font-weight: 700; }
.label-card .pname { font-size: 26px; font-weight: 780; margin: 4px 0 2px; letter-spacing: -0.5px; }
.label-card .pmeta { font-size: 12.5px; color: var(--muted); }
.label-card .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 4px; text-align: center; }
.label-card .grid3 > div { background: #FBF6EE; border-radius: 13px; padding: 9px 4px; }
.label-card .grid3 .k { font-size: 10.5px; color: var(--muted); }
.label-card .grid3 .v { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.label-card .how { margin-top: 14px; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.label-card .how b { color: var(--ink); }
.label-card .signs { margin-top: 8px; font-size: 12.5px; color: var(--red); background: var(--red-soft); padding: 9px 11px; border-radius: 11px; }
.label-card .foot { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }

/* 食材状态 */
.ing-list { display: flex; flex-direction: column; gap: 7px; }
.ing {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); font-size: 14px;
}
.ing .st { font-size: 15px; flex: 0 0 auto; width: 18px; text-align: center; }
.ing .nm { font-weight: 600; }
.ing .qty { font-size: 12px; color: var(--muted); margin-left: auto; text-align: right; }
.ing.have { background: var(--green-soft); border-color: rgba(76, 138, 84, .18); }
.ing.sub { background: var(--amber-soft); border-color: rgba(181, 124, 16, .2); }
.ing.miss { background: #fff; border-style: dashed; }
.ing .note { font-size: 11.5px; color: var(--amber); font-weight: 700; }

.steps { counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li {
  counter-increment: s; position: relative; padding: 0 0 12px 30px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2);
}
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 21px; height: 21px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark);
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center;
}

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .k { font-size: 14px; font-weight: 600; }
.setting-row .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.setting-row .v { font-size: 13px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(104px + var(--safe-b)); transform: translate(-50%, 12px);
  background: rgba(46, 40, 35, .93); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 10px 18px; border-radius: 13px; z-index: 90; opacity: 0; pointer-events: none;
  transition: .22s; max-width: 84vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.notice {
  font-size: 12px; color: var(--muted); line-height: 1.65;
  background: #FBF3E7; border-radius: 12px; padding: 10px 12px; margin-top: 8px;
}
.ai-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 5px; font-weight: 700;
  background: linear-gradient(120deg, #EFD9C8, #E4EEDF); color: #7A5236;
}
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 600px) {
  body { padding-top: 8px; }
  .dish-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------------- 厨房 ---------------- */
.kitchen-head {
  background: linear-gradient(145deg, #FFF4EA, #FBE3D3);
  border-radius: 22px; padding: 16px 18px; margin-bottom: 12px;
  border: 1px solid rgba(199, 91, 57, .14);
  box-shadow: var(--shadow);
}
.kitchen-head .t { font-size: 12px; color: var(--brand-dark); font-weight: 700; letter-spacing: 1px; }
.kitchen-head .d { font-size: 24px; font-weight: 780; margin-top: 2px; }
.kitchen-head .n { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

.menu-day { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.menu-item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .85); border-radius: 14px; padding: 8px 12px;
  border: 1px solid rgba(199, 91, 57, .12); font-weight: 650; font-size: 14.5px;
}
.menu-item .e { font-size: 20px; }

.lock-note {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted); margin-top: 10px;
}

.draft {
  display: flex; gap: 12px; padding: 12px; border-radius: 18px; background: #fff;
  box-shadow: var(--shadow); margin-bottom: 9px; border: 1px dashed rgba(181, 124, 16, .4);
  align-items: center;
}
.draft img { width: 58px; height: 58px; border-radius: 13px; object-fit: cover; flex: 0 0 auto; }
.draft .rn { font-weight: 650; font-size: 15px; }
.draft .rd { font-size: 12px; color: var(--muted); margin-top: 2px; }
.draft .dacts { display: flex; gap: 6px; margin-top: 7px; }

.tl-date {
  display: flex; align-items: baseline; gap: 8px;
  margin: 14px 2px 8px;
}
.tl-date .d1 { font-weight: 750; font-size: 14.5px; }
.tl-date .d2 { font-size: 11px; color: var(--muted); }
.tl-dishes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tl-dishes::-webkit-scrollbar { display: none; }
.tl-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  background: #fff; border-radius: 12px; padding: 7px 11px;
  border: 1px solid var(--line); font-size: 13px; font-weight: 600;
}
.tl-chip .e { font-size: 16px; }

.guide {
  background: #fff; border-radius: 22px; padding: 22px 20px; text-align: center;
  box-shadow: var(--shadow);
}
.guide .ico { font-size: 42px; margin-bottom: 8px; }
.guide h4 { margin: 0 0 6px; font-size: 16px; }
.guide p { font-size: 13px; color: var(--muted); margin: 4px 0 14px; line-height: 1.7; }
.guide ol { text-align: left; font-size: 12.5px; color: var(--ink-2); line-height: 1.9; margin: 0 0 14px; padding-left: 20px; }

.acct-ok { display: flex; align-items: center; gap: 12px; }
.acct-ok .ava {
  width: 46px; height: 46px; border-radius: 15px; background: var(--brand-soft);
  display: grid; place-items: center; font-size: 22px; color: var(--brand-dark); font-weight: 800;
}

.dish-hero { width: 100%; border-radius: 16px; margin-bottom: 14px; aspect-ratio: 4/3; object-fit: cover; background: #F4EEE4; }

/* 生图失败时的诊断信息（方便截图排查） */
.diag {
  background: #F8F4EC; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 13px; font-size: 11.5px; line-height: 1.75; color: var(--ink-2);
  word-break: break-all; margin-top: 8px;
}
.diag b { color: var(--ink); font-size: 12px; }

/* 菜单页：标题+筛选+新增固定在顶部，菜品多也不用翻到底 */
.menu-bar {
  position: sticky;
  top: var(--topbar-h, 62px);
  z-index: 15;
  margin: 0 -16px;
  padding: 0 16px 10px;
  background: rgba(251, 246, 238, .96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(240, 231, 218, .9);
}
.menu-bar .section-head { margin: 6px 2px 8px; }
.menu-bar .chips { padding-bottom: 8px; }
.menu-bar .btn.sm { padding: 9px 14px; font-size: 13px; }

/* ============================================================
 * 打磨：库存吸顶 / 家庭面板 / 自定义联想 / 全局丝滑
 * ============================================================ */

/* 库存页吸顶条（与菜单页同款） */
.pantry-bar {
  position: sticky;
  top: var(--topbar-h, 62px);
  z-index: 15;
  margin: 0 -16px;
  padding: 0 16px 10px;
  background: rgba(251, 246, 238, .96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(240, 231, 218, .9);
}
.pantry-bar .section-head { margin: 6px 2px 8px; }
.pantry-bar .chips { padding-bottom: 8px; }
.pantry-bar .btn.sm { padding: 9px 14px; font-size: 13px; }

/* 全局手感 */
html { scroll-behavior: smooth; }
.btn { transition: transform .12s ease, opacity .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.btn:active { transform: scale(.965); }
.chip { transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease; }
.chip:active { transform: scale(.94); }
.tabbar button { transition: color .18s ease, background-color .18s ease; }
.tabbar button .i { transition: transform .18s ease; }
.tabbar button.on .i { transform: translateY(-1px); }
.card, .dish, .ing, .menu-item, .draft, .guide { transition: transform .15s ease, box-shadow .2s ease; }
.dish:active { transform: scale(.98); }
.ing:active { transform: scale(.985); }
.stat .num { transition: transform .18s ease; }
.field input, .field textarea { transition: border-color .15s ease, box-shadow .15s ease; }
.field input:focus, .field textarea:focus { box-shadow: 0 0 0 3px rgba(199, 91, 57, .10); }

/* 页面切换更顺滑 */
.page { animation: fade .24s cubic-bezier(.3, .8, .3, 1); }

/* 家庭面板（群聊感） */
.fam-head {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #FBEBE0, #F2EBDD);
  border-radius: 18px; padding: 14px 16px; margin-bottom: 12px;
}
.fam-head .ava {
  width: 46px; height: 46px; border-radius: 15px; flex: 0 0 auto;
  background: #fff; display: grid; place-items: center; font-size: 24px;
  box-shadow: 0 2px 8px rgba(96, 71, 43, .10);
}
.fam-head .nm { font-size: 15.5px; font-weight: 700; }
.fam-head .cd { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.fam-head .copy { margin-left: auto; flex: 0 0 auto; }
.fam-members { margin-bottom: 6px; }
.fam-member {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px dashed var(--line);
}
.fam-member:last-child { border-bottom: none; }
.fam-member .ava {
  width: 34px; height: 34px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 15px; font-weight: 700; color: #fff;
}
.fam-member .nm { font-size: 14px; font-weight: 600; }
.fam-member .id { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.fam-member .me {
  font-size: 10px; color: var(--brand); background: var(--brand-soft);
  border-radius: 6px; padding: 1px 6px; font-weight: 700; margin-left: 6px;
}
.fam-count {
  font-size: 12px; color: var(--muted); text-align: center; margin: 10px 0 2px;
}
.fam-div {
  display: flex; align-items: center; gap: 10px; margin: 16px 0 12px;
  font-size: 11.5px; color: var(--muted);
}
.fam-div::before, .fam-div::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* 自定义食材联想（输入时才出现，不打扰打字） */
.sug {
  position: fixed; z-index: 120; max-height: 216px; overflow-y: auto;
  background: #fff; border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(96, 71, 43, .18);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.sug.on { opacity: 1; transform: none; pointer-events: auto; }
.sug-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 14px; cursor: pointer;
}
.sug-item:active { background: var(--brand-soft); }
.sug-item .e { font-size: 16px; }
.sug-item .cat { margin-left: auto; font-size: 11px; color: var(--muted); }
.sug-empty { padding: 10px 14px; font-size: 12px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
