/* ========================================
   有氧运动 - 全局样式
   www.jijianhuwai.cn
   ======================================== */

/* CSS 变量 */
:root {
  --accent-color: #e91e63;
  --accent-light: #f8bbd9;
  --accent-dark: #c2185b;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --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', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
}

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

ul {
  list-style: none;
}

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

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

.section {
  padding: 60px 0;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

/* ========================================
   页头 Header
   ======================================== */
.header {
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
}

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

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

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

.search-box {
  position: relative;
}

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

.search-box input:focus {
  width: 240px;
  border-color: var(--accent-color);
}

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

.hero-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search {
  max-width: 500px;
  margin: 0 auto;
}

.hero-search input {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  box-shadow: var(--shadow);
}

/* ========================================
   分类卡片
   ======================================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.category-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s;
}

.category-card:hover {
  border-color: var(--accent-color);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

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

.category-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.category-card p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ========================================
   内容卡片
   ======================================== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.content-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
}

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

.content-card-image {
  width: 100%;
  height: 180px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}

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

.content-card-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.content-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.content-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ========================================
   文章列表
   ======================================== */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: all 0.3s;
}

.article-item:hover {
  border-color: var(--accent-color);
  box-shadow: var(--shadow);
}

.article-item-image {
  width: 200px;
  height: 140px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

.article-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-item-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.article-item h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.article-item p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-item-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: auto;
}

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

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

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

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

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

.category-header h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

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

/* ========================================
   筛选器
   ======================================== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

/* ========================================
   分页
   ======================================== */
.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: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.3s;
}

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

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

/* ========================================
   文章详情页
   ======================================== */
.article-header {
  padding: 48px 0 32px;
  text-align: center;
}

.article-header h1 {
  font-size: 32px;
  margin-bottom: 16px;
  line-height: 1.4;
}

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

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

.article-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.8;
}

.article-content h2 {
  font-size: 24px;
  margin: 40px 0 20px;
}

.article-content h3 {
  font-size: 20px;
  margin: 32px 0 16px;
}

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

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

.article-content li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

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

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

/* ========================================
   三栏内容区
   ======================================== */
.three-col-section {
  background: var(--bg-secondary);
}

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

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

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

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

.col-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.col-list a::before {
  content: '•';
  color: var(--accent-color);
}

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

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

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

.error-title {
  font-size: 28px;
  margin-bottom: 12px;
}

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

.btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius);
  font-size: 16px;
  transition: background 0.3s;
}

.btn:hover {
  background: var(--accent-dark);
}

/* ========================================
   页脚 Footer
   ======================================== */
.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;
  color: var(--accent-color);
}

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

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

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

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

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

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

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

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

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

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

@media (max-width: 768px) {
  .header .container {
    flex-wrap: wrap;
  }

  .nav {
    display: none;
  }

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

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

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

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

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

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

  .article-item-image {
    width: 100%;
    height: 200px;
  }

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

  .article-cover {
    height: 240px;
  }

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

  .section {
    padding: 40px 0;
  }

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