/* 美食盒子 - 样式 */
:root {
  --primary: #ff6b35;
  --primary-light: #ff8c5a;
  --primary-dark: #e55a2b;
  --secondary: #ffa726;
  --accent: #ffd54f;
  --bg-primary: #fff8f0;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #2d2d2d;
  --text-secondary: #666;
  --text-muted: #999;
  --border: #f0e0d0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 12px rgba(255,107,53,0.1);
  --shadow-hover: 0 8px 24px rgba(255,107,53,0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* 顶部导航 */
.header {
  background: linear-gradient(135deg, #ff6b35 0%, #ffa726 100%);
  box-shadow: 0 2px 12px rgba(255,107,53,0.3);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
}
.logo { display: flex; align-items: center; gap: 8px; color: #fff; }
.logo-icon { font-size: 28px; }
.logo-text { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.search-box {
  flex: 1; max-width: 500px;
  display: flex; background: rgba(255,255,255,0.95);
  border-radius: 24px; overflow: hidden;
}
.search-box input {
  flex: 1; border: none; outline: none;
  padding: 10px 16px; font-size: 14px;
  background: transparent;
}
.search-box button {
  border: none; background: var(--primary);
  color: #fff; padding: 0 20px; cursor: pointer;
  font-size: 16px;
}
.header-nav { display: flex; gap: 20px; }
.header-nav a {
  color: #fff; text-decoration: none;
  font-size: 15px; font-weight: 500;
  opacity: 0.9; transition: opacity 0.2s;
}
.header-nav a:hover { opacity: 1; text-decoration: underline; }

/* 容器 */
.container { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* Hero区 */
.hero {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 50%, #ffcc80 100%);
  border-radius: var(--radius-lg);
  padding: 28px 40px; text-align: center;
  margin-bottom: 20px; position: relative; overflow: hidden;
  border: 1px solid rgba(255,107,53,0.15);
}
.hero-bg {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image: url('https://aka.doubaocdn.com/s/OlZCH6hvsL');
  background-size: cover; background-position: center;
  filter: blur(1px) brightness(0.85);
  opacity: 0.25;
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b35, #ffa726);
  color: #fff; padding: 4px 16px;
  border-radius: 16px; font-size: 13px; font-weight: 600;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}
.hero h1 {
  font-size: 30px; font-weight: 900;
  color: var(--primary-dark);
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(255,255,255,0.6);
  letter-spacing: 1px;
}
.hero p {
  color: #5d4037; font-size: 14px;
  max-width: 650px; margin: 0 auto 16px;
  line-height: 1.6;
}
.hero-stats { display: flex; justify-content: center; gap: 40px; }
.hero-stat { text-align: center; }
.hero-stat .num {
  display: block; font-size: 28px; font-weight: 900;
  color: var(--primary);
  text-shadow: 0 2px 4px rgba(255,255,255,0.5);
}
.hero-stat .label { font-size: 13px; color: #8d6e63; font-weight: 500; }

/* 广告位 */
.ad-slot {
  background: rgba(255,107,53,0.05);
  border: 2px dashed rgba(255,107,53,0.2);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 13px;
}
.ad-banner { height: 90px; margin: 20px 0; }
.ad-side { width: 160px; height: 600px; position: sticky; top: 40px; }
.ad-native {
  height: 90px; margin: 20px 0;
  background: rgba(255,107,53,0.05);
  border: 2px dashed rgba(255,107,53,0.2);
  border-radius: 8px;
}

/* 筛选区 */
.filter-section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 20px; margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.filter-row {
  display: flex; align-items: center;
  gap: 10px; margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.filter-row:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.filter-label {
  font-size: 15px; font-weight: 600;
  color: var(--text-secondary);
  min-width: 48px;
  flex-shrink: 0;
}
.filter-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-btn {
  padding: 5px 14px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--bg-primary);
  color: var(--text-secondary); font-size: 14px;
  cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 500;
}

/* 菜谱网格 */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.recipe-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s;
}
.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.recipe-cover {
  height: 180px; position: relative;
  background: linear-gradient(135deg, #ffe0b2, #ffcc80);
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  overflow: hidden;
}
.recipe-cover img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center;
}
.recipe-badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,107,53,0.9);
  color: #fff; padding: 3px 10px;
  border-radius: 12px; font-size: 12px; font-weight: 600;
}
.recipe-info { padding: 14px; }
.recipe-name {
  font-size: 16px; font-weight: 700;
  margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.recipe-desc {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 10px;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.recipe-meta {
  display: flex; justify-content: space-between;
  align-items: center; font-size: 12px;
  color: var(--text-secondary);
}
.recipe-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.recipe-tag {
  background: rgba(255,107,53,0.1);
  color: var(--primary);
  padding: 2px 8px; border-radius: 8px;
  font-size: 11px;
}
.recipe-rating { color: #ffa000; font-weight: 600; }

/* 分页 */
.pagination {
  display: flex; justify-content: center;
  gap: 8px; margin: 30px 0;
}
.page-btn {
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-card);
  color: var(--text-secondary); cursor: pointer;
  font-size: 14px; transition: all 0.2s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 详情页弹窗 */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 200; display: none; align-items: flex-start;
  justify-content: center; padding: 40px 20px;
  overflow-y: auto; gap: 20px;
}
.modal-overlay.show { display: flex; }
.modal-side-ad { display: none; flex-shrink: 0; }
.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  max-width: 860px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  position: relative; flex-shrink: 1;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none;
  color: var(--text-primary); font-size: 18px;
  cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--primary); color: #fff; }
.modal-hero {
  height: 300px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #ffe0b2, #ffcc80);
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
}
.modal-hero img { width: 100%; height: 100%; object-fit: cover; }
.modal-body { padding: 24px; }
.modal-title { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.modal-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-bottom: 20px; font-size: 14px;
  color: var(--text-secondary);
}
.modal-meta span { display: flex; align-items: center; gap: 4px; }
.modal-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.modal-tab {
  padding: 12px 20px; border: none; background: none;
  color: var(--text-secondary); font-size: 15px;
  cursor: pointer; border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.modal-tab:hover { color: var(--primary); }
.modal-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* 食材清单 */
.ingredients-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.ingredient-item {
  display: flex; justify-content: space-between;
  padding: 10px 14px; background: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.ingredient-item .name { font-weight: 500; }
.ingredient-item .amount { color: var(--text-muted); }

/* 烹饪步骤 */
.step-item {
  display: flex; gap: 16px; margin-bottom: 20px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0; width: 36px; height: 36px;
  background: var(--primary); color: #fff;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.step-content { flex: 1; }
.step-content p { font-size: 15px; line-height: 1.8; }
.step-tip {
  margin-top: 8px; padding: 8px 12px;
  background: #fff3e0; border-left: 3px solid var(--secondary);
  border-radius: 4px; font-size: 13px; color: #e65100;
}

/* 技巧和营养 */
.tips-list, .nutrition-list { list-style: none; }
.tips-list li, .nutrition-list li {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; line-height: 1.7;
}
.tips-list li:last-child, .nutrition-list li:last-child { border-bottom: none; }
.tips-list li::before { content: '💡 '; }
.nutrition-list li::before { content: '🥗 '; }

/* 回到顶部 */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff;
  border: none; font-size: 20px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(255,107,53,0.4);
  display: none; z-index: 150;
  transition: all 0.3s;
}
.back-to-top.show { display: block; }
.back-to-top:hover { transform: translateY(-2px); }

/* 页脚 */
.footer {
  background: #3e2723; color: #d7ccc8;
  text-align: center; padding: 30px 20px;
  margin-top: 40px;
}
.footer p { margin-bottom: 8px; font-size: 14px; }
.footer-disclaimer { font-size: 12px; color: #8d6e63; }

/* 宽屏显示两侧广告 */
@media (min-width: 1400px) {
  .modal-side-ad { display: block; }
  .modal { max-width: 820px; }
}
@media (min-width: 1700px) {
  .modal { max-width: 900px; }
}

/* 响应式 */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .header-nav { display: none; }
  .search-box { order: 3; max-width: 100%; width: 100%; }
  .hero { padding: 24px 16px; }
  .hero h1 { font-size: 24px; }
  .hero-stats { gap: 20px; }
  .hero-stat .num { font-size: 22px; }
  .recipe-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .recipe-cover { height: 120px; font-size: 40px; }
  .modal-title { font-size: 22px; }
  .modal-hero { height: 200px; }
  .modal-tab { padding: 10px 12px; font-size: 13px; }
}
