/* ========================================
   饮食健康站 - 全站样式
   clawmaster.online
   ======================================== */

:root {
  --primary: #FF6B35;       /* 活力橙 */
  --primary-light: #FFF0EB;
  --secondary: #2D6A4F;     /* 健康绿 */
  --text-dark: #1A1A2E;
  --text-gray: #6B7280;
  --text-light: #9CA3AF;
  --bg: #FAFAFA;
  --white: #FFFFFF;
  --border: #E5E7EB;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }

/* ---- 通用容器 ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- 导航栏 ---- */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-logo span { color: var(--text-dark); }
.navbar-nav { display: flex; gap: 28px; list-style: none; }
.navbar-nav a {
  font-size: 15px;
  color: var(--text-gray);
  transition: color 0.2s;
  font-weight: 500;
}
.navbar-nav a:hover, .navbar-nav a.active { color: var(--primary); }

/* ---- 小程序悬浮二维码 ---- */
.nav-mini { position: relative; }
.nav-mini > a {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.mini-qrcode-popup {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  padding: 14px 14px 10px;
  width: 156px;
  text-align: center;
  z-index: 200;
}
.mini-qrcode-popup::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.mini-qrcode-popup img {
  width: 128px;
  height: 128px;
  border-radius: 8px;
  display: block;
}
.mini-qrcode-popup p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-gray);
  letter-spacing: 0.2px;
}
.nav-mini:hover .mini-qrcode-popup { display: block; }

/* ---- Hero 区域 ---- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #FF8C5A 100%);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}
.hero h1 { font-size: 36px; font-weight: 800; margin-bottom: 12px; }
.hero p { font-size: 18px; opacity: 0.9; margin-bottom: 28px; }
.hero-search {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 0;
}
.hero-search input {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 15px;
  outline: none;
}
.hero-search button {
  padding: 14px 28px;
  background: var(--secondary);
  color: var(--white);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
}
.hero-search button:hover { background: #245840; }

/* ---- 统计条 ---- */
.stats-bar {
  background: var(--white);
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.stats-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 40px;
  justify-content: center;
}
.stat-item { text-align: center; }
.stat-item .num {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}
.stat-item .label {
  font-size: 13px;
  color: var(--text-gray);
}

/* ---- 分类导航 ---- */
.categories-section { padding: 40px 0; }
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--primary);
  border-radius: 2px;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.category-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.category-card .emoji { font-size: 32px; margin-bottom: 6px; }
.category-card .name { font-size: 14px; font-weight: 500; color: var(--text-dark); }

/* ---- 菜谱网格 ---- */
.recipes-section { padding: 40px 0; }
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.recipe-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.25s;
  cursor: pointer;
}
.recipe-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}
.recipe-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f0f0f0;
}
.recipe-card-img.default {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #ccc;
}
.recipe-card-body { padding: 14px 16px; }
.recipe-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recipe-card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.tag {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.tag-category { background: var(--primary-light); color: var(--primary); }
.tag-calories { background: #FFF3E0; color: #E65100; font-weight: 600; }
.tag-difficulty-easy { background: #E8F5E9; color: #2D6A4F; }
.tag-difficulty-medium { background: #FFF8E1; color: #F57F17; }
.tag-difficulty-hard { background: #FFEBEE; color: #C62828; }

/* ---- 筛选栏 ---- */
.filter-bar {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.filter-bar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--white);
  outline: none;
  min-width: 120px;
}
.filter-bar select:focus { border-color: var(--primary); }
.filter-bar input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  flex: 1;
}
.filter-bar input:focus { border-color: var(--primary); }
.filter-count { font-size: 14px; color: var(--text-gray); margin-left: auto; }

/* ---- 菜谱详情页 ---- */
.detail-header {
  background: linear-gradient(135deg, var(--primary) 0%, #FF8C5A 100%);
  color: var(--white);
  padding: 40px 0;
}
.detail-header .container { display: flex; gap: 32px; align-items: flex-start; }
.detail-cover {
  width: 320px;
  height: 240px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.detail-cover.default {
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: rgba(255,255,255,0.5);
}
.detail-info { flex: 1; }
.detail-title { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-tag {
  font-size: 13px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}
.detail-desc { font-size: 15px; opacity: 0.9; line-height: 1.7; }

/* ---- 营养信息 ---- */
.nutrition-section {
  padding: 40px 0;
}
.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.nutrition-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.nutrition-card .value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}
.nutrition-card .unit {
  font-size: 13px;
  color: var(--text-gray);
}
.nutrition-card .name {
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 500;
  margin-top: 4px;
}
.nutrition-card.calories .value { color: #E65100; }
.nutrition-card.protein .value { color: #1565C0; }
.nutrition-card.carbs .value { color: #2D6A4F; }
.nutrition-card.fat .value { color: #F57F17; }

/* ---- 步骤 ---- */
.recipe-content { padding: 40px 0; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.content-section { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.content-section h2 { font-size: 18px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.ingredient-list { list-style: none; }
.ingredient-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}
.ingredient-item:last-child { border-bottom: none; }
.ingredient-name { font-weight: 500; }
.ingredient-meta { color: var(--text-gray); font-size: 14px; }
.step-list { list-style: none; counter-reset: step; }
.step-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  font-size: 15px;
  line-height: 1.7;
}
.step-item:last-child { border-bottom: none; }
.step-num {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-text { flex: 1; }

/* ---- 分页 ---- */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 32px;
}
.page-btn {
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
  padding: 0 12px;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ---- 底部 ---- */
.footer {
  background: var(--text-dark);
  color: rgba(255,255,255,0.6);
  padding: 32px 0;
  margin-top: 60px;
  text-align: center;
  font-size: 14px;
}
.footer a { color: var(--primary); }

/* ---- 加载/空状态 ---- */
.loading { text-align: center; padding: 60px; color: var(--text-gray); font-size: 15px; }
.empty-state { text-align: center; padding: 60px; color: var(--text-gray); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ---- 面包屑 ---- */
.breadcrumb {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }
.detail-header .breadcrumb { color: #fff; }
.detail-header .breadcrumb a { color: #fff; }
.detail-header .breadcrumb a:hover { color: #fff; text-decoration: underline; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 26px; }
  .nutrition-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .detail-header .container { flex-direction: column; }
  .detail-cover { width: 100%; height: 200px; }
  .navbar-nav { display: none; }
  .stats-inner { gap: 24px; }
  .filter-bar { flex-direction: column; }
  .filter-count { margin-left: 0; }
}
