

 /*=====以下是食谱模块的样式========*/
        /* 食谱卡片容器 */
.recipecard {
    --card-radius: 12px;
    --hover-transition: 0.3s ease;
    padding: 2rem 1.5rem;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
  
  /* 标题区块 */
  .block-tit-index {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
  }
  
  .block-tit-index > span:first-child {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3339;
  }
  
  .block-tit-index a {
    font-size: 1rem;
    color: #444;
    background-color: #f5f5f5;
    padding: 5px 10px;
    border-radius: 10px;
    text-decoration: none;
    transition: color 0.2s;
  }
  
  .block-tit-index a:hover {
    color: #fff;
    background-color: #ff8800;
  }
  
  /* 食谱列表 */
  .recipe-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 0;
    margin: 0;
    list-style: none;
  }
  
  /* 单个食谱项 */
  .recipe-item {
    background: #fff;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform var(--hover-transition),
                box-shadow var(--hover-transition);
    animation: itemEnter 0.6s ease both;
    animation-delay: calc(var(--animation-index) * 0.1s);
  }
  
  .recipe-link {
    text-decoration: none;
    color: inherit;
    display: block;
  }
  
  /* 图片容器 */
  .recipe-media {
    position: relative;
    padding-top: 65%; /* 4:3比例 */
    background: #f8f9fa;
  }
  
  .recipe-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }
  
  /* 信息区块 */
  .recipe-info {
    padding: 1.2rem;
  }
  
  .recipe-title {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    color: #2d3339;
    line-height: 1.3;
    transition: color 0.2s;
  }
  
  .recipe-description {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  /* 悬停效果 */
  .recipe-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  }
  
  .recipe-item:hover .recipe-image {
    transform: scale(1.03);
  }
  
  .recipe-item:hover .recipe-title {
    color: #e35d6a;
  }
  
  /* 响应式布局 */
  @media (max-width: 992px) {
    .recipe-list {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @media (max-width: 576px) {
    .recipecard {
      padding: 1.5rem 1rem;
    }
    
    .recipe-list {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
    
    .recipe-title {
      font-size: 1rem;
    }
    
    .recipe-description {
      -webkit-line-clamp: 2;
    }
  }
  
  /* 入场动画 */
  @keyframes itemEnter {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

/* 基础样式 */
.recipecard {
    margin: 2rem auto;
    max-width: 1200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  
  .block-tit-index {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
  }
  
  /* 网格布局 */
  .recipe-list.grid-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 1.5rem;
  }
  
  .grid-layout .recipe-item {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
  }
  
  /* 横向滚动布局 */
  .recipe-list.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    padding: 1.5rem;
    gap: 1.5rem;
  }
  
  .horizontal-scroll .recipe-item {
    flex: 0 0 280px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
  }
  
  /* 极简列表布局 */
  .recipe-list.minimalist-list {
    padding: 1.5rem;
  }
  
  .minimalist-list .recipe-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
  }
  
  /* 通用元素样式 */
  .recipe-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
  }
  
  .recipe-item h3 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
    color: #333;
  }
  
  .recipe-item p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
  }
  
  /* 响应式处理 */
  @media (max-width: 768px) {
    .recipe-list.grid-layout {
      grid-template-columns: repeat(2, 1fr);
    }
    
    .horizontal-scroll .recipe-item {
      flex: 0 0 200px;
    }
  }
  
  @media (max-width: 480px) {
    .recipe-list.grid-layout {
      grid-template-columns: 1fr;
    }
  }

  /* 分栏布局 */
.column-layout .recipe-item {
    column-count: 2;
    break-inside: avoid;
  }
  
  /* 瀑布流布局 */
  .masonry-layout {
    columns: 3 300px;
  }
  .masonry-layout .recipe-item {
    break-inside: avoid;
    margin-bottom: 1rem;
  }
  

  
  /* 时间线布局 */
  .timeline-layout .recipe-item {
    position: relative;
    padding-left: 2rem;
    border-left: 3px solid #f0ad4e;
  }
  .timeline-layout .recipe-item::before {
    content: attr(data-index);
    position: absolute;
    left: -0.8em;
    top: 0;
    background: #fff;
    border: 2px solid #f0ad4e;
    border-radius: 50%;
  }
  
  /* 骨架屏加载动画 */
  @keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  .skeleton-loading .recipe-item {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 15s infinite;
  }

  /* 新增分页样式 */
  .pagination {
    display: flex;
    justify-content: center;
    padding: 20px 10px;
    gap: 4px;
    overflow-x: auto;
}

