:root {
  --cream: #fff6e9;
  --paper: rgba(255, 252, 244, 0.86);
  --paper-strong: rgba(255, 252, 244, 0.98);
  --ink: #49372d;
  --muted: #947e70;
  --tomato: #ff6f5f;
  --avocado: #73b86d;
  --egg: #ffd765;
  --orange: #ffad62;
  --mint: #cce8ca;
  --line: rgba(114, 78, 45, 0.14);
  --shadow: 0 24px 70px rgba(119, 76, 38, 0.16);
  --radius: 26px;
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 111, 95, 0.22), transparent 23rem),
    radial-gradient(circle at 86% 14%, rgba(115, 184, 109, 0.24), transparent 24rem),
    radial-gradient(circle at 50% 100%, rgba(255, 215, 101, 0.22), transparent 30rem),
    linear-gradient(145deg, #fff9ed 0%, #fff1df 48%, #f1faec 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.kitchen-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob,
.doodle {
  position: absolute;
  opacity: 0.72;
  animation: floaty 9s ease-in-out infinite alternate;
}

.blob {
  border-radius: 38% 62% 54% 46%;
  filter: blur(1px);
}

.blob-tomato {
  left: 7%;
  top: 18%;
  width: 150px;
  height: 130px;
  background: rgba(255, 111, 95, 0.18);
}

.blob-avocado {
  right: 8%;
  top: 24%;
  width: 130px;
  height: 152px;
  background: rgba(115, 184, 109, 0.18);
  animation-delay: 1.2s;
}

.blob-egg {
  left: 44%;
  bottom: 6%;
  width: 160px;
  height: 118px;
  background: rgba(255, 215, 101, 0.18);
  animation-delay: 2s;
}

.doodle {
  color: rgba(255, 111, 95, 0.46);
  font-size: 22px;
}

.doodle-1 { left: 20%; top: 72%; }
.doodle-2 { right: 24%; top: 11%; color: rgba(115, 184, 109, 0.52); animation-delay: 1.6s; }
.doodle-3 { right: 12%; bottom: 19%; color: rgba(255, 163, 80, 0.56); animation-delay: 2.4s; }

@keyframes floaty {
  from { transform: translate3d(0, 0, 0) rotate(-2deg); }
  to { transform: translate3d(18px, -18px, 0) rotate(3deg); }
}

.topbar,
.app-shell,
.footer {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 42px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0 10px;
}

.brand,
.nav button,
.primary-btn,
.secondary-btn,
.ghost-btn,
.back-link,
.ingredient-chip,
.quick-chips button,
.filter-chips button,
.save-btn,
.menu-btn,
.recent-item {
  border: 0;
  cursor: pointer;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 111, 95, 0.18);
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.72);
  box-shadow: var(--shadow);
  font-size: 24px;
}

.brand strong,
.brand em {
  display: block;
  text-align: left;
}

.brand strong {
  font-size: 18px;
}

.brand em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(16px);
}

.nav button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav button:hover,
.nav button.is-active {
  color: var(--ink);
  background: rgba(255, 111, 95, 0.12);
}

.app-shell {
  padding: 22px 0 56px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screenIn 420ms ease both;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: stretch;
}

