/* ═══════════════════════════════════════════
   今日吃啥 — Awwwards-quality mobile-first
   Japanese editorial aesthetic (余白 · 呼吸感)
   ═══════════════════════════════════════════ */

:root {
  --bg: #f5f2ec;
  --bg-warm: #eee9df;
  --card: #fffefa;
  --card-2: #f0ece4;
  --ink: #1a1814;
  --ink-2: #6b6560;
  --ink-3: #a8a098;
  --ink-4: #c8c2b8;
  --line: rgba(26, 24, 20, .06);
  --line-2: rgba(26, 24, 20, .1);

  /* 和の色 — Wa no iro (Japanese traditional colors) */
  --sakura: #d4879c;
  --sakura-light: #faf0f3;
  --matcha: #7a9e6c;
  --matcha-light: #edf3ea;
  --matcha-deep: #5c7a50;
  --kinako: #c4a46c;
  --kinako-light: #f8f2e8;
  --sora: #6e98b0;
  --sora-light: #ecf2f6;
  --ume: #c4725c;
  --ume-light: #f8ece8;
  --kuriiro: #764a30;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-out: cubic-bezier(.0, 0, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --sans: "Zen Maru Gothic", "Klee One", Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --title: "LXGW WenKai SC", "Klee One", "Zen Maru Gothic", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", serif;
  --brush: "Zhi Mang Xing", "LXGW WenKai SC", "PingFang SC", "STKaiti", "KaiTi", cursive;
  --mono: "SF Mono", "Fira Code", monospace;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.75;
  font-size: 14px;
  font-weight: 400;
}
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Texture overlay — subtle grain ─── */
.texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  background: none;
}

/* ─── Custom cursor ─── */
.cursor { display: none; }

/* ─── App shell ─── */
.app {
  width: 100%;
  max-width: 480px;
  min-height: 100svh;
  margin: 0 auto;
  padding: 0;
  position: relative;
}

/* ═══════════════════════════════════════════
   Floating nav — appears only on inner pages
   ═══════════════════════════════════════════ */
.floating-nav {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(245, 242, 236, .78);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: 0 1px 8px rgba(0,0,0,.06), 0 0 0 1px rgba(26,24,20,.04);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.floating-nav.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-back {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  transition: .2s var(--ease);
}
.nav-back:active { transform: scale(.85); background: var(--line); }

.nav-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0 4px;
}

.progress-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--ink-4);
  transition: .4s var(--ease);
}
.progress-dot.active {
  width: 20px;
  background: var(--ink);
}

.nav-home {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-3);
  transition: .2s var(--ease);
}
.nav-home:active { transform: scale(.85); color: var(--ink); }

/* ═══════════════════════════════════════════
   Stages — view transitions
   ═══════════════════════════════════════════ */
.stage {
  display: flex;
  flex-direction: column;
  padding: 8px 24px 120px;
  gap: 28px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  /* inactive stages are absolute at top:0; cap them so a tall hidden view
     (e.g. the food picker) can't add phantom scroll under a short screen */
  max-height: 100svh;
  overflow: hidden;
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out), visibility .5s;
}
.stage.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  position: relative;
  max-height: none;
  overflow: visible;
}

/* ═══════════════════════════════════════════
   Hero intro — home page with integrated brand
   ═══════════════════════════════════════════ */
.hero-intro {
  padding: 48px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--round);
  font-size: 22px;
  font-weight: 400;
}
.hero-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--ink-4);
  text-transform: uppercase;
}

.eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin: 0;
}

h1, h2 {
  font-family: var(--brush);
  line-height: 1.3;
  letter-spacing: .02em;
  margin: 0;
  font-weight: 700;
}
h1 {
  font-size: 48px;
  color: var(--ink);
}
h2 { font-size: 30px; }

.hero-sub {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.9;
}

.hero-divider {
  width: 32px;
  height: 2px;
  background: var(--ink-4);
  border-radius: 2px;
}

/* Intro compact (inner pages — extra top padding for floating nav) */
.intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 52px 0 0;
}
.intro.compact { gap: 8px; padding: 52px 0 0; }

.intro p:last-child {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.8;
}

/* ═══════════════════════════════════════════
   Quick Actions — compact utility buttons
   ═══════════════════════════════════════════ */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qa-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.qa-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
  animation: fadeUp .5s var(--ease) backwards;
  text-align: left;
}
.qa-btn:active {
  transform: scale(.975);
}
.qa-btn:hover {
  border-color: var(--ink-4);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.qa-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  background: var(--bg-warm);
}

.qa-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.qa-text strong {
  font-family: var(--title);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.qa-text small {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .02em;
}

.qa-arrow {
  flex-shrink: 0;
  color: var(--ink-4);
  transition: transform .3s var(--ease);
}
.qa-btn:hover .qa-arrow { transform: translateX(3px); }

/* Freestyle — highlight with matcha accent */
.qa-freestyle {
  background: linear-gradient(135deg, var(--matcha-light) 0%, var(--card) 100%);
  border-color: rgba(122, 158, 108, .2);
}
.qa-freestyle .qa-icon {
  background: var(--matcha);
  color: #fff;
  font-size: 18px;
}

/* Compact pair */
.qa-compact {
  padding: 12px 14px;
  gap: 10px;
}
.qa-compact .qa-icon {
  width: 34px;
  height: 34px;
  font-size: 16px;
}
.qa-compact .qa-text strong { font-size: 13px; }
.qa-compact .qa-text small { font-size: 10px; }

.qa-fav .qa-icon {
  background: var(--sakura-light);
  color: var(--sakura);
}
.qa-tools .qa-icon {
  background: var(--sora-light);
  color: var(--sora);
}

/* ═══════════════════════════════════════════
   Choice cards — cuisine & time selection
   Editorial card design with layered depth
   ═══════════════════════════════════════════ */
.category-grid,
.time-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 200px;
  padding: 22px;
  text-align: left;
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
  animation: fadeUp .5s var(--ease) backwards;
  animation-delay: var(--delay, 0s);
}
.choice-card:active {
  transform: scale(.975);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
}

.choice-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--image, linear-gradient(135deg, var(--card-2), var(--card)));
  background-size: cover;
  background-position: center;
  transition: transform .7s var(--ease);
}
.choice-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,.02) 40%,
    rgba(0,0,0,.52) 100%
  );
}

.time-grid .choice-card { min-height: 170px; }

.choice-content { position: relative; z-index: 1; }
.choice-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: rgba(255,255,255,.55);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.choice-card h3 {
  margin: 0;
  font-family: var(--brush);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  letter-spacing: .02em;
}
.choice-card p {
  margin: 8px 0 0;
  color: rgba(255,255,255,.65);
  font-size: 12px;
  line-height: 1.7;
  max-width: 260px;
  font-weight: 400;
}

/* ═══════════════════════════════════════════
   Freestyle board — ingredient selection
   ═══════════════════════════════════════════ */
