/* ============================================
   川菜 - 食谱集风格样式表
   www.sumeishi.cn - 专注于川菜文化
   ============================================ */

/* CSS 变量 */
:root {
  --accent-color: #e74c3c;
  --accent-dark: #c0392b;
  --accent-light: #fadbd8;
  --text-primary: #2c3e50;
  --text-secondary: #5d6d7e;
  --text-muted: #95a5a6;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-dark: #2c3e50;
  --border-color: #e5e8e8;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

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

ul {
  list-style: none;
}

/* ============================================
   布局容器
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   页头 Header
   ============================================ */
.header {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.nav {
  display: flex;
  gap: 30px;
}

.nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  position: relative;
}

.nav a:hover,
.nav a.active {
  color: var(--accent-color);
}

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-color);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 25px;
  padding: 8px 16px;
  width: 240px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 14px;
}

.search-box button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
}

/* ============================================
   页脚 Footer
   ============================================ */
.footer {
  background: var(--bg-dark);
  color: #bdc3c7;
  padding: 50px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 15px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.8;
}

.footer-title {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 14px;
  color: #bdc3c7;
}

.footer-links a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  border-top: 1px solid #34495e;
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
}

/* ============================================
   Hero 区域
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: white;
  padding: 80px 0;
  text-align: center;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 18px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 30px;
}

.hero-tags {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
}

/* ============================================
   区块标题
   ============================================ */
.section {
  padding: 60px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title span {
  color: var(--accent-color);
}

.section-more {
  color: var(--accent-color);
  font-size: 14px;
  font-weight: 500;
}

.section-more:hover {
  text-decoration: underline;
}

/* ============================================
   卡片网格布局
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ============================================
   食谱卡片
   ============================================ */
.recipe-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.recipe-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.recipe-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.recipe-card:hover .recipe-image img {
  transform: scale(1.05);
}

.difficulty-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.difficulty-easy {
  background: #27ae60;
  color: white;
}

.difficulty-medium {
  background: #f39c12;
  color: white;
}

.difficulty-hard {
  background: #e74c3c;
  color: white;
}

.save-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.save-btn:hover {
  background: var(--accent-light);
  color: var(--accent-color);
}

.recipe-content {
  padding: 20px;
}

.recipe-category {
  font-size: 12px;
  color: var(--accent-color);
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.recipe-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

.recipe-title a:hover {
  color: var(--accent-color);
}

.recipe-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 13px;
  color: var(--text-muted);
}

.recipe-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ============================================
   分类筛选
   ============================================ */
.category-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.filter-btn {
  padding: 10px 24px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: 25px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* ============================================
   面包屑导航
   ============================================ */
.breadcrumb {
  background: var(--bg-secondary);
  padding: 15px 0;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.breadcrumb li:not(:last-child)::after {
  content: '>';
  margin-left: 10px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--accent-color);
}

.breadcrumb li:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   加载更多按钮
   ============================================ */
.load-more {
  text-align: center;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* ============================================
   三栏文章列表
   ============================================ */
.three-column-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.article-list {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 24px;
}

.article-list-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--accent-color);
}

.article-list ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.article-list li::before {
  content: '•';
  color: var(--accent-color);
  font-weight: bold;
}

.article-list a {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.article-list a:hover {
  color: var(--accent-color);
}

/* ============================================
   分类页头部
   ============================================ */
.category-header {
  background: var(--bg-secondary);
  padding: 40px 0;
  text-align: center;
}

.category-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
}

.category-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   分页
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: var(--transition);
}

.pagination a {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.pagination a:hover {
  background: var(--accent-color);
  color: white;
}

.pagination .current {
  background: var(--accent-color);
  color: white;
  font-weight: 500;
}

.pagination .prev,
.pagination .next {
  width: auto;
  padding: 0 16px;
}

/* ============================================
   文章详情页
   ============================================ */
.article-header {
  background: var(--bg-secondary);
  padding: 40px 0;
}

.article-meta-header {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 15px;
}

.article-meta-header span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-featured-image {
  margin: 30px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.article-featured-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
}

.article-content h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 30px 0 15px;
  color: var(--text-primary);
}

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 25px 0 12px;
  color: var(--text-primary);
}

.article-content p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.article-content ul,
.article-content ol {
  margin: 15px 0;
  padding-left: 25px;
}

.article-content li {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.article-content ul li {
  list-style-type: disc;
}

.article-content ol li {
  list-style-type: decimal;
}

.ingredient-list {
  background: var(--bg-secondary);
  padding: 25px;
  border-radius: var(--radius-md);
  margin: 20px 0;
}

.ingredient-list h3 {
  margin-top: 0;
}

.ingredient-list ul {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ingredient-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.ingredient-list li::before {
  content: '✓';
  color: var(--accent-color);
  font-weight: bold;
}

/* ============================================
   相关推荐
   ============================================ */
.related-section {
  background: var(--bg-secondary);
  padding: 40px 0;
}

/* ============================================
   404 页面
   ============================================ */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.error-content {
  max-width: 500px;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 20px;
}

.error-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 15px;
}

.error-desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.error-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1024px) {
  .card-grid,
  .three-column-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-wrap: wrap;
    height: auto;
    padding: 15px 20px;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 15px;
    gap: 20px;
  }

  .search-box {
    width: 180px;
  }

  .hero {
    padding: 50px 0;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-desc {
    font-size: 16px;
  }

  .card-grid,
  .three-column-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 22px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .category-title {
    font-size: 28px;
  }

  .article-featured-image img {
    height: 250px;
  }

  .ingredient-list ul {
    grid-template-columns: 1fr;
  }

  .error-code {
    font-size: 80px;
  }

  .error-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .category-filter {
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .recipe-image {
    height: 180px;
  }

  .recipe-content {
    padding: 15px;
  }

  .recipe-title {
    font-size: 16px;
  }
}