.hero-copy,
.fridge-note,
.input-card,
.feature-grid article,
.search-snapshot,
.recipe-card,
.detail-shell,
.meal-combo > article,
.pantry-card,
.case-hero,
.case-grid article,
.empty-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.hero-copy {
  min-height: 210px;
  padding: 30px 38px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #dd654f;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.screen-head h1,
.case-hero h1 {
  margin: 0;
  color: #5f3b2c;
  font-size: clamp(38px, 6.5vw, 68px);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero h2 {
  position: relative;
  display: inline-block;
  width: max-content;
  margin: 8px 0 14px;
  padding: 9px 20px 12px;
  border: 2px solid rgba(255, 190, 130, 0.45);
  border-radius: 28px;
  color: #6b3f2e;
  background:
    radial-gradient(circle at 16% 22%, rgba(255, 255, 255, 0.86), transparent 32%),
    linear-gradient(145deg, #fff9dc, #ffe9a8 56%, #fff3cd);
  filter: drop-shadow(0 12px 18px rgba(119, 76, 38, 0.11));
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 34px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(107, 63, 46, 0.1);
  box-shadow:
    inset 0 -9px 0 rgba(255, 207, 112, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 32px rgba(119, 76, 38, 0.12);
}

.hero h2::before,
.hero h2::after {
  position: absolute;
  top: -18px;
  color: #ff7b62;
  font-size: 24px;
  text-shadow: 0 6px 14px rgba(255, 111, 95, 0.18);
}

.hero h2::before {
  content: "🍅";
  left: -16px;
  transform: rotate(-14deg);
}

.hero h2::after {
  content: "🥚";
  right: -16px;
  transform: rotate(12deg);
}

.hero p,
.screen-head p,
.feature-grid p,
.recipe-card p,
.search-snapshot,
.detail-shell p,
.meal-combo,
.pantry-card,
.case-grid p,
.case-hero p,
.footer {
  color: var(--muted);
  line-height: 1.68;
}

.hero-copy > p:last-child {
  max-width: 560px;
  margin: 0;
  font-size: 19px;
}

.fridge-note {
  position: relative;
  display: grid;
  place-content: center;
  gap: 20px;
  min-height: 210px;
  padding: 22px;
  overflow: hidden;
}

.fridge-note::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 2px dashed rgba(255, 111, 95, 0.22);
  border-radius: 26px;
  transform: rotate(-2deg);
}

.fridge-note span {
  position: relative;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto;
  border-radius: 32px;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.96), transparent 34%),
    linear-gradient(145deg, #ffddd5, #ffe492 52%, #bde4a7);
  box-shadow: 0 24px 44px rgba(132, 83, 38, 0.18);
  font-size: 42px;
  animation: noteBob 3.4s ease-in-out infinite alternate;
}

.fridge-note strong {
  position: relative;
  color: #5f3b2c;
  font-size: 20px;
  line-height: 1.35;
  text-align: center;
}

@keyframes noteBob {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-10px) rotate(2deg); }
}

.input-card {
  margin-top: 14px;
  padding: 21px;
}

.input-head,
.panel-head,
.combo-head,
.recipe-top,
.card-actions,
.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.input-head,
.panel-head,
.combo-head,
.recipe-top {
  justify-content: space-between;
}

h2,
h3 {
  margin: 0;
  color: #5f3b2c;
  letter-spacing: 0;
}

.input-head h3,
.search-snapshot h2,
.combo-head h2,
.pantry-card h2,
.section-mini-head h2 {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 12px 7px;
  border: 1px solid rgba(255, 190, 130, 0.38);
  border-radius: 16px;
  color: #6b3f2e;
  background: rgba(255, 247, 216, 0.72);
  box-shadow: inset 0 -6px 0 rgba(255, 216, 118, 0.2);
  font-weight: 900;
}

.screen-head h1 {
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.58);
}

.input-head p,
.screen-head p {
  margin: 8px 0 0;
}