.freestyle-board {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ingredient-panel,
.selected-panel {
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
}

.small-button {
  border: 1px solid var(--line-2);
  background: transparent;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  transition: .2s var(--ease);
}
.small-button:active { background: var(--card-2); }

.ingredient-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ingredient-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  font-family: var(--round);
  font-size: 14px;
  color: var(--ink);
  letter-spacing: .03em;
}
.ingredient-group-head .ig-icon { font-size: 15px; line-height: 1; }
.ingredient-group-head .ig-count {
  margin-left: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.ingredient-group-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.ingredient-chip {
  min-height: 54px;
  border: 1px solid var(--line-2);
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  text-align: center;
  transition: .25s var(--ease);
}
.ingredient-chip strong { font-size: 13px; font-weight: 600; }
.ingredient-chip span { color: var(--ink-4); font-size: 9px; font-weight: 500; letter-spacing: .02em; }
.ingredient-chip.is-selected {
  background: var(--matcha-light);
  border-color: var(--matcha);
  box-shadow: 0 0 0 1px var(--matcha);
}
.ingredient-chip:active { transform: scale(.92); }

.selected-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.selected-panel h3 {
  margin: 0;
  font-family: var(--title);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
}
.selected-list {
  min-height: 36px;
  color: var(--ink-3);
  font-size: 13px;
}
.selected-list span {
  display: inline-block;
  margin: 0 5px 5px 0;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

/* Calorie calculator in selected panel */
.calorie-calc {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.calorie-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin: 0 0 10px;
}
.calorie-label small {
  font-weight: 400;
  letter-spacing: .05em;
  opacity: .7;
}
.calorie-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.calorie-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-warm);
}
.calorie-item.calorie-main {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--matcha-light), var(--bg-warm));
}
.calorie-value {
  font-family: var(--title);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.calorie-main .calorie-value {
  font-size: 28px;
  color: var(--matcha-deep);
}
.calorie-unit {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}

.primary-action {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .02em;
  transition: .25s var(--ease);
}
.primary-action:active { transform: scale(.97); opacity: .9; }
.primary-action:disabled {
  background: var(--card-2);
  color: var(--ink-4);
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════
   Recipe cards — editorial magazine layout
   ═══════════════════════════════════════════ */
.recipe-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.recipe-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  animation: fadeUp .5s var(--ease) backwards;
  animation-delay: var(--delay, 0s);
  cursor: pointer;
}
.recipe-card:active {
  transform: scale(.98);
  box-shadow: 0 1px 2px rgba(0,0,0,.02), 0 2px 8px rgba(0,0,0,.03);
}

.recipe-image {
  height: 220px;
  background: var(--image, var(--card-2));
  background-size: cover;
  background-position: center;
  position: relative;
}
.recipe-image::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(transparent, rgba(255,254,250,.2));
}

.recipe-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recipe-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.recipe-body h3 {
  margin: 0;
  font-family: var(--brush);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .01em;
}
.recipe-time {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  padding: 3px 8px;
  background: var(--card-2);
  border-radius: 999px;
  flex-shrink: 0;
  letter-spacing: .02em;
}

.recipe-difficulty {
  display: inline-block;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--diff-color, var(--matcha));
  background: color-mix(in srgb, var(--diff-color, var(--matcha)) 8%, transparent);
}

.recipe-body > p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.75;
}

/* Card arrow indicator */
.recipe-card-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-4);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .03em;
  margin-top: 4px;
  transition: color .3s var(--ease);
}
.recipe-card-arrow svg { transition: transform .3s var(--ease); }
.recipe-card:active .recipe-card-arrow { color: var(--ink-2); }
.recipe-card:active .recipe-card-arrow svg { transform: translateX(3px); }

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.recipe-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
}
.recipe-tags .rt-cuisine {
  background: var(--matcha-light);
  border-color: rgba(122, 158, 108, .2);
  color: var(--matcha-deep);
  font-weight: 600;
}
.recipe-tags .rt-match {
  background: var(--ume-light);
  border-color: rgba(196, 114, 92, .2);
  color: var(--ume);
  font-weight: 600;
}

/* Freestyle section labels */
.freestyle-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  margin-top: 8px;
  font-family: var(--title);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.freestyle-section-label small {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
}
.fsl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fsl-green { background: var(--matcha); }
.fsl-amber { background: #d4a04a; }

/* Freestyle strict match tags */
.freestyle-tags { flex-wrap: wrap; }
.recipe-tags .rt-strict-ok {
  background: var(--matcha-light);
  border-color: rgba(122, 158, 108, .25);
  color: var(--matcha-deep);
  font-weight: 600;
}
.recipe-tags .rt-missing {
  background: #fef6e8;
  border-color: rgba(212, 160, 74, .25);
  color: #9a7030;
  font-weight: 600;
}
.recipe-tags .rt-used {
  background: var(--bg-warm);
  border-color: var(--line-2);
  color: var(--ink-2);
  font-size: 10px;
}

/* Dimmed card for "almost there" tier */
.recipe-card-dimmed {
  opacity: .75;
}
.recipe-card-dimmed:hover,
.recipe-card-dimmed:active {
  opacity: 1;
}

.recipe-steps {
  display: none;
}

.match-bar {
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--card-2);
}
.match-bar span {
  display: block;
  height: 100%;
  width: var(--match);
  background: linear-gradient(90deg, var(--matcha), var(--sakura));
  border-radius: 999px;
}

.empty-state {
  border-radius: var(--radius);
  padding: 40px 24px;
  background: var(--card);
  color: var(--ink-3);
  text-align: center;
  font-size: 14px;
  line-height: 1.8;
}

/* ═══════════════════════════════════════════
   AI Loading — recipe generation animation
   ═══════════════════════════════════════════ */
.ai-loading {
  border-radius: var(--radius);
  padding: 60px 24px;
  background: var(--card);
  text-align: center;
  animation: fadeUp .5s var(--ease) backwards;
}
.ai-loading-icon {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.ai-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--matcha);
  animation: aiBounce 1.4s ease-in-out infinite;
}
.ai-dot:nth-child(2) { animation-delay: .16s; }
.ai-dot:nth-child(3) { animation-delay: .32s; }
@keyframes aiBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}
.ai-loading-text {
  font-family: var(--title);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}
.ai-loading-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0;
}

/* ═══════════════════════════════════════════
   Detail View — immersive editorial
   ═══════════════════════════════════════════ */
#detailContent {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-hero {
  width: calc(100% + 48px);
  margin-left: -24px;
  margin-top: -8px;
  height: 320px;
  overflow: hidden;
  position: relative;
}
.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-hero::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(transparent, var(--bg));
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: -40px;
  position: relative;
  z-index: 1;
}
.detail-meta h2 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0;
  line-height: 1.25;
}
.detail-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.detail-badges .recipe-time {
  font-size: 11px;
  background: var(--card-2);
  padding: 4px 10px;
}
.detail-badges .recipe-difficulty {
  font-size: 11px;
  padding: 4px 10px;
}
.detail-note {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.85;
  margin: 0;
}

/* Section headers in detail */
.section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--ink-4);
  text-transform: uppercase;
  margin: 0 0 12px;
}

/* Nutrition grid */
.nutrition-section {
  margin: 0;
}
.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.nutrition-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--card);
  text-align: center;
}
.nutrition-item .nut-value {
  font-size: 24px;
  font-weight: 400;
  font-family: var(--title);
  line-height: 1;
  letter-spacing: 0;
}
.nutrition-item .nut-unit {
  font-size: 9px;
  color: var(--ink-4);
  font-weight: 600;
  letter-spacing: .04em;
  margin-top: -2px;
}
.nutrition-item .nut-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.nutrition-item:nth-child(1) .nut-value { color: var(--ume); }
.nutrition-item:nth-child(2) .nut-value { color: var(--matcha); }
.nutrition-item:nth-child(3) .nut-value { color: var(--kinako); }
.nutrition-item:nth-child(4) .nut-value { color: var(--sora); }

/* Fun fact card */
.funfact-card {
  border-radius: var(--radius);
  padding: 22px;
  background: var(--card);
  border-left: 3px solid var(--sakura);
  position: relative;
}
.funfact-card h4 {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--sakura);
  margin: 0 0 10px;
  text-transform: uppercase;
}
.funfact-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.9;
}

/* Ingredients in detail */
.detail-ingredients {
  border-radius: var(--radius);
  padding: 22px;
  background: var(--card);
}
.detail-ingredients .section-label { margin-bottom: 14px; }
.detail-ingredients p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 2;
  font-weight: 500;
}

/* Seasoning measurement table */
.detail-seasonings {
  border-radius: var(--radius);
  padding: 22px;
  background: var(--card);
}
.seasoning-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.seasoning-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.seasoning-row:last-child { border-bottom: none; }
.seasoning-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.seasoning-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.seasoning-bar {
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: var(--card-2);
  overflow: hidden;
}
.seasoning-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--matcha);
  transition: width .4s var(--ease);
}

/* Steps in detail */
.detail-steps {
  border-radius: var(--radius);
  padding: 22px;
  background: var(--card);
}
.detail-steps .section-label { margin-bottom: 16px; }
.detail-steps ol {
  margin: 0;
  padding: 0;
  counter-reset: step;
  list-style: none;
}
.detail-steps li {
  counter-increment: step;
  padding: 14px 0 14px 44px;
  position: relative;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.8;
}
.detail-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 14px;
  font-family: var(--title);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-4);
  letter-spacing: 0;
}
.detail-steps li + li {
  border-top: 1px solid var(--line);
}

