/* 餐桌日常 — warm prototype styles */

:root {
  --bg-page: #f6efe5;
  --bg-section: #fcf8f2;
  --bg-card: #fffdf9;
  --bg-soft: #f3e8d8;
  --text-main: #2f2a24;
  --text-secondary: #6e6257;
  --text-muted: #9a8e82;
  --color-primary: #a56a3a;
  --color-primary-dark: #8b5a2b;
  --color-title: #5b371b;
  --color-line: #d8c9b6;
  --color-green: #5a7a58;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-soft: 0 2px 12px rgba(80, 55, 30, 0.07);
  --shadow-hover: 0 8px 24px rgba(80, 55, 30, 0.11);
  --font-title: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun",
    serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--text-main);
  font-family: var(--font-body);
  /* 单色底，避免多层渐变与 sticky 叠在一起触发持续合成 */
  background: var(--bg-page);
  line-height: 1.65;
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--color-primary-dark);
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}

.site-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 64px;
}

/* Topbar
   注意：不要使用 backdrop-filter。Chrome 对 sticky + 毛玻璃会持续重绘，
   空闲时也会占掉一截 CPU。用不透明底即可。 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-section);
  border-bottom: 1px solid rgba(216, 201, 182, 0.65);
}
.topbar-inner {
  max-width: 1280px;
  height: 72px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 168px;
  color: inherit;
  text-decoration: none;
}
.brand:hover {
  color: inherit;
}
.brand-title {
  font-family: var(--font-title);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-title);
}
.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}
.nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  color: inherit;
  text-decoration: none;
}
.nav a.active,
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
}
.search {
  display: flex;
  align-items: center;
  width: 250px;
  height: 40px;
  padding: 0 14px;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--color-line);
  background: rgba(255, 255, 255, 0.66);
  color: var(--text-muted);
  font-size: 13px;
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: inherit;
}
.search button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
}

/* Hero */
.hero {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) 1.25fr;
  min-height: 420px;
  margin-top: 34px;
  border: 1px solid rgba(216, 201, 182, 0.7);
  border-radius: var(--radius-xl);
  background: linear-gradient(
      90deg,
      rgba(252, 248, 242, 0.98) 0%,
      rgba(252, 248, 242, 0.86) 48%,
      rgba(252, 248, 242, 0.22) 100%
    ),
    var(--bg-section);
  box-shadow: var(--shadow-soft);
}
.hero-copy {
  padding: 56px 0 56px 56px;
  position: relative;
  z-index: 1;
}
.eyebrow {
  color: var(--color-primary);
  font-size: 13px;
  letter-spacing: 0.18em;
  margin-bottom: 12px;
}
.hero h1 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 44px;
  line-height: 1.25;
  color: var(--color-title);
  letter-spacing: 0.04em;
}
.hero p {
  margin: 20px 0 28px;
  max-width: 360px;
  color: var(--text-secondary);
  font-size: 16px;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  color: inherit;
}
.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 5px 14px rgba(165, 106, 58, 0.22);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  color: white;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-line);
}
.btn-secondary:hover {
  background: white;
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}
.hero-image {
  min-height: 420px;
  position: relative;
  background-color: var(--bg-soft);
  background-size: cover;
  background-position: center;
}
.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(252, 248, 242, 0.6),
    rgba(252, 248, 242, 0) 38%
  );
}

/* Sections */
.section {
  margin-top: 34px;
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(216, 201, 182, 0.58);
  background: rgba(255, 253, 249, 0.72);
  box-shadow: var(--shadow-soft);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.section-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 26px;
  color: var(--color-title);
  letter-spacing: 0.04em;
}
.section-desc {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}
.more {
  color: var(--color-primary-dark);
  font-size: 14px;
  white-space: nowrap;
}
.more:hover {
  color: var(--color-primary);
}

/* Recipe cards */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.recipe-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.recipe-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(216, 201, 182, 0.62);
  background: var(--bg-card);
  transition: box-shadow 0.15s ease;
}
.recipe-card:hover {
  box-shadow: var(--shadow-hover);
}
.recipe-card a {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}
.recipe-card a:hover {
  color: inherit;
}
.dish-photo {
  aspect-ratio: 4 / 3;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft);
  border-bottom: 1px solid rgba(216, 201, 182, 0.45);
  overflow: hidden;
}
.dish-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dish-photo.tall {
  aspect-ratio: 3 / 4;
}
.dish-photo.wide {
  aspect-ratio: 16 / 10;
}
.card-body {
  padding: 12px 14px 14px;
}
.dish-title {
  margin: 0 0 4px;
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--color-title);
}
.dish-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* Category cards */
.category-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.category-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 15px;
  border: 1px solid rgba(216, 201, 182, 0.62);
  background: linear-gradient(180deg, #fffdf9, #f8f0e5);
  transition: box-shadow 0.15s ease;
  color: inherit;
  text-decoration: none;
}
.category-card:hover {
  box-shadow: var(--shadow-soft);
  color: inherit;
}
.category-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-soft);
  font-size: 22px;
  flex-shrink: 0;
}
.category-name {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--color-title);
}
.category-count {
  color: var(--text-muted);
  font-size: 12px;
}

