/* 分子料理 - 样式表 */
/* 变量定义 */
:root {
  --accent-color: #ff9800;
  --primary-color: #2c3e50;
  --secondary-color: #34495e;
  --text-color: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg-color: #fff;
  --bg-light: #f8f9fa;
  --bg-dark: #2c3e50;
  --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', 'PingFang SC', 'Hiragino Sans GB', '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 {
  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 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
}

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

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

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

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

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

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

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

/* 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: 42px;
  font-weight: 700;
  margin-bottom: 16px;
}

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

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

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

/* 特色区域 */
.features {
  padding: 60px 0;
  background: var(--bg-light);
}

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

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

.feature-card {
  background: var(--bg-color);
  padding: 32px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.feature-icon {
  width: 64px;
  height: 64px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
}

.feature-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--primary-color);
}

.feature-card p {
  color: var(--text-light);
  font-size: 15px;
}

/* 内容区域 */
.content-section {
  padding: 60px 0;
}

.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: transform 0.3s, box-shadow 0.3s;
}

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

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

.content-card .info {
  padding: 20px;
  flex: 1;
}

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

.content-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
  color: var(--primary-color);
}

.content-card .desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-card .meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

/* 三栏区域 */
.three-col {
  padding: 60px 0;
  background: var(--bg-light);
}

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

.col-box {
  background: var(--bg-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.col-box h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
  color: var(--primary-color);
}

.col-box li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.col-box li:last-child {
  border-bottom: none;
}

.col-box a {
  display: block;
  font-size: 15px;
  color: var(--text-color);
}

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

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

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

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

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

.footer-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  line-height: 1.8;
}

.footer-col h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

.footer-col li {
  margin-bottom: 12px;
}

.footer-col a {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
}

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

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

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

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

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

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

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

.category-header p {
  color: var(--text-light);
  font-size: 16px;
}

.category-header .stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 24px;
}

.category-header .stat {
  text-align: center;
}

.category-header .stat .num {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-color);
}

.category-header .stat .label {
  font-size: 14px;
  color: var(--text-light);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: 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);
  font-size: 14px;
  color: var(--text-color);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
}

.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 {
  padding: 48px 0 32px;
  text-align: center;
}

.article-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 20px;
  line-height: 1.4;
}

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

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

.article-featured-img {
  width: 100%;
  max-width: 800px;
  height: 400px;
  background: var(--bg-light);
  margin: 0 auto 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

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

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

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

.article-content p {
  margin-bottom: 20px;
  line-height: 1.8;
  color: var(--text-color);
}

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

.article-content li {
  margin-bottom: 10px;
  line-height: 1.8;
}

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

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

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

.ingredient-list h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.ingredient-list ul {
  padding: 0;
}

.ingredient-list li {
  list-style: none;
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

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

/* 步骤说明 */
.step-list {
  counter-reset: step;
  padding: 0;
}

.step-list li {
  list-style: none;
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  padding: 24px;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
}

.step-list li::before {
  counter-increment: step;
  content: counter(step);
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

/* 相关文章 */
.related-section {
  background: var(--bg-light);
  padding: 48px 0;
}

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

.related-card {
  background: var(--bg-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.related-card .thumb {
  height: 160px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

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

.related-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
}

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

.error-content h1 {
  font-size: 120px;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
}

.error-content h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 16px;
}

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

.error-content .btn {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 14px 32px;
  border-radius: 30px;
  font-weight: 600;
}

.error-content .btn:hover {
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,152,0,0.4);
}

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

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

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

  .related-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%;
    margin-top: 12px;
    gap: 20px;
    justify-content: center;
  }

  .hero {
    padding: 60px 0;
  }

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

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

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

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

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

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

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

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

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

  .article-header h1 {
    font-size: 24px;
  }

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

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

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

@media (max-width: 480px) {
  .hero h1 {
    font-size: 24px;
  }

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

  .error-content h1 {
    font-size: 80px;
  }

  .error-content h2 {
    font-size: 22px;
  }
}