.ingredient-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.ingredient-input-row.compact {
  margin-top: 12px;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus {
  border-color: rgba(255, 111, 95, 0.42);
  box-shadow: 0 0 0 4px rgba(255, 111, 95, 0.1);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.save-btn,
.menu-btn,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-btn {
  color: #fffaf2;
  background: linear-gradient(135deg, var(--tomato), #ff9c5a);
  box-shadow: 0 16px 30px rgba(255, 111, 95, 0.22);
}

.secondary-btn,
.save-btn,
.menu-btn {
  border: 1px solid rgba(255, 111, 95, 0.2);
  color: #6b4433;
  background: rgba(255, 255, 255, 0.65);
}

.ghost-btn,
.back-link {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.34);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.save-btn:hover,
.menu-btn:hover,
.back-link:hover {
  transform: translateY(-2px);
}

.find-btn {
  width: 100%;
  margin-top: 18px;
  min-height: 52px;
}

.full {
  width: 100%;
}

.quick-zone,
.combo-zone {
  margin-top: 16px;
}

.mini-title {
  margin: 0 0 10px;
  color: #74584b;
  font-size: 13px;
  font-weight: 860;
}

.selected-chips,
.quick-chips,
.filter-chips,
.combo-chips,
.snapshot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.selected-chips {
  min-height: 42px;
  margin-top: 12px;
}

.ingredient-chip,
.quick-chips button,
.filter-chips button,
.combo-chips button,
.snapshot-chips span,
.tag-row i,
.reason-list span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border-radius: 999px;
  white-space: nowrap;
}

.ingredient-chip {
  padding: 0 10px 0 14px;
  color: #613b2d;
  background: #fff5ce;
  box-shadow: inset 0 0 0 1px rgba(255, 173, 98, 0.2);
}

.ingredient-chip i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: rgba(95, 59, 44, 0.7);
  background: rgba(255, 255, 255, 0.64);
  font-style: normal;
}

.pop-in {
  animation: chipPop 240ms cubic-bezier(.2, 1.35, .45, 1) both;
}

@keyframes chipPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.quick-chips button,
.filter-chips button,
.combo-chips button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(114, 78, 45, 0.12);
  color: #6f5547;
  background: rgba(255, 255, 255, 0.58);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.quick-chips button:hover,
.filter-chips button:hover,
.combo-chips button:hover,
.quick-chips button.is-active,
.filter-chips button.is-active,
.combo-chips button.is-active {
  transform: translateY(-2px);
  border-color: rgba(255, 111, 95, 0.26);
  background: rgba(255, 233, 179, 0.7);
}

.combo-chips button {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(255, 225, 122, 0.3)),
    rgba(255, 255, 255, 0.5);
}

.soft-disclosure {
  margin-top: 12px;
  border: 1px solid rgba(114, 78, 45, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.34);
}

.soft-disclosure summary {
  cursor: pointer;
  padding: 12px 14px;
  color: #7b5a49;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.soft-disclosure summary::-webkit-details-marker {
  display: none;
}

.soft-disclosure summary::after {
  content: "＋";
  float: right;
  color: #dd654f;
}

.soft-disclosure[open] summary::after {
  content: "－";
}

.soft-disclosure > .combo-chips,
.preference-panel > .filter-chips {
  padding: 0 14px 14px;
}

.ingredient-drawer {
  padding-bottom: 14px;
}

.ingredient-drawer .panel-head,
.category-tabs,
.ingredient-drawer .search-results,
.ingredient-drawer .category-panel {
  padding-inline: 14px;
}

.compact-head {
  margin-top: 2px;
}

.tiny-search {
  width: min(320px, 100%);
  min-height: 40px;
  border-radius: 999px;
  font-size: 13px;
}

.category-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.category-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(114, 78, 45, 0.12);
  border-radius: 999px;
  color: #7b5a49;
  background: rgba(255, 255, 255, 0.48);
  font-weight: 850;
  cursor: pointer;
}

