/* 昆虫饲养网站样式 - 食谱风格 */

/* CSS 变量 */
:root {
  --accent-color: #ff9800;
  --primary-color: #5d4037;
  --secondary-color: #8d6e63;
  --bg-color: #faf8f5;
  --card-bg: #ffffff;
  --text-color: #3e2723;
  --text-light: #6d4c41;
  --border-color: #d7ccc8;
  --shadow: 0 2px 8px rgba(93, 64, 55, 0.1);
  --shadow-hover: 0 4px 16px rgba(93, 64, 55, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --content-width: 800px;
}

/* 重置 */
* {
  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.7;
  color: var(--text-color);
  background-color: var(--bg-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  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;
}

.content-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
}

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

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

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

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

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-light);
}

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

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

.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 0.9rem;
  width: 100%;
  color: var(--text-color);
}

.search-box input::placeholder {
  color: var(--text-light);
}

/* 面包屑 */
.breadcrumb {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
}

.breadcrumb .container {
  font-size: 0.875rem;
  color: var(--text-light);
}

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

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

.breadcrumb span {
  margin: 0 8px;
  color: var(--border-color);
}

/* 主内容区 */
.main {
  padding: 40px 0;
  min-height: calc(100vh - 64px - 200px);
}

/* Hero 区域 */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.hero p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero .cta-btn {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 14px 32px;
  border-radius: 28px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.hero .cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 152, 0, 0.4);
  color: #fff;
}

/* 特色卡片 */
.featured-section {
  padding: 48px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

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

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

.featured-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.featured-card .card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--secondary-color), var(--border-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 3rem;
}

.featured-card .card-body {
  padding: 20px;
}

.featured-card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.featured-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* 内容列表 */
.content-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content-item {
  display: flex;
  gap: 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s;
}

.content-item:hover {
  box-shadow: var(--shadow-hover);
}

.content-item .item-img {
  width: 160px;
  height: 120px;
  background: linear-gradient(135deg, var(--border-color), var(--bg-color));
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 2rem;
}

.content-item .item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.content-item h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.content-item p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-item .meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-light);
}

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

/* 三栏列表 */
.three-col-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 48px 0;
  border-top: 1px solid var(--border-color);
}

.col-list h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary-color);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
}

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

.col-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-light);
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
}

.col-list li a::before {
  content: "•";
  color: var(--accent-color);
  font-weight: bold;
}

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

/* 分类页特定样式 */
.category-header {
  background: var(--card-bg);
  padding: 40px 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}

.category-header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.category-header p {
  color: var(--text-light);
  max-width: 600px;
}

.category-header .stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
}

.category-header .stats span {
  font-size: 0.9rem;
  color: var(--text-light);
}

.category-header .stats strong {
  color: var(--accent-color);
  font-size: 1.25rem;
  margin-right: 4px;
}

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

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

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

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

/* 文章页样式 */
.article-header {
  text-align: center;
  padding: 40px 0;
}

.article-header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 16px;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.875rem;
  color: var(--text-light);
}

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

.article-featured-img {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, var(--secondary-color), var(--border-color));
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 4rem;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-color);
}

.article-content h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin: 40px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.article-content h3 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin: 32px 0 16px;
}

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

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

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

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

.article-content blockquote {
  background: var(--bg-color);
  border-left: 4px solid var(--accent-color);
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-light);
}

/* 步骤说明样式 - 食谱风格 */
.step-list {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 32px 0;
}

.step-item {
  display: flex;
  gap: 20px;
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--accent-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.step-content p {
  margin-bottom: 0;
  color: var(--text-light);
}

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

.ingredient-list h4 {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

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

.ingredient-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-color);
}

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

/* 信息卡片 */
.info-box {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
  border-left: 4px solid var(--accent-color);
}

.info-box h4 {
  color: var(--primary-color);
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.info-box p {
  margin-bottom: 0;
  color: var(--text-light);
}

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

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

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

.related-card:hover {
  box-shadow: var(--shadow-hover);
}

.related-card .card-img {
  height: 140px;
  background: linear-gradient(135deg, var(--border-color), var(--bg-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 2rem;
}

.related-card .card-body {
  padding: 16px;
}

.related-card h4 {
  font-size: 0.95rem;
  color: var(--primary-color);
  margin-bottom: 8px;
  line-height: 1.4;
}

.related-card .meta {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* 两栏布局 */
.two-col-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 32px 0;
  border-top: 1px solid var(--border-color);
}

/* 404页面 */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

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

.error-page h1 {
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.error-page p {
  color: var(--text-light);
  margin-bottom: 32px;
}

.error-page .btn {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 14px 32px;
  border-radius: 28px;
  font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s;
}

.error-page .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 152, 0, 0.4);
  color: #fff;
}

/* 页脚 */
.footer {
  background: var(--primary-color);
  color: #fff;
  padding: 48px 0 24px;
}

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

.footer-brand h3 {
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.footer-brand h3 span {
  color: var(--accent-color);
}

.footer-brand p {
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.7;
}

.footer-links h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--accent-color);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.9rem;
  color: #fff;
  opacity: 0.8;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.7;
}

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

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

  .footer-content {
    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%;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
  }

  .search-box {
    width: 150px;
  }

  .hero {
    padding: 48px 0;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

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

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

  .content-item .item-img {
    width: 100%;
    height: 180px;
  }

  .three-col-section {
    grid-template-columns: 1fr;
  }

  .two-col-section {
    grid-template-columns: 1fr;
  }

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

  .article-header h1 {
    font-size: 1.5rem;
  }

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

  .article-meta {
    flex-wrap: wrap;
    gap: 12px;
  }

  .step-item {
    flex-direction: column;
    gap: 12px;
  }

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

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .error-code {
    font-size: 5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .main {
    padding: 24px 0;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .category-header {
    padding: 24px 0;
  }

  .category-header h1 {
    font-size: 1.5rem;
  }

  .pagination a,
  .pagination span {
    min-width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
}
