/* ============================================================
   好好吃饭计划 · 设计令牌与组件
   日系生活手账：奶油白纸面、草莓牛奶粉、蜜桃、薄荷，圆润但克制
   ============================================================ */

:root {
  /* —— 色彩 —— */
  --cream: #fff8ef;          /* 页面底色：奶油白 */
  --cream-2: #fffdf8;        /* 卡片底色 */
  --paper: #fff1e2;          /* 暖色面板 / 纸条 */
  --paper-line: #f3dcc8;     /* 纸条横线 */

  --berry: #ef8aa2;          /* 草莓牛奶粉：主色 */
  --berry-deep: #df6f8b;     /* 按下 / 文字用的深一档 */
  --berry-soft: #fde3ea;     /* 浅底 */
  --berry-ink: #b84a68;      /* 粉底上的文字 */

  --peach: #f6b48c;          /* 蜜桃：热乎、提醒 */
  --peach-soft: #fde8da;
  --peach-ink: #b8602c;

  --mint: #8fcbb4;           /* 薄荷：清淡、完成 */
  --mint-soft: #e1f3ea;
  --mint-ink: #3c8468;

  --butter: #f4d87c;         /* 奶油黄：早餐、点缀 */
  --butter-soft: #fbf1cf;
  --butter-ink: #9a7416;

  --cocoa: #4a3b32;          /* 正文：暖棕而不是纯黑 */
  --cocoa-soft: #86766c;     /* 次级文字 */
  --cocoa-mute: #b6a89e;     /* 占位、说明 */
  --line: rgba(74, 59, 50, 0.1);
  --line-strong: rgba(74, 59, 50, 0.18);

  /* —— 圆角 —— */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* —— 间距（4 的倍数）—— */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;

  /* —— 阴影：柔、暖、低 —— */
  --shadow-xs: 0 1px 2px rgba(120, 84, 60, 0.05), 0 1px 6px rgba(120, 84, 60, 0.04);
  --shadow-sm: 0 2px 6px rgba(120, 84, 60, 0.06), 0 8px 20px rgba(120, 84, 60, 0.06);
  --shadow-md: 0 6px 14px rgba(120, 84, 60, 0.08), 0 18px 40px rgba(120, 84, 60, 0.09);
  --shadow-berry: 0 8px 18px rgba(239, 138, 162, 0.32);

  /* —— 字体 —— */
  --font-body: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-hand: 'LXGW WenKai Screen', 'LXGW WenKai', 'Kaiti SC', 'STKaiti', var(--font-body);
  --font-num: 'Nunito', var(--font-body);

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 17px;
  --fs-lg: 20px;
  --fs-xl: 26px;
  --fs-2xl: 32px;

  /* —— 动效 —— */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 180ms;

  /* —— 布局 —— */
  --app-max: 520px;
  --tabbar-h: 64px;
  --touch: 44px;
}

/* ============ 基础 ============ */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--cocoa);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* 底纹：很淡的点格，像手账内页 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(74, 59, 50, 0.07) 1px, transparent 1.2px);
  background-size: 22px 22px;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.35));
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.35));
}

h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 3px solid rgba(143, 203, 180, 0.9);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ============ 外壳 ============ */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s-4));
}

.app > main { flex: 1; }
[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: var(--touch) 1fr var(--touch);
  align-items: center;
  min-height: 56px;
  padding: var(--s-2) var(--s-3);
  background: rgba(255, 248, 239, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-title {
  text-align: center;
  font-family: var(--font-hand);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  border-radius: var(--r-pill);
  color: var(--cocoa);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(74, 59, 50, 0.06); }
.icon-btn:active { transform: scale(0.92); background: rgba(74, 59, 50, 0.1); }
.icon-btn[disabled] { opacity: 0.4; pointer-events: none; }
.icon-btn.is-on { color: var(--berry-deep); }
.icon-btn.is-on svg { fill: currentColor; }

.page {
  padding: var(--s-2) var(--s-4) var(--s-6);
  animation: page-in 260ms var(--ease) both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-6) 0 var(--s-3);
  font-size: var(--fs-base);
  font-weight: 700;
}
.section-title .muted { font-weight: 400; color: var(--cocoa-mute); font-size: var(--fs-sm); }

.muted { color: var(--cocoa-soft); }
.small { font-size: var(--fs-sm); }
.hand { font-family: var(--font-hand); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ============ 按钮 ============ */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--touch);
  padding: 0 var(--s-6);
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: var(--fs-base);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition:
    transform var(--dur) var(--ease),
    background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    color var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 var(--s-4); font-size: var(--fs-sm); }