.category-tabs button.is-active {
  color: #fffaf2;
  border-color: rgba(255, 111, 95, 0.08);
  background: linear-gradient(135deg, #ff856f, #ffb66d);
}

.category-panel details {
  border: 1px solid rgba(114, 78, 45, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.44);
  overflow: hidden;
}

.category-panel summary {
  cursor: pointer;
  padding: 13px 16px;
  color: #6a4a34;
  font-weight: 900;
}

.category-panel details .quick-chips {
  padding: 0 16px 16px;
}

.category-panel > .quick-chips {
  padding-top: 2px;
}

.search-results {
  margin-top: 10px;
}

.search-label {
  flex: 0 0 100%;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.empty-inline {
  margin: 0;
  color: rgba(148, 126, 112, 0.78);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.feature-grid article {
  padding: 22px;
}

.feature-grid span {
  font-size: 28px;
}

.feature-grid h3 {
  margin-top: 12px;
}

.screen-head {
  margin-bottom: 20px;
  text-align: center;
}

.result-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.search-snapshot,
.pantry-card {
  padding: 22px;
}

.search-snapshot {
  position: sticky;
  top: 18px;
  align-self: start;
}

.search-snapshot h2,
.search-snapshot h3 {
  margin-bottom: 10px;
}

.search-snapshot h3 {
  margin-top: 20px;
  font-size: 15px;
}

.snapshot-chips span,
.tag-row i,
.reason-list span {
  padding: 0 10px;
  color: #735141;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(114, 78, 45, 0.12);
  font-size: 12px;
}

.snapshot-chips.success span {
  color: #3b7545;
  background: rgba(207, 237, 199, 0.72);
}

.snapshot-chips.warn span {
  color: #a85d39;
  background: rgba(255, 224, 185, 0.72);
}

.recipe-grid {
  display: grid;
  gap: 20px;
}

.result-section {
  display: grid;
  gap: 14px;
}

.section-mini-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.section-mini-head h2 {
  font-size: 24px;
}

.section-mini-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.section-mini-head > span {
  align-self: center;
  min-width: max-content;
  padding: 7px 10px;
  border-radius: 999px;
  color: #735141;
  background: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  font-weight: 800;
}

.recipe-grid-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.recipe-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.recipe-card:hover,
.pantry-card:hover,
.feature-grid article:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 111, 95, 0.24);
  box-shadow: var(--shadow), 0 0 26px rgba(255, 173, 98, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.reveal {
  animation: cardReveal 420ms ease both;
  animation-delay: var(--delay, 0ms);
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.recipe-emoji,
.detail-icon,
.recipe-art {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.95), transparent 32%),
    linear-gradient(145deg, #ffe2be, #fff19a 48%, #cce8ca);
  box-shadow: 0 14px 28px rgba(119, 76, 38, 0.14);
  font-size: 30px;
}

.recipe-art {
  position: relative;
  width: 74px;
  height: 60px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.92), transparent 23%),
    radial-gradient(circle at 82% 80%, rgba(115, 184, 109, 0.36), transparent 38%),
    linear-gradient(145deg, #ffd8c4, #fff29d 56%, #cdf1d0);
}

.recipe-art span {
  font-size: 30px;
}

.recipe-art i {
  position: absolute;
  right: 8px;
  bottom: 7px;
  max-width: 74px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #6a4a34;
  background: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-style: normal;
}

.match-badge {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 111, 95, 0.18);
  border-radius: 20px;
  color: #6b3f2e;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.88), transparent 36%),
    linear-gradient(145deg, rgba(255, 244, 204, 0.94), rgba(255, 218, 148, 0.76));
  box-shadow: 0 12px 24px rgba(119, 76, 38, 0.12);
  font-weight: 900;
}

.recipe-card h2 {
  font-size: 22px;
}

.recipe-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.recipe-title-copy {
  min-width: 0;
}

.recipe-title-copy h2 {
  margin-top: 7px;
}

.card-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.course-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.course-pill {
  color: #7b5a49;
  background: rgba(255, 255, 255, 0.56);
}

.status-pill.ready {
  color: #3e7548;
  background: rgba(214, 241, 202, 0.7);
}

.status-pill.key {
  color: #b16128;
  background: rgba(255, 228, 188, 0.78);
}

.status-pill.almost,
.status-pill.side {
  color: #875d41;
  background: rgba(255, 246, 218, 0.76);
}

.recipe-copy,
.reason-copy {
  margin: 0;
}

.ingredient-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(114, 78, 45, 0.08);
  border-radius: 18px;
  background: rgba(255, 250, 232, 0.58);
}

.ingredient-summary strong {
  display: block;
  color: #7b5a49;
  font-size: 12px;
}

.ingredient-summary p {
  margin: 4px 0 0;
  color: #5f3b2c;
  font-size: 13px;
  line-height: 1.45;
}

.reason-copy {
  color: #735141;
  font-size: 13px;
}

.meta-row span {
  padding: 7px 10px;
  border-radius: 999px;
  color: #74584b;
  background: rgba(255, 255, 255, 0.52);
  font-size: 12px;
}