/* ═══════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════
   Desktop (tablets+)
   ═══════════════════════════════════════════ */
@media (min-width: 768px) {
  .app { max-width: 520px; }
  .choice-card { min-height: 220px; }
  .recipe-image { height: 260px; }
  .detail-hero { height: 340px; }
}

@media (min-width: 1024px) {
  .cursor {
    display: block;
    position: fixed;
    z-index: 100;
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width .2s var(--ease), height .2s var(--ease);
    mix-blend-mode: exclusion;
    opacity: .5;
  }
}

/* ═══════════════════════════════════════════
   收藏 — Favorites
   ═══════════════════════════════════════════ */

/* Fav entry card on home */
.fav-entry.choice-card::before {
  background: linear-gradient(135deg, #3d1c2e 0%, #5c2a42 50%, #7a3656 100%);
  background-size: cover;
}

.fav-entry.choice-card::after {
  background:
    radial-gradient(circle at 75% 30%, rgba(255, 200, 200, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 25% 70%, rgba(255, 255, 255, 0.03) 0%, transparent 40%);
}

/* Title row with fav button */
.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-title-row h2 {
  flex: 1;
  min-width: 0;
}

/* Heart / fav button */
.fav-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--card-2, rgba(0,0,0,.04));
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .2s var(--ease), background .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.fav-btn svg {
  stroke: var(--ink-3);
  fill: none;
  stroke-width: 1.8;
  transition: fill .25s var(--ease), stroke .25s var(--ease), transform .25s var(--ease);
}

.fav-btn:active {
  transform: scale(0.85);
}

.fav-btn.is-fav svg {
  fill: #e74c6f;
  stroke: #e74c6f;
}

.fav-btn.is-fav {
  background: rgba(231, 76, 111, 0.1);
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
  font-size: 0.92rem;
  line-height: 1.8;
}

/* ═══════════════════════════════════════════
   过滤栏 — Filter Bar & Tags
   ═══════════════════════════════════════════ */

.filter-bar {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.filter-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line-2, rgba(0,0,0,.06));
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  transition: border-color .2s var(--ease);
}

.filter-search:focus-within {
  border-color: var(--ink-3);
}

.filter-search svg {
  flex-shrink: 0;
  stroke: var(--ink-3);
}

.filter-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
}

.filter-search input::placeholder {
  color: var(--ink-3);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-divider {
  width: 1px;
  height: 20px;
  background: var(--line-2, rgba(0,0,0,.1));
  margin: 0 4px;
}

.filter-tag {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--line-2, rgba(0,0,0,.08));
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.filter-tag:active {
  transform: scale(0.95);
}

.filter-tag.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Speed badge on recipe cards */
.recipe-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.speed-badge {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--card-2);
  color: var(--ink-2);
}

.speed-badge.speed-quick {
  background: #fef3e2;
  color: #b45309;
}

.speed-badge.speed-normal {
  background: #e8f4f8;
  color: #1e6b8a;
}

.speed-badge.speed-prep {
  background: #f0ebe4;
  color: #7c6a50;
}

/* Dark mode speed badges */
body.dark-mode .speed-badge.speed-quick {
  background: rgba(180, 83, 9, .2);
  color: #f0b060;
}

body.dark-mode .speed-badge.speed-normal {
  background: rgba(30, 107, 138, .2);
  color: #80c4d8;
}

body.dark-mode .speed-badge.speed-prep {
  background: rgba(124, 106, 80, .2);
  color: #c4a87a;
}

/* ═══════════════════════════════════════════
   厨具指南 — Kitchen Tools Guide
   ═══════════════════════════════════════════ */

/* Entry card on home page */
.tools-entry.choice-card::before {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  background-size: cover;
}

.tools-entry.choice-card::after {
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 40%);
}

/* Tools grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 0 20px 40px;
}

@media (min-width: 480px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 560px;
    margin: 0 auto;
  }
}

/* Tool card */
.tool-card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.tool-card:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }
}

.tool-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--card-2);
}

.tool-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease);
}

.tool-card:hover .tool-card-image img {
  transform: scale(1.05);
}

.tool-card-body {
  padding: 14px 16px;
}

.tool-card-body h3 {
  font-family: var(--font-brush);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--ink);
}

.tool-card-en {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sub);
  margin-bottom: 6px;
}

.tool-card-tagline {
  font-size: 0.78rem;
  color: var(--sub);
  line-height: 1.4;
}

.tool-card-arrow {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px 12px;
  color: var(--sub);
  opacity: 0.4;
}

/* Tool Detail View */
#toolDetailContent {
  padding: 0 20px 60px;
}

.tool-detail-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 24px;
}

.tool-detail-header {
  margin-bottom: 32px;
}

.tool-detail-header h2 {
  font-family: var(--font-brush);
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}

.tool-detail-header .tool-detail-en {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sub);
  margin-bottom: 8px;
}

.tool-detail-header .tool-detail-tagline {
  font-size: 0.9rem;
  color: var(--sub);
  line-height: 1.5;
}

.tool-section {
  margin-bottom: 28px;
}

.tool-section h3 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent, #e67e22);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tool-list li {
  position: relative;
  padding: 10px 0 10px 20px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}

.tool-list li:last-child {
  border-bottom: none;
}

.tool-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #e67e22);
  opacity: 0.6;
}

/* ═══════════════════════════════════════════
   深夜模式 — Dark / Night Mode
   ═══════════════════════════════════════════ */

/* Toggle button */
.dark-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), transform .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.dark-toggle:active { transform: scale(.9); }
.dark-toggle svg {
  width: 20px;
  height: 20px;
  stroke: var(--ink-2);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .4s var(--ease);
}
.dark-toggle .icon-sun { display: none; }
.dark-toggle .icon-moon { display: block; }

/* ─── Dark theme overrides ─── */
body.dark-mode {
  --bg: #1a1814;
  --bg-warm: #22201a;
  --card: #2a2722;
  --card-2: #33302a;
  --ink: #e8e4dc;
  --ink-2: #a8a098;
  --ink-3: #7a746c;
  --ink-4: #5a5550;
  --line: rgba(232, 228, 220, .08);
  --line-2: rgba(232, 228, 220, .12);

  --sakura-light: #2e2022;
  --matcha-light: #1e2a1c;
  --kinako-light: #2a2618;
  --sora-light: #1c2428;
  --ume-light: #2c201c;
}

body.dark-mode .texture {
  opacity: .02;
}

body.dark-mode .dark-toggle {
  background: var(--card);
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}
body.dark-mode .dark-toggle .icon-sun { display: block; }
body.dark-mode .dark-toggle .icon-moon { display: none; }

body.dark-mode .floating-nav {
  background: rgba(42, 39, 34, .85);
  border-color: rgba(255,255,255,.06);
}

body.dark-mode .hero-mark {
  background: var(--ink);
  color: var(--bg);
}

body.dark-mode .choice-card::after {
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,.15) 40%,
    rgba(0,0,0,.65) 100%
  );
}

body.dark-mode .recipe-image::after {
  background: linear-gradient(to top, var(--card) 0%, transparent 60%);
}

body.dark-mode .detail-hero::after {
  background: linear-gradient(to top, var(--bg) 0%, rgba(26,24,20,.4) 40%, transparent 70%);
}

body.dark-mode .funfact-card {
  background: var(--card-2);
}

body.dark-mode .ingredient-chip {
  background: var(--card);
  border-color: var(--line-2);
}