.btn-sm svg { width: 16px; height: 16px; }

.btn-primary {
  color: #fff;
  background: var(--berry);
  box-shadow: var(--shadow-berry);
}
.btn-primary:hover { background: var(--berry-deep); }
.btn-primary:active { background: var(--berry-deep); box-shadow: 0 3px 8px rgba(239, 138, 162, 0.3); }

.btn-secondary {
  color: var(--cocoa);
  background: var(--cream-2);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { border-color: var(--berry); color: var(--berry-ink); }
.btn-secondary:active { background: var(--berry-soft); }

.btn-ghost { color: var(--cocoa-soft); }
.btn-ghost:hover { color: var(--cocoa); background: rgba(74, 59, 50, 0.05); }

.btn-mint {
  color: var(--mint-ink);
  background: var(--mint-soft);
  border-color: rgba(143, 203, 180, 0.5);
}
.btn-mint:hover { background: #d3ecdf; }

/* 禁用 */
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

/* 加载：文字隐去、留个小圈 */
.btn.is-loading {
  pointer-events: none;
  color: transparent !important;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.btn-secondary.is-loading::after,
.btn-ghost.is-loading::after,
.btn-mint.is-loading::after {
  border-color: rgba(74, 59, 50, 0.18);
  border-top-color: var(--berry-deep);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 卡片 ============ */

.card {
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: var(--s-4); }

.card-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card-link:hover { border-color: rgba(239, 138, 162, 0.5); box-shadow: var(--shadow-md); }
.card-link:active { transform: scale(0.985); box-shadow: var(--shadow-xs); }

/* ============ 标签 / 胶囊 ============ */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1;
  background: var(--butter-soft);
  color: var(--butter-ink);
}
.tag-berry { background: var(--berry-soft); color: var(--berry-ink); }
.tag-peach { background: var(--peach-soft); color: var(--peach-ink); }
.tag-mint { background: var(--mint-soft); color: var(--mint-ink); }
.tag-butter { background: var(--butter-soft); color: var(--butter-ink); }
.tag-plain { background: rgba(74, 59, 50, 0.06); color: var(--cocoa-soft); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* 可选的胶囊：偏好、口味、预算 */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong);
  background: var(--cream-2);
  color: var(--cocoa);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: all var(--dur) var(--ease);
}
.chip svg { width: 16px; height: 16px; }
.chip:hover { border-color: var(--berry); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"],
.chip.is-on {
  border-color: var(--berry);
  background: var(--berry-soft);
  color: var(--berry-ink);
  box-shadow: inset 0 0 0 1px var(--berry);
}
.chip:disabled { opacity: 0.5; cursor: not-allowed; }
.chip .chip-x { margin-right: -6px; width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; }
.chip .chip-x:hover { background: rgba(184, 74, 104, 0.12); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ============ 表单 ============ */

.field-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) 0;
}
.field-row > label { font-size: var(--fs-sm); color: var(--cocoa-soft); }

.select-wrap { position: relative; }
.select-wrap select,
.text-input {
  width: 100%;
  min-height: var(--touch);
  padding: 0 40px 0 var(--s-4);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--cream-2);
  color: var(--cocoa);
  font-size: var(--fs-base);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.text-input { padding-right: var(--s-4); }
.text-input::placeholder { color: var(--cocoa-mute); }
.select-wrap select:focus,
.text-input:focus {
  outline: none;
  border-color: var(--berry);
  box-shadow: 0 0 0 3px rgba(239, 138, 162, 0.2);
}
.select-wrap::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--cocoa-soft);
  border-bottom: 2px solid var(--cocoa-soft);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* ============ 提示 / Toast ============ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s-4));
  z-index: 60;
  transform: translate(-50%, 16px);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--cocoa);
  color: #fff8ef;
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.notice {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--paper);
  border: 1px dashed rgba(246, 180, 140, 0.8);
  color: var(--cocoa-soft);
  font-size: var(--fs-sm);
}

/* ============ 底部导航 ============ */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--cocoa-mute);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  transition: color var(--dur) var(--ease);
}
.tab svg { width: 24px; height: 24px; transition: transform var(--dur) var(--ease); }
.tab:active svg { transform: scale(0.9); }
.tab.is-active { color: var(--berry-deep); }
.tab.is-active svg { fill: var(--berry-soft); }

/* ============ 首页 ============ */

