/* ============================================
   马拉松 - 马赛克杂志风格样式
   主色调: #673ab7 (紫色)
   ============================================ */

/* CSS 变量 */
:root {
  --accent-color: #673ab7;
  --accent-light: #9575cd;
  --accent-dark: #512da8;
  --text-primary: #212121;
  --text-secondary: #757575;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --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: 4px;
  --transition: all 0.3s ease;
}

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

html {
  font-size: 16px;
}

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-primary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

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

ul {
  list-style: none;
}

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

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

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

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

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

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

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

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

/* ============================================
   面包屑导航
   ============================================ */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

.breadcrumb span {
  margin: 0 8px;
}

/* ============================================
   马赛克网格布局
   ============================================ */
.mosaic-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 40px;
}

/* 首页网格 */
.home-grid {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
}

.headline-card {
  grid-row: span 2;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 400px;
}

.headline-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.headline-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
}

.headline-content .category {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 2px;
  margin-bottom: 12px;
}

.headline-content h2 {
  font-size: 1.75rem;
  line-height: 1.3;
  margin-bottom: 8px;
}

.headline-content p {
  opacity: 0.9;
  font-size: 0.9375rem;
}

/* 侧边栏小部件 */
.sidebar-widget {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
}

.sidebar-widget h3 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

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

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

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

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

.widget-list .meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 特色内容区 */
.feature-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.feature-large {
  grid-row: span 2;
}

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

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

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

.card-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

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

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

.card-image .category {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 2px;
}

.card-content {
  padding: 16px;
}

.card-content h3 {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.card-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-content .meta {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

/* ============================================
   三栏内容区
   ============================================ */
.three-col-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
}

.col-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

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

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

.article-list a {
  font-size: 0.9375rem;
  display: block;
}

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

/* ============================================
   分类页布局
   ============================================ */
.category-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

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

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

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
}

.hero-content h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.lead-story {
  grid-column: span 1;
  grid-row: span 2;
}

.lead-story .card-image img {
  height: 100%;
  min-height: 380px;
}

/* ============================================
   文章详情页
   ============================================ */
.article-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  padding: 24px 0 40px;
}

.article-header {
  margin-bottom: 24px;
}

.article-category {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 2px;
  margin-bottom: 16px;
}

.article-title {
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 16px;
}

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

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

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

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

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

.article-body h2 {
  font-size: 1.375rem;
  margin: 32px 0 16px;
  color: var(--accent-dark);
}

.article-body h3 {
  font-size: 1.125rem;
  margin: 24px 0 12px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 20px 24px;
}

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

.article-body strong {
  color: var(--accent-dark);
}

/* 内联媒体 */
.inline-media {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
}

.inline-media h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--accent-color);
}

/* 侧边栏 */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.author-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
}

.author-card h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

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

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 14px;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 0.8125rem;
  transition: var(--transition);
}

.tag:hover {
  background: var(--accent-color);
  color: #fff;
}

/* ============================================
   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: 16px;
}

.error-title {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

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

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
}

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

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

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

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

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

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 16px;
}

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

.footer-col a {
  font-size: 0.875rem;
  opacity: 0.7;
}

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

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

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

  .headline-card {
    grid-row: span 1;
    min-height: 300px;
  }

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

  .feature-large {
    grid-row: span 1;
  }

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

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

  .lead-story {
    grid-column: span 2;
    grid-row: span 1;
  }

  .lead-story .card-image img {
    min-height: 200px;
  }

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

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

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .headline-content h2 {
    font-size: 1.25rem;
  }

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

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

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

  .lead-story {
    grid-column: span 1;
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-title {
    font-size: 1.5rem;
  }

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

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

/* ============================================
   辅助类
   ============================================ */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}