body.dark-mode .qa-btn {
  background: var(--card);
  border-color: var(--line-2);
}
body.dark-mode .qa-freestyle {
  background: linear-gradient(135deg, rgba(92, 122, 80, .15), var(--card));
  border-color: rgba(122, 158, 108, .15);
}
body.dark-mode .qa-icon {
  background: var(--card-2);
}
body.dark-mode .qa-freestyle .qa-icon {
  background: var(--matcha-deep);
}
body.dark-mode .qa-fav .qa-icon {
  background: rgba(212, 135, 156, .15);
}
body.dark-mode .qa-tools .qa-icon {
  background: rgba(110, 152, 176, .15);
}
body.dark-mode .calorie-item {
  background: var(--card);
}
body.dark-mode .calorie-item.calorie-main {
  background: linear-gradient(135deg, rgba(92, 122, 80, .12), var(--card));
}
body.dark-mode .calorie-main .calorie-value {
  color: var(--matcha);
}
body.dark-mode .recipe-tags .rt-missing {
  background: rgba(212, 160, 74, .12);
  border-color: rgba(212, 160, 74, .2);
  color: #d4a04a;
}
body.dark-mode .recipe-tags .rt-strict-ok {
  background: rgba(122, 158, 108, .12);
  border-color: rgba(122, 158, 108, .2);
  color: var(--matcha);
}

body.dark-mode .primary-action {
  background: var(--ink);
  color: var(--bg);
}

/* ─── Safe area ─── */
@supports (padding-top: env(safe-area-inset-top)) {
  .floating-nav { top: calc(12px + env(safe-area-inset-top)); }
  .hero-intro { padding-top: calc(48px + env(safe-area-inset-top)); }
  .stage:last-of-type { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .dark-toggle { bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ═══════════════════════════════════════════
   Design polish v2 — editorial motion layer
   (entrance choreography · micro-interactions ·
    kcal chips · shopping list · toast)
   ═══════════════════════════════════════════ */

/* ─── Hero entrance choreography ─── */
.hero-intro { position: relative; }
.hero-intro > * { animation: fadeUp .7s var(--ease) backwards; }
.hero-intro .hero-brand { animation-delay: .05s; }
.hero-intro h1 {
  animation: titleIn .9s var(--ease) backwards;
  animation-delay: .14s;
}
.hero-intro .hero-sub { animation-delay: .26s; }
.hero-intro .hero-divider {
  animation: dividerIn .7s var(--ease) backwards;
  animation-delay: .4s;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(18px); letter-spacing: .1em; filter: blur(4px); }
  to   { opacity: 1; transform: none; letter-spacing: .02em; filter: blur(0); }
}
@keyframes dividerIn {
  from { opacity: 0; width: 0; }
  to   { opacity: 1; width: 32px; }
}

/* Vertical editorial sign — 余白の演出 */
.hero-intro::after {
  content: "今日の献立";
  position: absolute;
  top: 52px;
  right: 2px;
  writing-mode: vertical-rl;
  font-family: var(--title);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .46em;
  color: var(--ink-3);
  opacity: 0;
  animation: decoIn 1.2s var(--ease) forwards .55s;
  pointer-events: none;
}
@keyframes decoIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: .5; transform: none; }
}

/* Quick actions follow the hero */
.qa-freestyle { animation-delay: .34s; }
.qa-row .qa-btn:nth-child(1) { animation-delay: .42s; }
.qa-row .qa-btn:nth-child(2) { animation-delay: .48s; }
.qa-row .qa-btn:nth-child(3) { animation-delay: .54s; }
.home-grid .choice-card { animation-delay: calc(var(--delay, 0s) + .5s); }

/* ─── Refined stage transitions ─── */
.stage {
  transform: translateY(18px) scale(.992);
  transition: opacity .55s var(--ease-out), transform .6s var(--ease), visibility .6s;
}

/* ─── Floating nav slides in ─── */
.floating-nav { transform: translate(-50%, -10px); }
.floating-nav.is-visible { transform: translate(-50%, 0); }

/* ─── Card micro-interactions (pointer devices) ─── */
.choice-card::before { will-change: transform; }
.recipe-image { transition: transform .9s var(--ease); }
@media (hover: hover) {
  .choice-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 20px 48px rgba(0,0,0,.16);
  }
  .choice-card:hover::before { transform: scale(1.045); }
  .recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 2px 6px rgba(0,0,0,.05), 0 18px 44px rgba(0,0,0,.12);
  }
  .recipe-card:hover .recipe-image { transform: scale(1.04); }
  .recipe-card:hover .recipe-card-arrow { color: var(--ink-2); }
  .recipe-card:hover .recipe-card-arrow svg { transform: translateX(4px); }
  .primary-action:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(26,24,20,.18);
  }
  .qa-btn:hover .qa-icon { transform: scale(1.08) rotate(-3deg); }
}
.qa-icon { transition: transform .35s var(--spring); }

/* ─── Detail hero ken-burns settle ─── */
.detail-hero img { animation: kenburns 1.3s var(--ease-out) backwards; }
@keyframes kenburns {
  from { transform: scale(1.07); }
  to   { transform: scale(1); }
}

/* ─── Heart pop on favorite ─── */
.fav-btn.is-fav svg { animation: heartPop .45s var(--spring); }
@keyframes heartPop {
  0%   { transform: scale(.55); }
  60%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* ─── kcal chip on preview cards ─── */
.kcal-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ume);
  background: var(--ume-light);
  white-space: nowrap;
}
.kcal-chip svg { flex-shrink: 0; margin-top: -1px; }
body.dark-mode .kcal-chip {
  background: rgba(196, 114, 92, .16);
  color: #d89880;
}

/* ─── Quick-action 3-up row & badge ─── */
.qa-row-3 { grid-template-columns: repeat(3, 1fr); }
.qa-row-3 .qa-compact {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
}
.qa-row-3 .qa-compact .qa-text strong { font-size: 12.5px; }
.qa-row-3 .qa-compact .qa-text small { font-size: 9.5px; }
.qa-btn { position: relative; }
.qa-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ume);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(196, 114, 92, .35);
  animation: badgePop .5s var(--spring) backwards .6s;
}
@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
.qa-shop .qa-icon {
  background: var(--kinako-light);
  color: var(--kinako);
}
body.dark-mode .qa-shop .qa-icon { background: rgba(196, 164, 108, .15); }

/* ─── Add-to-shopping button on detail page ─── */
.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}
.add-shop-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 2px 12px rgba(26, 24, 20, .18);
  transition: transform .3s var(--spring), box-shadow .3s var(--ease), opacity .2s;
}
.add-shop-btn:active { transform: scale(.94); }
@media (hover: hover) {
  .add-shop-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(26, 24, 20, .24);
  }
}
.add-shop-btn svg { flex-shrink: 0; }

/* ─── Shopping list view ─── */
#shoppingContent {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.shop-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
  animation: fadeUp .5s var(--ease) backwards;
}
.shop-summary-text {
  font-size: 13px;
  color: var(--ink-2);
}
.shop-summary-text strong {
  font-family: var(--title);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-right: 2px;
}
.shop-summary-actions { display: flex; gap: 8px; }
.shop-group {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  animation: fadeUp .55s var(--ease) backwards;
  animation-delay: var(--delay, 0s);
}
.shop-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 4px;
  font-family: var(--title);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.shop-group-title small {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-4);
}
.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.shop-item:last-child { border-bottom: none; }
.shop-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-4);
  display: grid;
  place-items: center;
  color: transparent;
  flex-shrink: 0;
  transition: background .3s var(--spring), border-color .25s, color .2s;
}
.shop-item.is-done .shop-check {
  background: var(--matcha);
  border-color: var(--matcha);
  color: #fff;
}
.shop-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  transition: color .25s var(--ease);
}
.shop-item.is-done .shop-name {
  color: var(--ink-4);
  text-decoration: line-through;
  text-decoration-color: var(--ink-4);
}
.shop-qty {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}
.shop-item.is-done .shop-qty { color: var(--ink-4); }
.shop-remove {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-4);
  flex-shrink: 0;
  transition: background .2s, color .2s, transform .2s var(--spring);
}
.shop-remove:active {
  background: var(--ume-light);
  color: var(--ume);
  transform: scale(.85);
}

/* ─── App toast ─── */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 18px);
  z-index: 60;
  padding: 11px 22px;
  border-radius: 999px;
  background: rgba(26, 24, 20, .92);
  color: #f5f2ec;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  max-width: calc(100vw - 48px);
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, .28);
  transition: opacity .35s var(--ease), transform .5s var(--spring);
}
.app-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}
body.dark-mode .app-toast {
  background: rgba(232, 228, 220, .95);
  color: #1a1814;
}
@supports (padding-top: env(safe-area-inset-top)) {
  .app-toast { bottom: calc(30px + env(safe-area-inset-bottom)); }
}

