:root {
  color-scheme: light;
  --bg: #f7f2ea;
  --ink: #241f1b;
  --muted: #70675f;
  --line: #ded0bf;
  --panel: #fffaf3;
  --panel-strong: #fff1dc;
  --green: #2f6b4f;
  --green-dark: #214c39;
  --red: #b74738;
  --blue: #245a87;
  --shadow: 0 18px 44px rgba(59, 42, 28, 0.13);
  font-family:
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247, 242, 234, 0.88), rgba(247, 242, 234, 1)),
    url("https://images.unsplash.com/photo-1543353071-873f17a7a088?auto=format&fit=crop&w=1800&q=80") center/cover fixed;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.hero,
.toolbar,
.status-panel,
.recipe-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.96);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  min-height: 210px;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(36, 31, 27, 0.78), rgba(36, 31, 27, 0.16)),
    url("https://images.unsplash.com/photo-1556911220-bff31c812dba?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: #fff;
}

.hero-copy {
  max-width: 640px;
}

.eyebrow,
.subtitle,
.status-label,
.count-text,
.recipe-meta,
.recipe-desc,
.recipe-calories {
  margin: 0;
}

.eyebrow {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0.82;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  margin-top: 8px;
  font-size: 3.2rem;
}

.subtitle {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.primary-action,
.secondary-action,
.open-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.primary-action {
  min-width: 160px;
  background: #fff;
  color: var(--green-dark);
}

.secondary-action {
  width: 100%;
  color: var(--green-dark);
  border: 1px solid #b8cfbf;
  background: #eef7ef;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
}

.toolbar label {
  display: grid;
  gap: 7px;
}

.toolbar label > span,
.status-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fffdf9;
}

.toggle-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(255, 241, 220, 0.96);
}

#statusText {
  margin: 4px 0 0;
  line-height: 1.5;
}

.count-text {
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 800;
}

.results {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.recipe-card {
  overflow: hidden;
  display: flex;
  min-width: 0;
  flex-direction: column;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.recipe-card:hover,
.recipe-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(47, 107, 79, 0.18);
  outline: none;
}

.recipe-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #efe5d6;
}

.recipe-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 13px;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.recipe-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  background: #fffdf9;
}

.recipe-card h2 {
  margin-top: 10px;
  font-size: 1.12rem;
}

.recipe-desc {
  display: -webkit-box;
  overflow: hidden;
  min-height: 4.4em;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.recipe-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.recipe-calories {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 800;
}

.open-button {
  width: 100%;
  min-height: 38px;
  font-size: 0.86rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1040px) {
  .results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .app-shell {
    padding: 12px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 230px;
    padding: 20px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .toolbar,
  .results,
  .status-panel {
    grid-template-columns: 1fr;
  }

  .status-panel {
    display: grid;
  }

  .count-text {
    flex: auto;
  }
}
