/* =========================================================================
   味蕾故事 Taste Story — 复古食谱手账风
   第 4 种独立设计语言：暖米色底 + 牛皮纸卡 + 墨色文字 + 番茄红/胡萝卜橙点缀
   衬线标题(Playfair Display/Noto Serif SC) + 手写装饰体(Caveat/Ma Shan Zheng)
   ========================================================================= */

:root {
  --bg: #faf6ec;
  --bg-soft: #f3ecdc;
  --card: #fdfaf1;
  --kraft: #e8dcc0;
  --kraft-2: #d9c9a3;
  --ink: #3d2f1f;
  --ink-soft: #6b5b45;
  --line: #d8c9a8;
  --accent: #c0392b;
  --accent-2: #e07b39;
  --green: #5b8a4a;
  --shadow: 0 2px 6px rgba(61, 47, 31, 0.08), 0 8px 20px rgba(61, 47, 31, 0.06);
  --shadow-lg: 0 4px 12px rgba(61, 47, 31, 0.12), 0 16px 36px rgba(61, 47, 31, 0.10);
  --radius: 10px;

  --font-display: 'Playfair Display', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --font-hand: 'Caveat', 'Ma Shan Zheng', 'KaiTi', cursive;
  --font-body: 'Noto Serif SC', Georgia, 'Times New Roman', serif;
}

html[data-theme="dark"] {
  --bg: #1f1710;
  --bg-soft: #241b12;
  --card: #2a1f14;
  --kraft: #33271a;
  --kraft-2: #3d2e1e;
  --ink: #efe3cf;
  --ink-soft: #b7a68c;
  --line: #4a3a28;
  --accent: #e0675a;
  --accent-2: #ef9a52;
  --green: #7cb06a;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4), 0 16px 36px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(61, 47, 31, 0.030) 1px, transparent 1.2px),
    radial-gradient(rgba(61, 47, 31, 0.022) 1px, transparent 1.2px);
  background-size: 24px 24px, 24px 24px;
  background-position: 0 0, 12px 12px;
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-theme="dark"] body {
  background-image:
    radial-gradient(rgba(239, 227, 207, 0.025) 1px, transparent 1.2px),
    radial-gradient(rgba(239, 227, 207, 0.018) 1px, transparent 1.2px);
}

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

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

img { max-width: 100%; display: block; }

/* ---- 手写装饰体 ---- */
.hand { font-family: var(--font-hand); font-weight: 600; }
.line-icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; }