.home-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-5) 0 var(--s-2);
}
.home-brand .flower { width: 36px; height: 36px; flex: none; }
.home-brand h1 {
  font-family: var(--font-hand);
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.home-brand p { color: var(--cocoa-soft); font-size: var(--fs-sm); margin-top: 2px; }

.hero-cat {
  position: relative;
  margin: var(--s-3) auto var(--s-5);
  width: min(100%, 320px);
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
}
.hero-cat img, .hero-cat svg { width: 100%; height: 100%; }

.feature-list { display: grid; gap: var(--s-3); }

.feature {
  padding: var(--s-4);
}
.feature-icon {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
}
.feature-icon svg { width: 28px; height: 28px; }
.feature-icon.is-berry { background: var(--berry-soft); color: var(--berry-ink); }
.feature-icon.is-peach { background: var(--peach-soft); color: var(--peach-ink); }
.feature-icon.is-mint { background: var(--mint-soft); color: var(--mint-ink); }
.feature-body { flex: 1; min-width: 0; }
.feature-body h3 { font-size: var(--fs-md); font-weight: 700; }
.feature-body p { font-size: var(--fs-sm); color: var(--cocoa-soft); margin-top: 2px; }
.feature .chev { color: var(--cocoa-mute); width: 20px; height: 20px; flex: none; }

.home-quote {
  margin: var(--s-8) auto 0;
  text-align: center;
  font-family: var(--font-hand);
  font-size: var(--fs-md);
  color: var(--cocoa-soft);
  line-height: 1.9;
}

/* ============ 今天吃什么 ============ */

.meal-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}
.meal-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--s-4) var(--s-2);
  border-radius: var(--r-lg);
  border: 1.5px solid var(--line);
  background: var(--cream-2);
  font-weight: 700;
  font-size: var(--fs-sm);
  transition: all var(--dur) var(--ease);
}
.meal-tile svg { width: 34px; height: 34px; }
.meal-tile:active { transform: scale(0.96); }
.meal-tile[aria-pressed="true"] {
  border-color: var(--berry);
  background: var(--berry-soft);
  color: var(--berry-ink);
  box-shadow: var(--shadow-sm);
}

.pick-actions { margin-top: var(--s-6); }

.cat-note {
  display: flex;
  align-items: flex-end;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.cat-note .peek { width: 88px; height: 72px; flex: none; }
.cat-note p {
  font-family: var(--font-hand);
  font-size: var(--fs-base);
  color: var(--cocoa-soft);
  line-height: 1.8;
  padding-bottom: var(--s-2);
}

/* ============ 推荐结果 ============ */

.bubble {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-lg);
  background: var(--paper);
  border: 1px solid rgba(246, 180, 140, 0.4);
}
.bubble .avatar { width: 40px; height: 40px; flex: none; }
.bubble p { font-size: var(--fs-sm); color: var(--cocoa); line-height: 1.5; }
.bubble .sub { display: block; margin-top: 2px; color: var(--cocoa-mute); font-size: var(--fs-xs); }

.dish-list { display: grid; gap: var(--s-3); margin-top: var(--s-4); }

.dish-card {
  position: relative;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: var(--s-3);
  padding: var(--s-3);
  text-decoration: none;
  color: inherit;
  animation: page-in 320ms var(--ease) both;
}
.dish-card:nth-child(2) { animation-delay: 60ms; }
.dish-card:nth-child(3) { animation-delay: 120ms; }

.dish-thumb {
  width: 112px;
  height: 112px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper);
}
.dish-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 图片加载不出来时，放只小猫顶一下 */
.is-missing { background: var(--paper) url('/img/cat-face.svg') center / 44px no-repeat; }

.dish-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dish-body h3 { font-size: var(--fs-md); font-weight: 700; padding-right: 36px; }
.dish-body .desc {
  font-size: var(--fs-sm);
  color: var(--cocoa-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dish-reason {
  font-family: var(--font-hand);
  font-size: var(--fs-sm);
  color: var(--berry-ink);
  background: var(--berry-soft);
  border-radius: var(--r-xs);
  padding: 4px 8px;
}

.dish-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: auto;
  font-size: var(--fs-xs);
  color: var(--cocoa-soft);
}
.dish-meta span { display: inline-flex; align-items: center; gap: 4px; }
.dish-meta svg { width: 14px; height: 14px; color: var(--peach-ink); }

.dish-link { color: inherit; text-decoration: none; }
/* 整张卡都能点，但心心按钮浮在上面 */
.dish-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.dish-card:hover { border-color: rgba(239, 138, 162, 0.5); box-shadow: var(--shadow-md); }
.dish-card:active { transform: scale(0.985); }
.dish-card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }

