/* ========================================
   川菜网 - 食谱风格样式表
   www.chuancaike.cn
   提供专业的川菜烹饪培训课程
   ======================================== */

/* CSS 变量定义 */
:root {
  --accent-color: #ff9800;
  --primary-color: #c41e3a;
  --secondary-color: #2e7d32;
  --text-color: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg-color: #fff;
  --bg-light: #f8f8f8;
  --bg-warm: #fff8f0;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

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

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.3s;
}

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

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

ul {
  list-style: none;
}

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

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

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

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

.nav a {
  color: var(--text-color);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.nav a:hover,
.nav a.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

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

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

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

/* ========================================
   页脚 Footer
   ======================================== */
.footer {
  background: #2c2c2c;
  color: #aaa;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 30px;
}

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

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

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

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

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

/* ========================================
   面包屑 Breadcrumb
   ======================================== */
.breadcrumb {
  background: var(--bg-light);
  padding: 12px 0;
  font-size: 14px;
}

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

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

.breadcrumb .separator {
  margin: 0 8px;
  color: var(--text-muted);
}

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

/* ========================================
   Hero 区域
   ======================================== */
.hero {
  background: linear-gradient(135deg, var(--bg-warm) 0%, #fff 100%);
  padding: 60px 0;
  text-align: center;
}

.hero-title {
  font-size: 42px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-flex;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: #a01830;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: #fff;
}

/* ========================================
   特色区域 Features
   ======================================== */
.features {
  padding: 40px 0;
  background: var(--bg-color);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  transition: all 0.3s;
}

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

.feature-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent-color), #ffb74d);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 14px;
  color: var(--text-light);
}

/* ========================================
   内容区域 Section
   ======================================== */
.section {
  padding: 40px 0;
}

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

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

.section-title::before {
  content: "";
  width: 4px;
  height: 24px;
  background: var(--primary-color);
  border-radius: 2px;
}

.section-more {
  font-size: 14px;
  color: var(--text-light);
}

.section-more:hover {
  color: var(--primary-color);
}

/* ========================================
   内容卡片 Content Card
   ======================================== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.content-card {
  display: flex;
  background: var(--bg-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

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

.content-card-image {
  width: 200px;
  min-height: 150px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}

.content-card-body {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.content-card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
  line-height: 1.4;
}

.content-card-title:hover {
  color: var(--primary-color);
}

.content-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.content-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.content-card-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  flex: 1;
}

.content-card-tags {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-warm);
  color: var(--accent-color);
  font-size: 12px;
  border-radius: 12px;
}

/* ========================================
   侧边栏列表 Sidebar List
   ======================================== */
.sidebar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.sidebar-section {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.sidebar-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-color);
}

.sidebar-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
  font-size: 14px;
}

.sidebar-list a::before {
  content: "•";
  color: var(--accent-color);
}

.sidebar-list a:hover {
  color: var(--primary-color);
}

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

.category-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 12px;
}

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

.category-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  font-size: 14px;
  color: var(--text-muted);
}

.category-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========================================
   分页 Pagination
   ======================================== */
.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;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-color);
  background: var(--bg-light);
  transition: all 0.3s;
}

.pagination a:hover {
  background: var(--primary-color);
  color: #fff;
}

.pagination .current {
  background: var(--primary-color);
  color: #fff;
}

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

/* ========================================
   文章页样式 Article
   ======================================== */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.article-header {
  margin-bottom: 30px;
}

.article-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
  color: var(--text-color);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

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

.article-meta .author {
  color: var(--primary-color);
  font-weight: 500;
}

.article-featured-image {
  width: 100%;
  height: 400px;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 30px;
  overflow: hidden;
}

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

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

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 30px 0 16px;
}

.article-content p {
  margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-content ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

/* 食材清单 */
.ingredient-list {
  background: var(--bg-warm);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
}

.ingredient-list h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.ingredient-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
}

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

/* 烹饪步骤 */
.cook-steps {
  margin: 30px 0;
}

.cook-steps h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.step-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.step-number {
  width: 36px;
  height: 36px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content p {
  margin-bottom: 0;
}

/* 烹饪时间 */
.cook-time {
  display: flex;
  gap: 24px;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 24px 0;
}

.time-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-item .label {
  font-size: 13px;
  color: var(--text-muted);
}

.time-item .value {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
}

/* 营养信息 */
.nutrition-info {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
}

.nutrition-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.nutrition-item {
  text-align: center;
  padding: 12px;
  background: var(--bg-color);
  border-radius: var(--radius);
}

.nutrition-item .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.nutrition-item .value {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
}

/* 相关文章 */
.related-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.related-card {
  background: var(--bg-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
}

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

.related-card-image {
  height: 120px;
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

.related-card-title {
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
}

/* ========================================
   404 页面
   ======================================== */
.error-page {
  min-height: calc(100vh - var(--header-height) - 300px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

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

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

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

.error-suggestions {
  margin-top: 30px;
}

.error-suggestions h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--text-light);
}

.error-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.error-links a {
  padding: 10px 20px;
  background: var(--bg-light);
  border-radius: var(--radius);
  color: var(--text-color);
  font-size: 14px;
  transition: all 0.3s;
}

.error-links a:hover {
  background: var(--primary-color);
  color: #fff;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-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: 12px 20px;
  }

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

  .search-box {
    width: 160px;
  }

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

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

  .features-grid {
    grid-template-columns: 1fr;
  }

  .content-card {
    flex-direction: column;
  }

  .content-card-image {
    width: 100%;
    height: 180px;
  }

  .sidebar-grid {
    grid-template-columns: 1fr;
  }

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

  .article-title {
    font-size: 24px;
  }

  .article-featured-image {
    height: 240px;
  }

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

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

  .related-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    width: 100%;
    padding: 0 20px;
  }

  .btn {
    width: 100%;
  }

  .category-stats {
    flex-direction: column;
    gap: 12px;
  }

  .cook-time {
    flex-direction: column;
    gap: 12px;
  }
}