/* =========================================================================
   页头
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px dashed var(--line);
  box-shadow: 0 1px 0 rgba(61, 47, 31, 0.04);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--accent);
  font-size: 26px;
  background: var(--bg-soft);
  border: 1.5px dashed var(--accent);
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-hand); font-size: 26px; color: var(--accent); }
.brand-tag { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav > a,
.nav-drop > summary {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  color: var(--ink);
  font-size: 15px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  text-decoration: none;
}
.nav > a:hover,
.nav-drop[open] > summary { background: var(--bg-soft); color: var(--accent); text-decoration: none; }
.nav-drop { position: relative; }
.nav-drop > summary::-webkit-details-marker { display: none; }
.nav-drop > summary::after { content: ' ▾'; font-size: 10px; color: var(--ink-soft); }
.nav-drop-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
}
.nav-drop-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--ink);
  border-radius: 6px;
  text-decoration: none;
}
.nav-drop-menu a:hover { background: var(--bg-soft); color: var(--accent); text-decoration: none; }
.nav-tool-icon { font-size: 20px; color: var(--accent-2); width: 24px; text-align: center; }
.nav-tool-icon .line-icon { width: 22px; height: 22px; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px dashed var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.lang-select {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

/* 广告槽 */
.ad-slot { margin: 16px auto; text-align: center; min-height: 0; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 56px 0 44px;
}
.hero-eyebrow {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--accent-2);
  transform: rotate(-1deg);
}
.hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.hero .sub { font-size: 18px; color: var(--ink-soft); max-width: 52ch; }
.hero-cta { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.cta, .cta-ghost {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.cta {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.28);
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(192, 57, 43, 0.34); text-decoration: none; color: #fff; }
.cta-ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px dashed var(--accent);
}
.cta-ghost:hover { background: var(--bg-soft); text-decoration: none; }

/* 装饰「盘中餐」插图 */
.hero-plate {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  margin: 0 auto;
}
.plate-ring {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  border: 2.5px dashed var(--kraft-2);
  background: radial-gradient(circle at 40% 35%, #fff 0%, var(--kraft) 100%);
  box-shadow: var(--shadow-lg);
}
html[data-theme="dark"] .plate-ring { background: radial-gradient(circle at 40% 35%, #3d2e1e 0%, var(--kraft) 100%); }
.plate-bowl {
  position: absolute;
  inset: 22%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  border-radius: 50%;
}
.plate-bowl .line-icon { width: 60%; height: 60%; }
.plate-steam {
  position: absolute;
  left: 50%;
  top: -6%;
  width: 10px;
  height: 46px;
  border-left: 2px solid var(--ink-soft);
  border-radius: 50%;
  opacity: 0.55;
}
.plate-steam.s1 { transform: translateX(-26px) rotate(8deg); }
.plate-steam.s2 { transform: translateX(0) rotate(0deg); height: 56px; }
.plate-steam.s3 { transform: translateX(26px) rotate(-8deg); }

/* =========================================================================
   区块标题（手写标签）
   ========================================================================= */
.section-title { margin: 34px 0 18px; }
.hand-tag {
  position: relative;
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  transform: rotate(-1deg);
  padding: 0 6px 6px;
}
.hand-tag::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: radial-gradient(var(--accent-2) 1.5px, transparent 2px) 0 0/8px 6px;
  opacity: 0.6;
}

.section-more { margin-top: 20px; text-align: center; }

/* =========================================================================
   菜系分类卡
   ========================================================================= */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 14px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 12px 18px;
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform .14s ease, box-shadow .14s ease;
}
.cat-card:hover {
  transform: rotate(-1.2deg) translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  border-color: var(--accent-2);
}
.cat-icon {
  font-size: 40px;
  color: var(--accent-2);
  line-height: 1;
}
.cat-icon .line-icon { width: 40px; height: 40px; }
.cat-name { font-family: var(--font-hand); font-size: 22px; }

/* =========================================================================
   食谱卡
   ========================================================================= */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.recipe-grid-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

.recipe-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform .14s ease, box-shadow .14s ease;
}
.recipe-card:hover { transform: rotate(-0.8deg) translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.recipe-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--kraft);
  overflow: hidden;
}
.recipe-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--ink-soft); font-size: 48px; }
.thumb-empty .line-icon { width: 56px; height: 56px; }
.recipe-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  background: rgba(253, 250, 241, 0.92);
  border: 1px solid var(--kraft-2);
  border-radius: 999px;
  font-family: var(--font-hand);
  font-size: 17px;
  color: var(--accent);
}
html[data-theme="dark"] .recipe-tag { background: rgba(42, 31, 20, 0.92); }
.recipe-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 16px; }
.recipe-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  color: var(--ink);
}
.recipe-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.badge-diff-easy { color: var(--green); border-color: var(--green); }
.badge-diff-medium { color: var(--accent-2); border-color: var(--accent-2); }
.badge-diff-hard { color: var(--accent); border-color: var(--accent); }

/* =========================================================================
   博客区块
   ========================================================================= */
.blog-list { display: flex; flex-direction: column; gap: 12px; }
.blog-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--card);
  border-left: 3px solid var(--accent-2);
  border-radius: 6px;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.blog-card:hover { text-decoration: none; background: var(--bg-soft); }
.blog-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--ink); }
.blog-intro { color: var(--ink-soft); font-size: 14.5px; }

/* =========================================================================
   列表页
   ========================================================================= */
.page-head { padding: 40px 0 8px; }
.page-head h1 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 4vw, 44px); }
.page-head .sub { margin: 0; color: var(--ink-soft); font-size: 16px; }

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 22px 0 8px;
  padding: 16px 18px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-right: 4px; white-space: nowrap; }
.chip {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
}
.chip:hover { text-decoration: none; border-color: var(--accent-2); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.recipe-count { margin: 16px 0 2px; font-size: 20px; color: var(--ink-soft); }
.empty-note { padding: 40px; text-align: center; color: var(--ink-soft); font-size: 16px; }

/* =========================================================================
   食谱详情页
   ========================================================================= */
.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 18px 0 0; font-size: 13.5px; color: var(--ink-soft); flex-wrap: wrap; }
.breadcrumb .sep { color: var(--ink-soft); }
.breadcrumb .current { color: var(--ink); font-weight: 600; }

.recipe { padding-bottom: 10px; }
.recipe-head { padding: 22px 0 6px; }
.recipe-cuisine { display: inline-block; font-size: 22px; color: var(--accent-2); transform: rotate(-1deg); margin-bottom: 6px; }
.recipe-head h1 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 4vw, 42px); line-height: 1.15; }
.recipe-intro { margin: 0 0 20px; color: var(--ink-soft); font-size: 16.5px; max-width: 70ch; }