/* ─── Focus visibility (keyboard) ─── */
:focus-visible {
  outline: 2px solid var(--matcha);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ─── Reduced motion: calm everything down ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ═══════════════════════════════════════════
   Design v3 — Playful pastel editorial
   cream paper · candy color blocks · black ink
   bold sans × italic serif · sticker tilt
   ═══════════════════════════════════════════ */
:root {
  /* paper & ink */
  --bg: #f8f2e3;
  --bg-warm: #f1e9d3;
  --card: #fffdf4;
  --card-2: #f0e8d4;
  --ink: #16140f;
  --ink-2: #57523f;
  --ink-3: #8d8670;
  --ink-4: #bdb59c;
  --line: rgba(22, 20, 15, .08);
  --line-2: rgba(22, 20, 15, .14);

  /* candy pastels (reference palette) */
  --marigold: #f5c54e;
  --marigold-soft: #f9dd92;
  --sky: #a9cdf1;
  --sky-soft: #c9e0f8;
  --blush: #f3b8d5;
  --blush-soft: #f9d6e8;
  --sage: #a8b96e;
  --sage-soft: #d7dfae;

  /* remap legacy accent vars onto the new palette */
  --sakura: #d96fa8;
  --sakura-light: #f9d6e8;
  --matcha: #7d9a4f;
  --matcha-light: #e7edcd;
  --matcha-deep: #5e7a38;
  --kinako: #d99a1f;
  --kinako-light: #f9ecca;
  --sora: #4f86c6;
  --sora-light: #ddeafc;
  --ume: #d2603a;
  --ume-light: #f9e0d3;

  --radius: 24px;
  --radius-sm: 16px;
  --serif-i: "Instrument Serif", "LXGW WenKai SC", Georgia, serif;
}

/* ─── Type system: bold sans × italic serif ─── */
h1 {
  font-family: "Zen Maru Gothic", var(--sans);
  font-weight: 900;
  font-size: 56px;
  line-height: 1.12;
  letter-spacing: 0;
}
h1 em {
  font-family: var(--title);
  font-style: italic;
  font-weight: 400;
  letter-spacing: .01em;
  padding-right: .08em;
}
h2 {
  font-family: var(--title);
  font-weight: 700;
  font-size: 33px;
  letter-spacing: .01em;
}
.eyebrow,
.hero-label {
  font-family: var(--serif-i);
  font-style: italic;
  font-weight: 400;
  text-transform: lowercase;
  font-size: 16px;
  letter-spacing: .04em;
  color: var(--ink-2);
}
.hero-sub { color: var(--ink-2); font-size: 13.5px; }
.hero-divider { width: 44px; height: 3px; background: var(--ink); border-radius: 3px; }

/* ─── Hero: sticker collage ─── */
.hero-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 25px;
  transform: rotate(-8deg);
  box-shadow: 3px 3px 0 rgba(22, 20, 15, .18);
}

/* retire the v2 vertical sign — the collage replaces it */
.hero-intro::after { content: none; }

/* olive scalloped flower peeking from the top corner */
.hero-intro::before {
  content: "";
  position: absolute;
  top: -46px;
  right: -34px;
  width: 150px;
  height: 150px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='%23a8b96e'%3E%3Ccircle cx='60' cy='60' r='44'/%3E%3Ccircle cx='104' cy='60' r='16'/%3E%3Ccircle cx='95.6' cy='85.9' r='16'/%3E%3Ccircle cx='73.6' cy='101.8' r='16'/%3E%3Ccircle cx='46.4' cy='101.8' r='16'/%3E%3Ccircle cx='24.4' cy='85.9' r='16'/%3E%3Ccircle cx='16' cy='60' r='16'/%3E%3Ccircle cx='24.4' cy='34.1' r='16'/%3E%3Ccircle cx='46.4' cy='18.2' r='16'/%3E%3Ccircle cx='73.6' cy='18.2' r='16'/%3E%3Ccircle cx='95.6' cy='34.1' r='16'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  transform: rotate(14deg);
  opacity: .9;
  z-index: -1;
  animation: stickerDrift 9s ease-in-out infinite;
  pointer-events: none;
}

/* pink scalloped "今日 PICK!" badge */
.hero-sticker {
  position: absolute;
  top: 152px;
  right: -4px;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  text-align: center;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='%23f3b8d5'%3E%3Ccircle cx='60' cy='60' r='44'/%3E%3Ccircle cx='104' cy='60' r='16'/%3E%3Ccircle cx='95.6' cy='85.9' r='16'/%3E%3Ccircle cx='73.6' cy='101.8' r='16'/%3E%3Ccircle cx='46.4' cy='101.8' r='16'/%3E%3Ccircle cx='24.4' cy='85.9' r='16'/%3E%3Ccircle cx='16' cy='60' r='16'/%3E%3Ccircle cx='24.4' cy='34.1' r='16'/%3E%3Ccircle cx='46.4' cy='18.2' r='16'/%3E%3Ccircle cx='73.6' cy='18.2' r='16'/%3E%3Ccircle cx='95.6' cy='34.1' r='16'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  font-family: "Zen Maru Gothic", var(--sans);
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: .08em;
  color: #16140f;
  transform: rotate(-12deg);
  animation: stickerPop .7s var(--spring) backwards .7s, stickerDrift 7s ease-in-out infinite 1.4s;
  pointer-events: none;
  z-index: 1;
}
@keyframes stickerPop {
  from { opacity: 0; transform: rotate(-32deg) scale(.3); }
  to   { opacity: 1; transform: rotate(-12deg) scale(1); }
}
@keyframes stickerDrift {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50%      { translate: 0 -6px; rotate: 3deg; }
}

/* ─── Quick actions → candy tiles ─── */
.qa-btn {
  border: none;
  border-radius: 22px;
  box-shadow: none;
  transition: transform .35s var(--spring), box-shadow .35s var(--ease);
}
.qa-btn .qa-icon {
  background: transparent !important;
  color: #16140f;
  width: auto;
  height: auto;
}
.qa-text strong {
  font-family: var(--title);
  font-weight: 700;
  color: #16140f;
}
.qa-text small { color: rgba(22, 20, 15, .55); }

.qa-freestyle {
  background: var(--marigold);
  padding: 18px 18px;
}
.qa-freestyle .qa-text strong { font-size: 18px; }
.qa-freestyle .qa-arrow {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 999px;
  background: #16140f;
  color: #f8f2e3;
}
.qa-fav   { background: var(--blush); }
.qa-shop  { background: var(--sky); }
.qa-tools { background: var(--sage-soft); }
.qa-row-3 .qa-compact { padding: 14px; gap: 12px; border-radius: 20px; }
.qa-row-3 .qa-compact .qa-text strong { font-size: 14px; }
.qa-row-3 .qa-compact .qa-text small { font-size: 9.5px; }
.qa-badge {
  background: #16140f;
  color: #f8f2e3;
  box-shadow: none;
}
@media (hover: hover) {
  .qa-btn:hover {
    border-color: transparent;
    transform: translateY(-3px) rotate(-1deg);
    box-shadow: 4px 6px 0 rgba(22, 20, 15, .14);
  }
}

/* ─── Cuisine cards: tilted sticker stack ─── */
.choice-card { border-radius: 26px; }
.home-grid .choice-card,
.time-grid .choice-card {
  --tilt: 0deg;
  transform: rotate(var(--tilt));
  animation-name: fadeUpTilt;
}
.home-grid .choice-card:nth-child(odd),
.time-grid .choice-card:nth-child(odd) { --tilt: -1.4deg; }
.home-grid .choice-card:nth-child(even),
.time-grid .choice-card:nth-child(even) { --tilt: 1.6deg; }
@keyframes fadeUpTilt {
  from { opacity: 0; transform: translateY(20px) rotate(var(--tilt)); }
  to   { opacity: 1; transform: rotate(var(--tilt)); }
}
@media (hover: hover) {
  .home-grid .choice-card:hover,
  .time-grid .choice-card:hover {
    transform: rotate(0deg) translateY(-5px);
    box-shadow: 0 3px 6px rgba(0,0,0,.06), 6px 14px 0 rgba(22, 20, 15, .12);
  }
}
.choice-card h3 {
  font-family: "Zen Maru Gothic", var(--sans);
  font-weight: 900;
  font-size: 34px;
  letter-spacing: .04em;
}
.choice-meta {
  margin-bottom: 12px;
}
.choice-meta span {
  background: rgba(255, 253, 244, .92);
  color: #16140f;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
}

