/* 页面特定样式 */
.container section {
  margin-bottom: 40px;
}

.container h2 {
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

.container h3 {
  color: #444;
  margin: 25px 0 15px;
}

.container p {
  line-height: 1.6;
  color: #666;
  margin-bottom: 15px;
}

/* 主题色变量 */
:root {
  --primary-color: #13a41ae6; /* 更深的绿色 */
  --primary-light: #4caf50; /* 标准绿色 */
  --primary-dark: #1b5e20; /* 暗绿色 */
  --text-color: #333;
  --bg-color: #f9f9f9;
}

/* 顶部导航 */
.top-nav {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li a {
  color: var(--text-color);
  text-decoration: none;
  padding: 10px 20px;
  transition: color 0.3s;
  font-size: 16px;
}

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

/* 主要内容 */
.container {
  max-width: 1200px;
  margin: 80px auto 20px;
  padding: 0 20px;
}

/* 菜谱网格 */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 固定4列 */
  grid-auto-rows: minmax(200px, auto); /* 每行至少100px高，根据内容自动调整 */
  gap: 30px;
  padding: 20px 0;
}

/* 菜谱项目 */
.recipe-item,
.video-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  cursor: pointer;
}

.recipe-item:hover {
  transform: translateY(-5px);
}

.recipe-cover {
  position: relative;
  height: 100%;
}

.recipe-cover img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.recipe-cover h1 {
  color: #333;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
}

.recipe-cover h3 {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 15px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
  font-size: 18px;
}

/* 弹窗样式 */
.recipe-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%; /* 固定宽度为90% */
  max-width: 90%; /* 最大宽度也是90% */
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  padding: 30px;
}

.close-modal {
  position: absolute;
  right: 10px;
  top: 0px;
  font-size: 28px;
  cursor: pointer;
  color: #666;
}

/* 遮罩层 */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* 视频菜谱样式 */
.video-item .recipe-cover {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 200px;
  overflow: hidden;
}

.video-item .recipe-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.3s;
  pointer-events: none; /* 防止视频可点击 */
}

.video-item:hover .recipe-cover video {
  opacity: 0.6;
}

.video-icon {
  position: absolute;
  font-size: 4rem;
  color: #fff;
  opacity: 0.8;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 1;
  transition: all 0.3s;
}

.video-item:hover .video-icon {
  transform: scale(1.1);
  opacity: 1;
}

/* 视频弹窗样式 */
.recipe-modal .video-content {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.recipe-modal video {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
  .nav-container {
    padding: 0 15px;
    justify-content: center;
  }

  .nav-menu li a {
    padding: 10px 15px;
  }

  .recipe-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
  }

  .recipe-modal video {
    max-height: 50vh;
  }
}

.recipe-detail-content {
  padding: 20px;
  font-size: 1.4rem;
}