.recipe-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}
.stat-label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.stat strong { font-family: var(--font-hand); font-size: 24px; color: var(--ink); font-weight: 600; }
.stat strong.diff-easy { color: var(--green); }
.stat strong.diff-medium { color: var(--accent-2); }
.stat strong.diff-hard { color: var(--accent); }

.recipe-hero-img {
  margin: 8px 0 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px dashed var(--line);
  box-shadow: var(--shadow);
}
.recipe-hero-img img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }

.recipe-cols {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 28px;
  align-items: start;
}

.ingredient-list { list-style: none; margin: 0; padding: 0; }
.ingredient-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 9px 12px;
  border-bottom: 1px dotted var(--line);
  font-size: 15.5px;
}
.ingredient-list li:last-child { border-bottom: none; }
.ingredient-list .check {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 5px;
  border: 1.5px solid var(--green);
  border-radius: 3px;
  transform: rotate(-6deg);
  position: relative;
}
.ingredient-list .check::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0;
  width: 4px;
  height: 8px;
  border: solid var(--green);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.step-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step-list li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px dotted var(--line); }
.step-list li:last-child { border-bottom: none; }
.step-num {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 19px;
  transform: rotate(-6deg);
}

.recipe-tips {
  margin-top: 28px;
  padding: 18px 20px;
  background: var(--kraft);
  border: 1px dashed var(--kraft-2);
  border-radius: var(--radius);
}
.recipe-tips .section-title { margin-top: 0; }
.tip-list { margin: 0; padding-left: 4px; list-style: none; }
.tip-list li { position: relative; padding: 5px 0 5px 22px; color: var(--ink); }
.tip-list li::before { content: '✎'; position: absolute; left: 0; color: var(--accent-2); }

/* =========================================================================
   相关食谱 / 相关文章
   ========================================================================= */
.related { margin: 34px 0 40px; }
.related-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.related-list a {
  display: inline-block;
  padding: 10px 14px;
  background: var(--card);
  border-left: 3px solid var(--accent-2);
  border-radius: 6px;
  color: var(--ink);
}
.related-list a:hover { background: var(--bg-soft); text-decoration: none; }

/* =========================================================================
   文章 / 隐私 / 关于 / 条款
   ========================================================================= */
.article { max-width: 760px; padding: 24px 0 10px; }
.article h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 14px; }
.article .intro { color: var(--ink-soft); font-size: 16.5px; }
.article-section { margin: 26px 0; }
.article-section h2 { font-family: var(--font-display); font-weight: 700; font-size: 23px; margin: 0 0 10px; }
.article-section p { margin: 0 0 12px; }
.faq-item { margin: 14px 0; padding: 14px 16px; background: var(--card); border: 1px dashed var(--line); border-radius: 8px; }
.faq-item h3 { margin: 0 0 6px; font-size: 16px; }
.faq-item p { margin: 0; color: var(--ink-soft); }

/* =========================================================================
   联系表单
   ========================================================================= */
.contact-email { font-size: 16px; }
.contact-success { padding: 16px 18px; background: var(--kraft); border: 1px dashed var(--green); border-radius: 8px; color: var(--green); }
.contact-form { max-width: 520px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea, .field select {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 13px;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent-2); }
.contact-form button {
  align-self: flex-start;
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.contact-form button:hover { box-shadow: 0 6px 18px rgba(192, 57, 43, 0.3); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* =========================================================================
   404
   ========================================================================= */
.hero-single { display: block; padding: 60px 0; text-align: center; }
.hero-single .sub { margin: 0 auto 22px; }
.notfound-link {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.notfound-link:hover { text-decoration: none; opacity: .92; }

/* =========================================================================
   页脚
   ========================================================================= */
.site-footer {
  margin-top: 40px;
  padding: 34px 0 40px;
  border-top: 1px dashed var(--line);
  background: var(--bg-soft);
  text-align: center;
}
.friend-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.friend-links a { color: var(--ink-soft); font-size: 14px; }
.footer-brand { margin: 0 0 6px; color: var(--ink); }
.footer-brand .hand { font-size: 22px; color: var(--accent); }
.site-footer .privacy { margin: 0 0 12px; color: var(--ink-soft); font-size: 13.5px; }
.legal-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.legal-links a { color: var(--ink-soft); font-size: 13.5px; }

/* =========================================================================
   响应式
   ========================================================================= */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 36px 0 24px; }
  .hero-plate { max-width: 220px; margin-top: 8px; }
  .recipe-cols { grid-template-columns: 1fr; gap: 10px; }
  .header-inner { gap: 10px; }
  .header-actions { margin-left: 0; }
  .nav { order: 3; width: 100%; }
}
