/* ========================================
   攀岩装备 - 杂志风格样式
   www.yuesais.cn - 专注于攀岩运动的综合平台
   ======================================== */

/* CSS 变量 */
:root {
  --accent-color: #e91e63;
  --primary-dark: #1a1a2e;
  --primary-light: #16213e;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --bg-white: #fff;
  --bg-light: #f5f5f5;
  --bg-gray: #e8e8e8;
  --border-color: #ddd;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 4px;
  --radius-lg: 8px;
  --max-width: 1200px;
  --gap: 24px;
  --gap-sm: 16px;
}

/* 重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-white);
}

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

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

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

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

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

.nav {
  display: flex;
  gap: var(--gap);
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s;
}

.nav a:hover::after {
  width: 100%;
}

/* ========================================
   Breadcrumb 面包屑
   ======================================== */
.breadcrumb {
  background: var(--bg-light);
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

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

.breadcrumb span {
  margin: 0 0.5rem;
  color: var(--text-light);
}

/* ========================================
   Main 主体区域
   ======================================== */
.main {
  padding: var(--gap) 0;
}

/* ========================================
   Hero 头条区域
   ======================================== */
.hero-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.hero-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 400px;
}

.hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--gap);
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: var(--bg-white);
}

.hero-overlay .tag {
  display: inline-block;
  background: var(--accent-color);
  color: var(--bg-white);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.hero-overlay h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.hero-overlay p {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Sidebar 侧边栏 */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.widget {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: var(--gap-sm);
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--gap-sm);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.widget-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.widget-list a {
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
}

.widget-list .meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

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

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

.card-image {
  position: relative;
  overflow: hidden;
}

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

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

.card-tag {
  position: absolute;
  top: var(--gap-sm);
  left: var(--gap-sm);
  background: var(--accent-color);
  color: var(--bg-white);
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius);
}

.card-content {
  padding: var(--gap-sm);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: var(--gap-sm);
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ========================================
   Grid 网格布局
   ======================================== */
.grid-section {
  margin-bottom: var(--gap);
}

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

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

.grid-mixed {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: var(--gap);
}

.grid-mixed .card-large {
  grid-row: span 2;
}

.grid-mixed .card-large .card-image img {
  height: 100%;
  min-height: 420px;
}

/* ========================================
   Section 区块
   ======================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--bg-gray);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -0.85rem;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--accent-color);
}

.section-more {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

/* ========================================
   List 列表
   ======================================== */
.list-section {
  background: var(--bg-light);
  padding: var(--gap) 0;
}

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

.list-column h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--gap-sm);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.list-items li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.list-items a {
  font-size: 0.9rem;
  display: block;
}

/* ========================================
   Category 分类页
   ======================================== */
.category-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.category-info {
  background: var(--primary-dark);
  color: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.category-info h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.category-info p {
  font-size: 1rem;
  opacity: 0.9;
  line-height: 1.6;
}

.category-stats {
  display: flex;
  gap: var(--gap);
  margin-top: var(--gap-sm);
  padding-top: var(--gap-sm);
  border-top: 1px solid rgba(255,255,255,0.2);
}

.category-stats span {
  font-size: 0.85rem;
}

.category-stats strong {
  color: var(--accent-color);
}

/* ========================================
   Article 文章页
   ======================================== */
.article-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
}

.article-main {
  background: var(--bg-white);
}

.article-header {
  margin-bottom: var(--gap);
}

.article-header .tag {
  display: inline-block;
  background: var(--accent-color);
  color: var(--bg-white);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius);
  margin-bottom: var(--gap-sm);
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--gap-sm);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.article-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--gap);
}

.article-image img {
  width: 100%;
  height: auto;
}

.article-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-gray);
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

.article-content ul, .article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-content ul li {
  list-style: disc;
  margin-bottom: 0.5rem;
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: var(--gap);
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article-content img {
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
}

/* Author Widget */
.author-widget {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: var(--gap-sm);
  background: var(--bg-light);
  border-radius: var(--radius-lg);
}

.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info h4 {
  font-size: 1rem;
  font-weight: 600;
}

.author-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Tags Widget */
.tags-widget .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags-widget .tag {
  display: inline-block;
  background: var(--bg-gray);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius);
  transition: background 0.3s;
}

.tags-widget .tag:hover {
  background: var(--accent-color);
  color: var(--bg-white);
}

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

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

.error-content h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.error-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--accent-color);
  color: var(--bg-white);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background 0.3s;
}

.btn:hover {
  background: #c2185b;
  color: var(--bg-white);
}

/* ========================================
   Footer 页脚
   ======================================== */
.footer {
  background: var(--primary-dark);
  color: var(--bg-white);
  padding: var(--gap) 0;
  margin-top: var(--gap);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.footer-brand .logo {
  margin-bottom: var(--gap-sm);
}

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

.footer-column h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--gap-sm);
}

.footer-column ul li {
  margin-bottom: 0.5rem;
}

.footer-column ul li a {
  font-size: 0.9rem;
  opacity: 0.8;
}

.footer-column ul li a:hover {
  opacity: 1;
}

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

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 992px) {
  .hero-section,
  .category-hero,
  .article-layout {
    grid-template-columns: 1fr;
  }

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

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

  .grid-mixed .card-large {
    grid-row: span 1;
  }

  .grid-mixed .card-large .card-image img {
    min-height: 200px;
  }

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

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

@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    gap: var(--gap-sm);
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--gap-sm);
  }

  .hero-overlay h1 {
    font-size: 1.25rem;
  }

  .grid-3,
  .grid-4,
  .grid-mixed {
    grid-template-columns: 1fr;
  }

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

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

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

  .error-content h1 {
    font-size: 5rem;
  }

  .error-content h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  :root {
    --gap: 16px;
    --gap-sm: 12px;
  }

  html {
    font-size: 14px;
  }

  .hero-main {
    min-height: 300px;
  }
}