.dish-card .fav {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  z-index: 2;
  width: 36px;
  height: 36px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-xs);
}
.dish-card .fav svg { width: 20px; height: 20px; }

.result-actions { display: grid; grid-template-columns: 1fr auto; gap: var(--s-3); margin-top: var(--s-5); }

/* 骨架屏 */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(74, 59, 50, 0.06);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; margin-bottom: 8px; }

/* ============ 菜品详情 ============ */

.detail-hero {
  margin: 0 calc(-1 * var(--s-4));
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper);
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }

.detail-head { display: flex; align-items: flex-start; gap: var(--s-3); margin-top: var(--s-5); }
.detail-head h1 { flex: 1; font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-5); }
.stat {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
}
.stat svg { width: 26px; height: 26px; color: var(--peach-ink); flex: none; }
.stat .label { font-size: var(--fs-xs); color: var(--cocoa-mute); }
.stat .value { font-size: var(--fs-base); font-weight: 700; }

.ingredients { padding: var(--s-4); margin-top: var(--s-5); }
.ingredients h2 { font-size: var(--fs-base); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.ingredients ul { margin-top: var(--s-3); display: grid; gap: 6px; }
.ingredients li {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.ingredients li:last-child { border-bottom: 0; }
.ingredients li span:last-child { color: var(--cocoa-soft); }

.steps { margin-top: var(--s-5); display: grid; gap: var(--s-3); }
.step { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-3); font-size: var(--fs-sm); line-height: 1.6; }
.step .n {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--mint-soft);
  color: var(--mint-ink);
  font-family: var(--font-num);
  font-weight: 800;
  font-size: var(--fs-sm);
}

.detail-actions { display: grid; grid-template-columns: 1fr auto; gap: var(--s-3); margin-top: var(--s-6); }

/* ============ 今日小纸条 ============ */

.note-card {
  position: relative;
  margin-top: var(--s-5);
  padding: var(--s-8) var(--s-6) var(--s-6);
  border-radius: 6px 6px var(--r-md) var(--r-md);
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--paper-line) 31px 32px),
    var(--paper);
  background-position: 0 10px;
  box-shadow: var(--shadow-md);
  transform: rotate(-0.6deg);
}
.note-card::before {
  /* 一段半透明的和纸胶带 */
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  width: 110px;
  height: 26px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(143, 203, 180, 0.55);
  border-left: 1px dashed rgba(255,255,255,0.7);
  border-right: 1px dashed rgba(255,255,255,0.7);
  box-shadow: 0 1px 2px rgba(74, 59, 50, 0.1);
}
.note-inner { transform: rotate(0.6deg); }
.note-text {
  font-family: var(--font-hand);
  font-size: 22px;
  line-height: 32px;
  color: var(--cocoa);
  min-height: 96px;
  white-space: pre-line;
  text-wrap: balance;
}
.note-text.is-loading { color: var(--cocoa-mute); }
.note-date {
  margin-top: var(--s-4);
  padding-right: 96px;
  text-align: left;
  font-family: var(--font-num);
  font-size: var(--fs-xs);
  color: var(--cocoa-mute);
  letter-spacing: 0.08em;
}
.note-cat {
  position: absolute;
  right: -6px;
  bottom: -18px;
  width: 92px;
  height: 76px;
}

.note-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-8);
}
.note-refresh { margin-top: var(--s-6); display: flex; justify-content: center; }

.saved-notes { display: grid; gap: var(--s-2); }
.saved-note {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  font-family: var(--font-hand);
  font-size: var(--fs-base);
  line-height: 1.6;
}
.saved-note .when { font-family: var(--font-num); font-size: var(--fs-xs); color: var(--cocoa-mute); display: block; margin-top: 4px; }
.saved-note p { flex: 1; }

/* ============ 懒人备餐清单 ============ */

.plan-intro { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--cocoa-soft); line-height: 1.6; }

.day-tabs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: var(--s-4);
  padding: 4px;
  border-radius: var(--r-pill);
  background: rgba(74, 59, 50, 0.05);
}
.day-tab {
  min-height: 36px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--cocoa-soft);
  transition: all var(--dur) var(--ease);
}
.day-tab[aria-selected="true"] { background: var(--cream-2); color: var(--berry-ink); box-shadow: var(--shadow-xs); }
.day-tab { position: relative; }
.day-tab.is-today::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--berry);
  transform: translateX(-50%);
}