.pagination-link {
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-family: Arial, sans-serif;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
}

.pagination-link.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-link:not(.nav-button):hover {
    background: #f0f0f0;
}

/* 新增导航按钮 */
.nav-button {
    background: #f8f9fa;
    min-width: 32px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .pagination {
        justify-content: flex-start;
        gap: 2px;
    }
    
    .pagination-link {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .page-gap {
        display: none;
    }
}

/*==============分类页面==================*/

.category-container {
  margin: 2rem auto;
  max-width: 1200px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  
  .category-title {
    font-size: 2.5rem;
    color: #2d3436;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
  }
  
  /* 移动端基础样式 */
  .category-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing);
    padding: 10px;
    list-style: none;
  }
  
  .category-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: var(--transition);
  }
  
  .category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  
  .category-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
  }
  
  .category-link:hover {
    background-color: var(--hover-color);
  }
  
  .category-image {
    width: 60px;
    height: auto;
    border-radius: 10px;
  }

  .category-name {
    font-size: 0.8rem;
    font-weight: normal;
    word-break: break-word;
  }
  
  /* 平板适配 (768px+) */
  @media (min-width: 768px) {
    .category-image {
      width: 120px;
      height: auto;
    }
  
    .category-list {
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 1.5rem;
    }
  
    .category-link {
      flex-direction: column;
      padding: 1.5rem;
    }
  
    .category-name {
        font-size: 1.2rem;
        font-weight: normal;
        word-break: break-word;
      }
  }
  
  /* 桌面适配 (1024px+) */
  @media (min-width: 1024px) {
    .category-image {
      width: 220px;
      height: auto;
    }
  
    .category-list {
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .category-name {
        font-size: 1.5rem;
        font-weight: normal;
        word-break: break-word;
      }
  }
  
  .category-link:hover .category-image {
    transform: scale(1.1);
  }
  

  /*=============食谱内容页面主体=========*/
  .article-container {
    margin: 2rem auto;
    max-width: 1200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  /* 文章标题区域 */
  section {
    width: 100%;
    padding: 10px;
  }
section h1 {
  font-size: 2.5rem;
  color: #2d3436;
  margin-bottom: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.article-img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.description {
  font-size: 1.5rem;
  color: #636e72;
  margin: 1.5rem auto;
  max-width: 800px;
}

/* 材料容器 */
.ingredient-container {
  margin: 10px;
  padding: 25px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ingredient-header {
  color: #2d5a4b;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0e7e3;
}

.ingredient-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  gap: 15px;
}

.ingredient-item:last-child {
  border-bottom: none;
}

.ingredient-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f0f0f0;
}

.amount {
  color: #6a8375;
  font-size: 14px;
  font-weight: 500;
  min-width: 60px;
}

.name {
  color: #2d5a4b;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

/* 特殊处理长文本换行 */
.ingredient-item div:nth-child(3) {
  flex: 1;
  word-break: break-word;
}

/* 营养信息 */
.nutrition-container {
  margin: 20px 10px 10px 10px;
  padding: 25px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nutrition-header {
  color: #2d5a4b;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0e7e3;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.nutrition-item {
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.nutrition-label {
  color: #636e72;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.nutrition-value {
  color: #2d3436;
  font-weight: 700;
  font-size: 1.2rem;
}

/* 烹饪步骤 */
.cooking-container {
  margin: 20px 10px 10px 10px;
  padding: 25px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cooking-title {
  color: #2d5a4b;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0e7e3;
}

.step-container {
  margin: 2rem 0;
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.step-title {
  color: #2d3436;
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}

.step-description {
  color: #636e72;
  font-size: 1rem;
  line-height: 1.8;
}

.step-image {
  border-radius: 10px;
  width: 100%;
}


/* 响应式设计 */
@media (max-width: 768px) {
  .article-container {
    padding: 1rem;
  }

  section h1 {
    font-size: 2rem;
  }

  .ingredient-item {
    grid-template-columns: 60px 1fr;
    gap: 1rem;
    padding: 0.8rem;
  }

  .ingredient-img {
    width: 60px;
    height: 60px;
  }

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

  .step-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .description {
    font-size: 1rem;
  }

  .ingredient-container,
  .nutrition-container {
    padding: 1.5rem;
  }

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

/*===========单页面================*/
.single-container {
  margin: 2rem auto;
  max-width: 1200px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 10px;
  }

  .single-title {
    font-size: 2.5rem;
    color: #2d3436;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
  }

  .single-container p{
    margin-top: 20px;
  }

  strong {
    font-size: 18px;
  }