.ingredient-block {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.ingredient-block strong {
  display: block;
  margin-bottom: 4px;
  color: #5f3b2c;
  font-size: 12px;
}

.ingredient-block p {
  margin: 0;
}

.ingredient-block.missing {
  background: rgba(255, 235, 205, 0.62);
}

.ingredient-block.success {
  background: rgba(216, 241, 207, 0.58);
}

.ingredient-block.danger {
  background: rgba(255, 214, 204, 0.6);
}

.ingredient-block.seasoning {
  background: rgba(255, 247, 216, 0.58);
}

.reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.card-actions {
  margin-top: auto;
}

.menu-btn.is-added {
  color: #fffaf2;
  border-color: rgba(115, 184, 109, 0.2);
  background: linear-gradient(135deg, #73b86d, #93c56d);
}

.match-details,
.more-results {
  border: 1px solid rgba(114, 78, 45, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.34);
}

.match-details summary,
.more-results summary {
  cursor: pointer;
  padding: 11px 13px;
  color: #8b634f;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.match-details summary::-webkit-details-marker,
.more-results summary::-webkit-details-marker {
  display: none;
}

.match-details summary::after,
.more-results summary::after {
  content: "展开";
  float: right;
  color: #dd654f;
}

.match-details[open] summary::after,
.more-results[open] summary::after {
  content: "收起";
}

.detail-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 13px 13px;
}

.detail-chip-grid div {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
}

.detail-chip-grid strong {
  display: block;
  margin-bottom: 6px;
  color: #6b4433;
  font-size: 12px;
}

.detail-chip-grid p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.detail-chip-grid span,
.detail-chip-grid em {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: #735141;
  background: rgba(255, 246, 218, 0.78);
  font-size: 11px;
  font-style: normal;
}

.more-results {
  padding: 0;
}

.more-results .recipe-grid-inner {
  padding: 0 0 4px;
}

.source-line {
  margin: -3px 0 0;
  color: rgba(148, 126, 112, 0.82);
  font-size: 12px;
}

.debug-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
  color: #6a4a34;
  font-size: 13px;
  font-weight: 850;
}

.debug-toggle input {
  width: 18px;
  min-height: 18px;
  box-shadow: none;
}

.source-note {
  margin: 14px 0 0;
  color: rgba(148, 126, 112, 0.78);
  font-size: 12px;
}

.card-debug {
  border: 1px dashed rgba(114, 78, 45, 0.18);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.38);
}

.card-debug summary {
  cursor: pointer;
  color: #8b634f;
  font-size: 12px;
  font-weight: 900;
}

.card-debug dl {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 10px 0 0;
  font-size: 12px;
}

.card-debug dt {
  color: #9f7864;
  font-weight: 800;
}

.card-debug dd {
  margin: 0;
  color: #5f3b2c;
}

.debug-section {
  padding-top: 8px;
}

.debug-list {
  display: grid;
  gap: 8px;
}

.debug-list article {
  padding: 12px;
  border: 1px dashed rgba(114, 78, 45, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
}

.debug-list strong,
.debug-list p,
.debug-list code {
  display: block;
}

.debug-list p {
  margin: 4px 0;
}

.debug-list code {
  color: #93624b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.save-btn.is-saved {
  color: #fffaf2;
  background: linear-gradient(135deg, #73b86d, #9bc86f);
}

.back-link {
  margin-bottom: 18px;
}

.detail-shell {
  padding: 24px;
}

.detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.detail-hero h1 {
  margin: 0 0 8px;
  color: #5f3b2c;
  font-size: clamp(34px, 6vw, 58px);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.detail-grid article,
.steps-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.48);
}

.detail-grid article {
  padding: 18px;
}

.steps-card {
  display: grid;
  gap: 20px;
  margin-top: 18px;
  padding: 22px;
}

.steps-card ol {
  margin: 10px 0 0;
  padding-left: 22px;
  color: #765b4e;
  line-height: 1.72;
}

.meal-combo {
  max-width: 980px;
  margin: 0 auto;
}

.combo-card {
  padding: 24px;
}

.combo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.combo-slot {
  min-height: 150px;
  padding: 18px;
  border: 1px solid rgba(114, 78, 45, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 241, 207, 0.52));
}

.combo-slot span,
.combo-slot strong,
.combo-slot em {
  display: block;
}