.plan-list { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.plan-item { display: grid; grid-template-columns: 1fr 64px; gap: var(--s-3); padding: var(--s-3) var(--s-4); align-items: center; }
.plan-item .slot { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; }
.plan-item.is-breakfast .slot { color: var(--butter-ink); }
.plan-item.is-lunch .slot { color: var(--peach-ink); }
.plan-item.is-dinner .slot { color: var(--mint-ink); }
.plan-item h3 { font-size: var(--fs-base); font-weight: 700; margin-top: 2px; }
.plan-item .hint { font-size: var(--fs-xs); color: var(--cocoa-soft); margin-top: 2px; }
.plan-thumb { width: 64px; height: 64px; border-radius: var(--r-sm); overflow: hidden; background: var(--paper); }
.plan-thumb img { width: 100%; height: 100%; object-fit: cover; }

.shopping { margin-top: var(--s-5); padding: var(--s-4); }
.shopping h2 { font-size: var(--fs-base); font-weight: 700; }
.shopping ul { margin-top: var(--s-3); display: flex; flex-wrap: wrap; gap: 6px; }
.shopping li { font-size: var(--fs-xs); padding: 4px 10px; border-radius: var(--r-pill); background: var(--mint-soft); color: var(--mint-ink); font-weight: 600; }

.plan-actions { display: grid; grid-template-columns: 1fr auto; gap: var(--s-3); margin-top: var(--s-6); }

/* ============ 我的偏好 / 收藏 ============ */

.pref-block { margin-top: var(--s-5); }
.pref-block h2 { font-size: var(--fs-base); font-weight: 700; margin-bottom: var(--s-3); }

.avoid-input { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2); }
.avoid-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-2); }
.avoid-sugg button { font-size: var(--fs-xs); color: var(--cocoa-soft); padding: 4px 10px; border-radius: var(--r-pill); border: 1px dashed var(--line-strong); }
.avoid-sugg button:hover { color: var(--berry-ink); border-color: var(--berry); }

.pref-actions { margin-top: var(--s-8); display: grid; gap: var(--s-3); justify-items: center; }

.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-10) var(--s-4);
  text-align: center;
  color: var(--cocoa-soft);
  font-size: var(--fs-sm);
}
.empty svg, .empty img { width: 120px; height: 100px; }

/* ============ 关于 / 图片来源 ============ */

.credits { margin-top: var(--s-3); display: grid; gap: 6px; font-size: var(--fs-xs); color: var(--cocoa-soft); }
.credits a, .credit-line a { color: var(--mint-ink); }
.credit-line { margin-top: var(--s-5); text-align: center; }

.footer-link {
  display: block;
  margin: var(--s-8) auto 0;
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--cocoa-mute);
  text-decoration: none;
}
.footer-link:hover { color: var(--cocoa-soft); }

/* ============ 桌面端 ============ */

@media (min-width: 720px) {
  :root { --app-max: 600px; }
  body { background: #fbf2e6; }
  body::before { opacity: 0.35; }
  .app {
    margin: var(--s-8) auto;
    min-height: min(820px, calc(100dvh - 2 * var(--s-8)));
    background: var(--cream);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    padding-bottom: 0;
  }
  .topbar { border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .tabbar {
    position: static;
    transform: none;
    max-width: none;
    height: var(--tabbar-h);
    padding-bottom: 0;
    border-radius: 0 0 var(--r-xl) var(--r-xl);
  }
  .toast { bottom: var(--s-8); }
  .page { padding-inline: var(--s-6); }
  .detail-hero { margin-inline: calc(-1 * var(--s-6)); aspect-ratio: 16 / 9; }
  .hero-cat { width: 340px; }
}

@media (min-width: 1024px) {
  :root { --app-max: 960px; }
  .home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-8);
    align-items: center;
  }
  .home-grid .hero-cat { width: min(100%, 380px); }
  .page-home { display: flex; flex-direction: column; justify-content: center; }
  .dish-list { grid-template-columns: repeat(3, 1fr); }
  .dish-card { grid-template-columns: 1fr; }
  .dish-thumb { width: 100%; height: 160px; }
  .plan-list { grid-template-columns: repeat(3, 1fr); }
  .note-actions { max-width: 480px; margin-inline: auto; }
  .note-card { max-width: 560px; margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
