/* ========================================
   集成灶 - 智能灶具资讯网站样式
   食谱集风格 + 三列卡片网格布局
   ======================================== */

/* CSS 变量定义 */
:root {
  --accent-color: #e91e63;
  --primary-color: #ff6b35;
  --secondary-color: #f7931e;
  --text-dark: #333;
  --text-medium: #666;
  --text-light: #999;
  --bg-light: #f8f9fa;
  --bg-white: #fff;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --max-width: 1200px;
  --gap: 24px;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

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

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

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

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

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

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

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

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

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

.search-box {
  position: relative;
}

.search-box input {
  width: 240px;
  height: 40px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.search-box input:focus {
  border-color: var(--primary-color);
}

.search-box button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
}

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

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

.hero-title span {
  color: var(--primary-color);
}

.hero-desc {
  font-size: 18px;
  color: var(--text-medium);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tag {
  padding: 8px 20px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-medium);
  transition: all 0.3s;
}

.tag:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.tag.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* ========================================
   Section 标题
   ======================================== */
.section {
  padding: 48px 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-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.section-more {
  font-size: 14px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.3s;
}

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

/* ========================================
   卡片网格布局 - 三列
   ======================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* ========================================
   卡片组件
   ======================================== */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-light);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  background: var(--primary-color);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
}

.card-content {
  padding: 16px;
}

.card-category {
  font-size: 12px;
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 8px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-light);
}

.card-meta-left {
  display: flex;
  gap: 16px;
}

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

.difficulty-tag {
  padding: 2px 8px;
  background: var(--bg-light);
  border-radius: 4px;
  font-size: 12px;
}

.difficulty-easy {
  color: #4caf50;
  background: #e8f5e9;
}

.difficulty-medium {
  color: #ff9800;
  background: #fff3e0;
}

.difficulty-hard {
  color: #f44336;
  background: #ffebee;
}

/* ========================================
   加载更多
   ======================================== */
.load-more {
  text-align: center;
  padding: 32px 0;
}

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

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

.btn-primary:hover {
  background: #e55a2b;
}

.btn-outline {
  background: var(--bg-white);
  color: var(--text-medium);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ========================================
   文章列表组件
   ======================================== */
.article-list-section {
  background: var(--bg-white);
  padding: 48px 0;
}

.article-list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.article-list {
  background: var(--bg-light);
  border-radius: var(--radius-md);
  padding: 20px;
}

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

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

.article-list li a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-medium);
  line-height: 1.5;
  transition: color 0.3s;
}

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

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

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

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

.footer-brand .logo {
  color: #fff;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.8;
}

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

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

.footer-links a {
  font-size: 14px;
  color: var(--text-light);
  transition: color 0.3s;
}

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

.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}

/* ========================================
   面包屑导航
   ======================================== */
.breadcrumb {
  background: var(--bg-white);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-medium);
}

.breadcrumb-inner a {
  color: var(--text-medium);
  transition: color 0.3s;
}

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

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

.breadcrumb-current {
  color: var(--text-dark);
  font-weight: 500;
}

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

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

.category-desc {
  font-size: 16px;
  color: var(--text-medium);
  margin-bottom: 24px;
}

.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 20px;
  font-size: 14px;
  color: var(--text-medium);
  background: var(--bg-light);
  border-radius: 20px;
  transition: all 0.3s;
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--primary-color);
  color: #fff;
}

/* ========================================
   分页
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px 0;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-medium);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.3s;
}

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

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

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

/* ========================================
   文章详情页
   ======================================== */
.article-header {
  background: var(--bg-white);
  padding: 32px 0;
}

.article-featured-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

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

.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--text-medium);
}

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

.article-meta-divider {
  color: var(--border-color);
}

.article-content-wrap {
  background: var(--bg-white);
  padding: 32px 0 48px;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-dark);
}

.article-content h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bg-light);
}

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

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

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

.article-content li {
  margin-bottom: 8px;
}

.article-content img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 24px 0;
}

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

.article-actions {
  display: flex;
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 32px;
}

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

/* ========================================
   404 页面
   ======================================== */
.error-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px var(--gap);
}

.error-content {
  max-width: 480px;
}

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

.error-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}

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

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

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

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

@media (max-width: 768px) {
  :root {
    --gap: 16px;
  }

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }

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

  .search-box input {
    width: 180px;
  }

  .hero {
    padding: 40px 0;
  }

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

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

  .card-grid,
  .article-list-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 32px 0;
  }

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

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

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

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

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

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

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

  .error-actions {
    flex-direction: column;
  }
}

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

  .filter-tabs {
    gap: 6px;
  }

  .filter-tab {
    padding: 6px 14px;
    font-size: 13px;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .article-actions {
    flex-direction: column;
  }
}