/* ─── Recipe cards ─── */
.recipe-card { border-radius: 26px; }
.recipe-time {
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  padding: 4px 10px;
}
.kcal-chip {
  background: var(--marigold);
  color: #16140f;
  font-weight: 700;
}
body.dark-mode .kcal-chip { background: var(--marigold); color: #16140f; }
.recipe-body h3 { font-family: var(--title); font-weight: 700; font-size: 23px; }
.recipe-tags span { font-weight: 600; }

/* ─── Pills & inputs ─── */
.primary-action {
  border-radius: 999px;
  font-family: var(--title);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .06em;
}
.filter-search { border-radius: 999px; }
.small-button { color: var(--ink-2); border-color: var(--line-2); }

/* ─── Detail page: pastel stat tiles ─── */
.nutrition-item { border-radius: 20px; }
.nutrition-item:nth-child(1) { background: #f7d27e; }
.nutrition-item:nth-child(2) { background: #b9d6f4; }
.nutrition-item:nth-child(3) { background: #f6c8e0; }
.nutrition-item:nth-child(4) { background: #d3dea3; }
.nutrition-item .nut-value { font-weight: 700; }
.nutrition-item:nth-child(1) .nut-value,
.nutrition-item:nth-child(2) .nut-value,
.nutrition-item:nth-child(3) .nut-value,
.nutrition-item:nth-child(4) .nut-value { color: #16140f; }
.nutrition-item .nut-unit { color: rgba(22, 20, 15, .55); }
.nutrition-item .nut-label { color: rgba(22, 20, 15, .75); }

.funfact-card {
  background: var(--blush-soft);
  border-left: none;
  border-radius: 22px;
  padding: 24px 22px 22px;
}
.funfact-card h4 {
  color: #16140f;
  font-family: var(--serif-i);
  font-style: italic;
  text-transform: lowercase;
  font-size: 15px;
  letter-spacing: .03em;
}
.funfact-card p { color: rgba(22, 20, 15, .78); }
body.dark-mode .funfact-card { background: var(--blush-soft); }
body.dark-mode .funfact-card p { color: rgba(22, 20, 15, .78); }

.seasoning-bar span { background: var(--ink); }
.detail-steps li::before { color: var(--ink-3); font-weight: 700; }

/* ─── Shopping list ─── */
.shop-group { border-radius: 26px; }
.shop-check { border-color: var(--ink-3); border-width: 2px; }
.shop-item.is-done .shop-check {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ─── Section labels ─── */
.section-label {
  color: var(--ink-3);
  font-weight: 800;
}

/* ─── Floating nav & toggles ─── */
.floating-nav {
  background: rgba(248, 242, 227, .82);
  box-shadow: 0 1px 0 rgba(22,20,15,.08), 0 6px 20px rgba(22,20,15,.1);
}
.progress-dot.active { background: var(--ink); }

/* ─── Dark mode: night paper, candy stays candy ─── */
body.dark-mode {
  --bg: #18150e;
  --bg-warm: #201c12;
  --card: #272215;
  --card-2: #302a1a;
  --ink: #f3ecd9;
  --ink-2: #b3aa8e;
  --ink-3: #837b62;
  --ink-4: #57513d;
  --line: rgba(243, 236, 217, .09);
  --line-2: rgba(243, 236, 217, .15);
  --sakura-light: #3a2230;
  --matcha-light: #28301a;
  --kinako-light: #332a12;
  --sora-light: #1d2a3a;
  --ume-light: #38211a;
}
body.dark-mode .floating-nav { background: rgba(39, 34, 21, .85); }
body.dark-mode .hero-intro::before { opacity: .55; }
body.dark-mode .hero-sticker { filter: saturate(.92); }
body.dark-mode .nutrition-item:nth-child(1) { background: #f7d27e; }
body.dark-mode .nutrition-item:nth-child(2) { background: #b9d6f4; }
body.dark-mode .nutrition-item:nth-child(3) { background: #f6c8e0; }
body.dark-mode .nutrition-item:nth-child(4) { background: #d3dea3; }
body.dark-mode .qa-freestyle { background: var(--marigold); }
body.dark-mode .qa-fav   { background: var(--blush); }
body.dark-mode .qa-shop  { background: var(--sky); }
body.dark-mode .qa-tools { background: var(--sage-soft); }
body.dark-mode .qa-freestyle .qa-icon { background: transparent; }
body.dark-mode .qa-icon { background: transparent; }
body.dark-mode .qa-badge { background: #16140f; color: #f8f2e3; }
body.dark-mode .choice-meta span { background: rgba(255, 253, 244, .92); color: #16140f; }

/* narrow phones: keep the lockup on one breath */
@media (max-width: 390px) {
  h1 { font-size: 47px; }
  .hero-sticker { width: 82px; height: 82px; top: 138px; }
}

/* ═══════════════════════════════════════════
   Design v4 — 圆体 & 便利贴
   rounded display type · sticky-note tilt ·
   「即刻开始」hero CTA
   ═══════════════════════════════════════════ */
:root {
  /* ZCOOL QingKe HuangYou: full simplified-Chinese rounded face,
     served sliced by Google Fonts → works on iOS Safari */
  --round: "ZCOOL QingKe HuangYou", "Zen Maru Gothic", "Yuanti SC", "YouYuan", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ─── Rounded display type everywhere it smiles ─── */
h1 {
  font-family: var(--round);
  font-weight: 400;
  font-size: 58px;
}
h1 em {
  font-family: var(--round);
  font-style: italic;
  font-weight: 400;
}
h2 {
  font-family: var(--round);
  font-weight: 400;
  letter-spacing: .03em;
}
.choice-card h3 {
  font-family: var(--round);
  font-weight: 400;
  letter-spacing: .06em;
}
.recipe-body h3 {
  font-family: var(--round);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: .03em;
}
.qa-text strong,
.shop-group-title,
.freestyle-section-label,
.selected-panel h3,
.primary-action,
.add-shop-btn,
.hero-sticker {
  font-family: var(--round);
  font-weight: 400;
}
.detail-meta h2 { font-size: 40px; }
.hero-sticker { font-size: 13.5px; letter-spacing: .1em; }

/* ─── Sticky-note quick actions ─── */
.quick-actions { padding-top: 6px; }
.qa-btn {
  animation-name: fadeUpTilt;
  transform: rotate(var(--tilt, 0deg));
}
.qa-freestyle { --tilt: -1.3deg; }
.qa-fav   { --tilt: -2.2deg; }
.qa-shop  { --tilt: 1.9deg; }
.qa-tools { --tilt: -1.5deg; }
@media (hover: hover) {
  .qa-btn:hover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow: 4px 6px 0 rgba(22, 20, 15, .14);
  }
}

/* translucent washi-tape strip on the three small notes */
.qa-row-3 { margin-top: 10px; }
.qa-row-3 .qa-compact { overflow: visible; }
.qa-row-3 .qa-compact::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 38px;
  height: 13px;
  background: rgba(255, 253, 244, .6);
  box-shadow: 0 1px 2px rgba(22, 20, 15, .08);
  transform: translateX(-50%) rotate(-3deg);
  border-radius: 2px;
  pointer-events: none;
}
.qa-shop.qa-compact::before { transform: translateX(-50%) rotate(4deg); }

/* ─── 「即刻开始」hero CTA: the loudest sticker on the board ─── */
.qa-freestyle {
  padding: 21px 20px;
  border: 2.5px solid var(--ink);
  box-shadow: 5px 6px 0 rgba(22, 20, 15, .85);
}
.qa-freestyle .qa-text strong {
  font-size: 23px;
  letter-spacing: .05em;
}
.qa-freestyle .qa-text small {
  font-size: 11px;
  font-weight: 600;
}
.qa-freestyle .qa-icon svg { width: 30px; height: 30px; }
.qa-freestyle .qa-arrow {
  width: 40px;
  height: 40px;
  padding: 10px;
  box-shadow: 0 0 0 0 rgba(22,20,15,.3);
}
.qa-freestyle:active { transform: rotate(var(--tilt)) scale(.97); }
@media (hover: hover) {
  .qa-freestyle:hover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow: 7px 9px 0 rgba(22, 20, 15, .85);
  }
  .qa-freestyle:hover .qa-arrow { transform: translateX(4px) rotate(-12deg); }
}
.qa-freestyle .qa-arrow { transition: transform .35s var(--spring); }
body.dark-mode .qa-freestyle {
  border-color: #16140f;
  box-shadow: 5px 6px 0 rgba(0, 0, 0, .55);
}

/* dark mode: tape stays translucent paper */
body.dark-mode .qa-row-3 .qa-compact::before {
  background: rgba(255, 253, 244, .38);
}

/* ═══════════════════════════════════════════
   Design v8 — Settings page · gear FAB ·
   toggle switch · language segment
   ═══════════════════════════════════════════ */
.settings-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 30;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 2px 12px rgba(22, 20, 15, .14);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .4s var(--spring), box-shadow .3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.settings-fab:active { transform: scale(.9) rotate(40deg); }
@media (hover: hover) { .settings-fab:hover { transform: rotate(35deg); box-shadow: 0 4px 18px rgba(22,20,15,.2); } }
.settings-fab svg {
  width: 21px;
  height: 21px;
  stroke: var(--ink-2);
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.dark-mode .settings-fab { box-shadow: 0 2px 12px rgba(0,0,0,.4); }
@supports (padding-top: env(safe-area-inset-top)) {
  .settings-fab { bottom: calc(24px + env(safe-area-inset-bottom)); }
}

#settingsContent { display: flex; flex-direction: column; gap: 22px; }
.settings-section { display: flex; flex-direction: column; gap: 10px; }
.settings-card {
  background: var(--card);
  border-radius: 20px;
  padding: 4px 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.05);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
}
.settings-row-text { display: flex; flex-direction: column; gap: 3px; }
.settings-row-text strong {
  font-family: var(--round);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
}
.settings-row-text small { font-size: 11.5px; color: var(--ink-3); }

/* Toggle switch */
.toggle-switch {
  flex-shrink: 0;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  position: relative;
  cursor: pointer;
  transition: background .3s var(--ease), border-color .3s;
}
.toggle-switch.is-on { background: var(--matcha); border-color: var(--matcha); }
.toggle-knob {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: left .28s var(--spring);
}
.toggle-switch.is-on .toggle-knob { left: 23px; }

/* Language segmented control */
.lang-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 14px 0;
}
.lang-opt {
  padding: 11px;
  border-radius: 12px;
  border: 1.5px solid var(--line-2);
  background: transparent;
  font-family: var(--round);
  font-weight: 400;
  font-size: 15px;
  color: var(--ink-2);
  cursor: pointer;
  transition: .2s var(--ease);
}
.lang-opt:active { transform: scale(.96); }
.lang-opt.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.settings-about {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
}
.settings-about strong { font-family: var(--round); font-weight: 400; font-size: 16px; }
.settings-about small { font-size: 12px; color: var(--ink-3); }

/* ═══════════════════════════════════════════
   Design v9 — 首页层级：菜系降级为安静的小卡
   ═══════════════════════════════════════════ */
.home-browse-label {
  margin: 12px 0 0;
  font-family: var(--serif-i);
  font-style: italic;
  font-size: 14.5px;
  letter-spacing: .03em;
  color: var(--ink-3);
  animation: fadeUp .6s var(--ease) backwards .56s;
}
.cuisine-mini-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.cuisine-mini {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 8px 13px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  overflow: visible;
  transform: rotate(var(--tilt, 0deg));
  animation: fadeUpTilt .5s var(--ease) backwards;
  animation-delay: var(--delay, 0s);
  transition: transform .3s var(--spring), box-shadow .3s var(--ease);
  box-shadow: 0 1px 2px rgba(22, 20, 15, .05), 0 5px 14px rgba(22, 20, 15, .08);
}
/* 三张贴纸：中式·陶土红 / 日式·樱粉 / 西式·天蓝，各自微倾 */
.cuisine-mini:nth-child(1) { --tilt: -1.8deg; background: #f6cdb7; }
.cuisine-mini:nth-child(2) { --tilt: 1.5deg;  background: #f9d6e8; }
.cuisine-mini:nth-child(3) { --tilt: -1.2deg; background: #c9e0f8; }

/* 和纸胶带，与上排便利贴同款 */
.cuisine-mini::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 34px;
  height: 12px;
  background: rgba(255, 253, 244, .6);
  box-shadow: 0 1px 2px rgba(22, 20, 15, .08);
  transform: translateX(-50%) rotate(-3deg);
  border-radius: 2px;
  pointer-events: none;
}
.cuisine-mini:nth-child(2)::before { transform: translateX(-50%) rotate(4deg); }
.cuisine-mini:nth-child(3)::before { transform: translateX(-50%) rotate(-2deg); }

.cuisine-mini .cm-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--image, var(--card-2));
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(22, 20, 15, .1), 0 2px 6px rgba(22, 20, 15, .14);
}
.cuisine-mini strong {
  font-family: var(--round);
  font-weight: 400;
  font-size: 14.5px;
  color: #16140f;
  line-height: 1;
}
.cuisine-mini small {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .14em;
  color: rgba(22, 20, 15, .45);
}
.cuisine-mini:active {
  transform: rotate(0deg) scale(.93);
  transition-duration: .15s;
}
@media (hover: hover) {
  .cuisine-mini:hover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow: 4px 6px 0 rgba(22, 20, 15, .12);
  }
}
body.dark-mode .cuisine-mini::before { background: rgba(255, 253, 244, .38); }

/* ═══════════════════════════════════════════
   Design v10 — 极简首页：次要功能折叠
   两个决策（今日PICK + 即刻烹饪），其余收进小纸条
   ═══════════════════════════════════════════ */
.more-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px auto 0;
  padding: 9px 20px;
  border: 1.5px dashed var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .05em;
  cursor: pointer;
  animation: fadeUp .5s var(--ease) backwards .5s;
  transition: color .2s, border-color .2s, transform .2s var(--spring);
}
.more-toggle:active { transform: scale(.94); }
@media (hover: hover) {
  .more-toggle:hover { color: var(--ink-2); border-color: var(--ink-4); }
}
.more-toggle .chev { transition: transform .35s var(--spring); }
.is-more-open .more-toggle .chev { transform: rotate(180deg); }
.more-toggle .mt-badge {
  position: static;
  margin-left: 2px;
  animation: none;
}

.more-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease);
}
.more-panel-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px; /* room for the washi tapes poking above the notes */
}
.is-more-open .more-panel { grid-template-rows: 1fr; }
.more-panel-inner > * {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .4s var(--ease);
}
.is-more-open .more-panel-inner > * { opacity: 1; transform: none; }
.is-more-open .more-panel-inner > *:nth-child(2) { transition-delay: .06s; }
.is-more-open .more-panel-inner > *:nth-child(3) { transition-delay: .1s; }
.more-panel-inner .home-browse-label { margin-top: 16px; animation: none; }
.more-panel-inner .cuisine-mini-row { padding-top: 8px; }

/* ═══════════════════════════════════════════
   Design v11 — 调料架 (pantry) onboarding & integration
   ═══════════════════════════════════════════ */
.pantry-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(22, 20, 15, 0);
  transition: background .35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.pantry-sheet-overlay.is-open { background: rgba(22, 20, 15, .42); }
.pantry-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .25);
  transform: translateY(100%);
  transition: transform .42s var(--ease);
  padding-bottom: env(safe-area-inset-bottom);
}
.pantry-sheet-overlay.is-open .pantry-sheet { transform: translateY(0); }
.pantry-grab {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--ink-4);
  margin: 12px auto 4px;
  flex-shrink: 0;
}
.pantry-head { padding: 8px 24px 14px; flex-shrink: 0; }
.pantry-head h3 {
  margin: 0 0 6px;
  font-family: var(--round);
  font-weight: 400;
  font-size: 24px;
  color: var(--ink);
}
.pantry-head p { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.pantry-body { overflow-y: auto; padding: 4px 24px 8px; flex: 1; }
.pantry-group { margin-bottom: 18px; }
.pantry-group-head {
  font-family: var(--serif-i);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.pantry-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pantry-chip {
  padding: 9px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--line-2);
  background: var(--card);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: transform .2s var(--spring), background .2s, border-color .2s, color .2s;
}
.pantry-chip:active { transform: scale(.9); }
.pantry-chip.is-on {
  background: var(--matcha);
  border-color: var(--matcha);
  color: #fff;
  font-weight: 600;
}
.pantry-chip.is-on::before { content: "✓ "; font-weight: 700; }
.pantry-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--bg);
}
.pantry-skip {
  flex-shrink: 0;
  padding: 13px 18px;
  border-radius: 999px;
  background: none;
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
}
.pantry-skip:active { color: var(--ink); }
.pantry-save {
  flex: 1;
  padding: 14px;
  border-radius: 999px;
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--round);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .2s var(--spring), opacity .2s;
}
.pantry-save:active { transform: scale(.97); opacity: .9; }