.combo-slot span {
  color: var(--tomato);
  font-size: 12px;
  font-weight: 900;
}

.combo-slot strong {
  margin-top: 24px;
  color: #5f3b2c;
  font-size: 20px;
  line-height: 1.25;
}

.combo-slot em {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.combo-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.combo-stats span {
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
}

.manual-menu-groups {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.menu-course {
  display: grid;
  gap: 10px;
}

.menu-course h3 {
  width: fit-content;
  padding: 5px 12px 7px;
  border: 1px solid rgba(255, 190, 130, 0.34);
  border-radius: 999px;
  background: rgba(255, 247, 216, 0.7);
  font-size: 16px;
}

.manual-menu-list {
  display: grid;
  gap: 10px;
}

.menu-recipe-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(114, 78, 45, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
}

.menu-recipe-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: rgba(255, 246, 218, 0.78);
  font-size: 24px;
}

.menu-recipe-item strong {
  color: #5f3b2c;
}

.menu-recipe-item p {
  margin: 4px 0 0;
  font-size: 13px;
}

.menu-recipe-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.kitchen-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pantry-card {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.pantry-card.wide {
  grid-column: 1 / -1;
}

.recent-list,
.favorite-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.recent-item,
.favorite-item,
.combo-history {
  width: 100%;
  border: 1px solid rgba(114, 78, 45, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
}

.recent-item {
  display: block;
  padding: 14px;
  text-align: left;
}

.recent-item strong,
.recent-item span {
  display: block;
}

.recent-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.favorite-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.favorite-item > span {
  font-size: 28px;
}

.favorite-item p {
  margin: 4px 0 0;
}

.combo-history {
  padding: 14px;
}

.combo-history strong,
.combo-history p {
  display: block;
  margin: 0;
}

.combo-history p {
  margin-top: 5px;
}

.case-hero {
  padding: 34px;
  text-align: center;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.case-grid article {
  padding: 22px;
}

.case-grid span {
  color: var(--tomato);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.empty-card {
  grid-column: 1 / -1;
  padding: 34px;
  text-align: center;
}

.empty-card > span {
  font-size: 44px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0 34px;
  color: var(--muted);
  font-size: 12px;
}

.footer button {
  border: 0;
  padding: 0;
  color: #dd654f;
  background: transparent;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  min-width: 180px;
  padding: 12px 16px;
  border-radius: 999px;
  color: #fffaf2;
  background: rgba(73, 55, 45, 0.88);
  box-shadow: 0 18px 36px rgba(73, 55, 45, 0.22);
  text-align: center;
  transform: translate(-50%, 18px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 980px) {
  .topbar,
  .app-shell,
  .footer {
    width: min(100% - 28px, 720px);
  }

  .topbar,
  .footer {
    flex-direction: column;
    align-items: stretch;
  }

  .nav {
    justify-content: center;
    border-radius: 22px;
  }

  .hero,
  .result-layout,
  .detail-hero,
  .kitchen-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .fridge-note {
    min-height: auto;
  }

  .hero-copy {
    padding: 34px;
  }

  .fridge-note {
    padding: 28px;
  }

  .recipe-grid,
  .recipe-grid-inner,
  .feature-grid,
  .detail-grid,
  .combo-grid,
  .combo-stats,
  .ingredient-summary,
  .detail-chip-grid,
  .case-grid {
    grid-template-columns: 1fr;
  }

  .search-snapshot {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-top: 18px;
  }

  .hero h1,
  .screen-head h1,
  .case-hero h1 {
    font-size: 46px;
  }

  .hero h2 {
    font-size: 28px;
  }

  .ingredient-input-row,
  .favorite-item,
  .menu-recipe-item,
  .recipe-title-row {
    grid-template-columns: 1fr;
  }

  .menu-recipe-actions,
  .detail-actions {
    justify-content: stretch;
  }

  .menu-recipe-actions button,
  .detail-actions button {
    flex: 1 1 140px;
  }

  .input-card,
  .detail-shell,
  .combo-card,
  .pantry-card,
  .case-hero,
  .case-grid article {
    padding: 20px;
  }
}
