:root {
  --bg: #fdfbf7;
  --fg: #2c2c2c;
  --muted: #6b6b6b;
  --card: #ffffff;
  --accent: #c45d3e;
  --accent-soft: #f3e2db;
  --border: #e7e0d6;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(253, 251, 247, 0.9);
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
  z-index: 10;
}

.site-title { font-size: 20px; font-weight: 700; color: var(--fg); }
.site-title:hover { text-decoration: none; }
.site-header nav { display: flex; gap: 18px; }
.site-header nav a { color: var(--muted); font-weight: 500; }
.site-header nav a:hover { color: var(--accent); text-decoration: none; }

.container { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; }

/* Home */
.home-top { text-align: center; margin: 12px 0 24px; }
.home-top h1 { font-size: 34px; margin: 0 0 6px; }
.tagline { color: var(--muted); margin: 0; }

.controls { margin-bottom: 20px; }
#search {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
}
#search:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tags .pill { cursor: pointer; }
.tags .pill.active { background: var(--accent); color: #fff; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 820px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.1); text-decoration: none; }
.thumb { aspect-ratio: 16 / 9; background: var(--accent-soft); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.9;
}
.card-body { padding: 14px 16px 16px; }
.card-title { font-size: 17px; margin: 0 0 8px; font-weight: 600; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  display: inline-block;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #8a3d27;
}

.none { text-align: center; color: var(--muted); margin-top: 30px; }

/* Recipe page */
.recipe-title { font-size: 30px; margin: 0 0 10px; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.hero { margin: 0 0 20px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.hero img { width: 100%; display: block; }
.intro { margin-bottom: 8px; }

.block { margin-top: 26px; }
.block-title { font-size: 21px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--accent-soft); }
.block-ingredients .block-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 18px 12px;
}
.block-body ul, .block-body ol { padding-left: 20px; }
.block-body h3, .block-body h4 { margin-top: 18px; }

.callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 10px 14px;
  border-radius: 8px;
  margin: 12px 0;
}
.callout-warning { border-left-color: #d9534f; background: #fbe9e8; }
.callout-tip { border-left-color: #4a9d5f; background: #e8f5ec; }
.callout-note { border-left-color: #4a79c9; background: #e8effa; }

.back { margin-top: 30px; }

.about h1 { font-size: 30px; }
.about p { max-width: 640px; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 24px 16px;
  border-top: 1px solid var(--border);
}