/* Settings row as a button (pantry entry) */
.settings-row-btn { width: 100%; background: none; border: none; cursor: pointer; text-align: left; font: inherit; }
.settings-icon { font-size: 22px; flex-shrink: 0; }

/* Detail page: owned seasonings de-emphasized + ✓; section stat tag */
.seas-stat {
  margin-left: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ume);
  text-transform: none;
}
.seas-stat.all-owned { color: var(--matcha-deep); }
.seasoning-row.is-owned .seasoning-name { color: var(--ink-3); }
.seas-check { color: var(--matcha); font-weight: 700; margin-right: 5px; }
.seas-have {
  font-size: 11px;
  font-weight: 600;
  color: var(--matcha);
  letter-spacing: .02em;
}
body.dark-mode .seas-stat.all-owned, body.dark-mode .seas-check, body.dark-mode .seas-have { color: var(--matcha); }

/* English mode: rounded display face doesn't cover latin — fall back to a clean sans */
body.lang-en h1, body.lang-en h2,
body.lang-en .choice-card h3, body.lang-en .recipe-body h3,
body.lang-en .qa-text strong, body.lang-en .shop-group-title,
body.lang-en .detail-meta h2, body.lang-en .settings-row-text strong,
body.lang-en .lang-opt, body.lang-en .settings-about strong,
body.lang-en .hero-sticker .hp-dish {
  font-family: "Zen Maru Gothic", "Inter", system-ui, sans-serif;
  font-weight: 700;
}
body.lang-en h1 { letter-spacing: -.01em; }
body.lang-en h1 em { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; }