/* Category / list hero */
.category-hero {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  margin-top: 34px;
  padding: 34px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(216, 201, 182, 0.62);
  background: linear-gradient(90deg, #fcf8f2, rgba(252, 248, 242, 0.72)),
    var(--bg-section);
  box-shadow: var(--shadow-soft);
  align-items: center;
}
.category-hero h1 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 42px;
  color: var(--color-title);
}
.category-hero p {
  margin: 12px 0 4px;
  color: var(--text-secondary);
  max-width: 520px;
}
.category-cover {
  height: 180px;
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}
.category-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 24px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid rgba(216, 201, 182, 0.72);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.78);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
a.chip:hover,
.chip.active,
.chip:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Detail */
.detail {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 0.95fr);
  gap: 28px;
  align-items: start;
  margin-top: 34px;
}
.detail-photo {
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(216, 201, 182, 0.62);
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
}
.detail-photo .dish-photo {
  aspect-ratio: 4 / 3;
  border-bottom: 0;
}
.detail-info {
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(216, 201, 182, 0.62);
  background: rgba(255, 253, 249, 0.82);
  box-shadow: var(--shadow-soft);
}
.breadcrumb {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 18px;
}
.breadcrumb a:hover {
  color: var(--color-primary);
}
.detail-info h1 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 38px;
  color: var(--color-title);
}
.detail-lead {
  color: var(--text-secondary);
  margin: 12px 0 20px;
}
.recipe-panel {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(216, 201, 182, 0.58);
  background: var(--bg-card);
  margin-top: 16px;
}
.recipe-panel h2 {
  margin: 0 0 12px;
  font-family: var(--font-title);
  font-size: 21px;
  color: var(--color-title);
}
.recipe-panel p,
.recipe-panel li {
  color: var(--text-secondary);
  font-size: 14px;
}
.recipe-panel p:first-child {
  margin-top: 0;
}
.recipe-panel p:last-child {
  margin-bottom: 0;
}

/* Random */
.mixed-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  margin-top: 34px;
  align-items: stretch;
}
.random-feature {
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(216, 201, 182, 0.62);
  background: rgba(255, 253, 249, 0.82);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.random-feature h1 {
  margin: 0;
  font-family: var(--font-title);
  color: var(--color-title);
  font-size: 38px;
}
.random-feature p {
  color: var(--text-secondary);
}
.split-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(216, 201, 182, 0.62);
  background: var(--bg-card);
}
.split-card .dish-photo {
  border-radius: 14px;
  border: 0;
}
#random-card {
  min-height: 280px;
}

.page-block {
  margin-top: 34px;
}
.empty {
  color: var(--text-muted);
  padding: 1rem 0;
}

.footer {
  margin-top: 48px;
  padding: 28px 0 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 1024px) {
  .search {
    display: none;
  }
  .hero,
  .category-hero,
  .detail,
  .mixed-layout {
    grid-template-columns: 1fr;
  }
  .hero-copy {
    padding: 42px 38px 22px;
  }
  .recipe-grid,
  .recipe-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .category-row {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 720px) {
  .site-shell,
  .topbar-inner {
    padding-left: 16px;
    padding-right: 16px;
  }
  .topbar-inner {
    height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .nav {
    width: 100%;
    overflow-x: auto;
    gap: 18px;
    white-space: nowrap;
  }
  .hero h1 {
    font-size: 34px;
  }
  .hero-copy {
    padding: 32px 24px 10px;
  }
  .hero-image {
    min-height: 260px;
  }
  .section {
    padding: 18px;
  }
  .recipe-grid,
  .recipe-grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .category-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .category-hero {
    padding: 24px;
  }
  .category-cover {
    height: 150px;
  }
  .split-card {
    grid-template-columns: 1fr;
  }
  .dish-title {
    font-size: 16px;
  }
  .detail-info h1 {
    font-size: 30px;
  }
  .random-feature h1 {
    font-size: 30px;
  }
}
@media (max-width: 440px) {
  .recipe-grid,
  .recipe-grid.cols-3,
  .category-row {
    grid-template-columns: 1fr;
  }
}