/* ═══════════════════════════════════════════
   Design v5 — 按压反馈 (touch press states)
   hover 的趣味全部搬到 :active：
   按下快、松手慢的弹性手感
   ═══════════════════════════════════════════ */

/* ─── Cuisine / time cards: press = squeeze + photo zoom ─── */
.choice-card:active {
  transform: rotate(var(--tilt, 0deg)) scale(.97);
  transition-duration: .15s;
}
.choice-card:active::before {
  transform: scale(1.06);
  transition-duration: .3s;
}

/* ─── Recipe cards: press = squeeze + photo zoom + arrow slide ─── */
.recipe-card:active {
  transform: scale(.975);
  transition-duration: .15s;
}
.recipe-card:active .recipe-image {
  transform: scale(1.05);
  transition-duration: .3s;
}
.recipe-card:active .recipe-card-arrow svg {
  transform: translateX(5px);
  transition-duration: .2s;
}

/* ─── Sticky-note tiles: press = flatten against the page ─── */
.qa-btn:active {
  transform: rotate(0deg) scale(.95);
  transition-duration: .15s;
}
.qa-btn:active .qa-icon {
  transform: scale(1.15) rotate(-6deg);
  transition-duration: .2s;
}

/* 「即刻开始烹饪」: shadow compresses like a sticker pushed flat */
.qa-freestyle:active {
  transform: rotate(0deg) scale(.97) translate(2px, 3px);
  box-shadow: 1px 2px 0 rgba(22, 20, 15, .85);
  transition-duration: .15s;
}
.qa-freestyle:active .qa-arrow {
  transform: translateX(5px) rotate(-14deg);
  transition-duration: .2s;
}
body.dark-mode .qa-freestyle:active {
  box-shadow: 1px 2px 0 rgba(0, 0, 0, .55);
}

/* ─── Tool cards: press = photo zoom ─── */
.tool-card:active {
  transform: scale(.97);
  transition-duration: .15s;
}
.tool-card:active .tool-card-image img {
  transform: scale(1.07);
  transition-duration: .3s;
}

/* ─── Shopping list: check circle squeezes under the finger ─── */
.shop-item:active .shop-check {
  transform: scale(.8);
  transition-duration: .15s;
}
.shop-check { transition: background .3s var(--spring), border-color .25s, color .2s, transform .25s var(--spring); }

/* ─── Filter tags / small buttons: quick dip ─── */
.filter-tag:active { transform: scale(.92); transition-duration: .12s; }
.small-button:active { transform: scale(.92); transition-duration: .12s; }

/* ═══════════════════════════════════════════
   Design v6 — 即兴公式卡 (formula engine)
   ═══════════════════════════════════════════ */
.formula-card {
  border: 2.5px dashed var(--ink);
  box-shadow: 5px 6px 0 rgba(22, 20, 15, .12);
}
.formula-card .recipe-image { height: 170px; }
.formula-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}
.fsl-spark {
  width: auto;
  height: auto;
  background: none;
  font-size: 13px;
}
.formula-card:active {
  transform: scale(.975) translate(2px, 2px);
  box-shadow: 2px 3px 0 rgba(22, 20, 15, .12);
  transition-duration: .15s;
}
body.dark-mode .formula-card { border-color: var(--ink); }

/* ═══════════════════════════════════════════
   Design v7 — 便利贴统一 · 今日PICK · 3D 倾斜
   ═══════════════════════════════════════════ */

/* ─── 「即刻开始烹饪」也变成便利贴（去描边硬影，贴胶带） ─── */
.qa-freestyle {
  border: none;
  overflow: visible;
  box-shadow: 0 1px 2px rgba(22, 20, 15, .06), 0 8px 22px rgba(22, 20, 15, .12);
}
.qa-freestyle::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 58px;
  height: 16px;
  background: rgba(255, 253, 244, .6);
  box-shadow: 0 1px 2px rgba(22, 20, 15, .08);
  transform: translateX(-50%) rotate(2deg);
  border-radius: 2px;
  pointer-events: none;
}
@media (hover: hover) {
  .qa-freestyle:hover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow: 0 2px 4px rgba(22, 20, 15, .06), 0 14px 30px rgba(22, 20, 15, .16);
  }
}
.qa-freestyle:active {
  transform: rotate(0deg) scale(.97);
  box-shadow: 0 1px 3px rgba(22, 20, 15, .1);
  transition-duration: .15s;
}
body.dark-mode .qa-freestyle {
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px rgba(0, 0, 0, .35);
}
body.dark-mode .qa-freestyle::before { background: rgba(255, 253, 244, .38); }
body.dark-mode .qa-freestyle:active { box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }

/* ─── 今日 PICK!：从装饰变成每日推荐按钮 ─── */
.hero-sticker {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 14px;
  transition: transform .25s var(--spring);
}
.hero-sticker .hp-top {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  color: rgba(22, 20, 15, .65);
  font-family: var(--sans);
}
.hero-sticker .hp-dish {
  font-family: var(--round);
  font-size: 13.5px;
  line-height: 1.2;
  color: #16140f;
  max-width: 66px;
  text-align: center;
}
.hero-sticker:active { transform: rotate(-4deg) scale(.88) !important; }
