/* ========================================
   摩托车赛事 - 马赛克杂志风格样式
   主色调: #673ab7 (紫色)
   ======================================== */

/* CSS 变量 */
:root {
  --accent-color: #673ab7;
  --accent-light: #9c27b0;
  --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;
  --gap: 20px;
  --max-width: 1200px;
}

/* 重置样式 */
* {
  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 {
  text-decoration: none;
  color: var(--accent-color);
  transition: color 0.2s;
}

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

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

/* ========================================
   页头 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: 24px;
  font-weight: 700;
  color: var(--accent-color);
}

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

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

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

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

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

.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 {
  color: #aaa;
  font-size: 14px;
  line-height: 1.8;
}

.footer-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  color: #fff;
}

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

.footer-links a {
  color: #aaa;
  font-size: 14px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 24px;
  text-align: center;
  color: #888;
  font-size: 14px;
}

/* ========================================
   面包屑导航
   ======================================== */
.breadcrumb {
  padding: 16px 0;
  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;
}

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

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

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

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

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

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

.card-body {
  padding: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.card-title a {
  color: inherit;
}

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

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

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

/* ========================================
   首页 - 马赛克网格布局
   ======================================== */
.home-main {
  padding: 32px 0;
}

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

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

.headline-main .card-image {
  position: absolute;
  inset: 0;
}

.headline-main .card-image img {
  height: 100%;
}

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

.headline-main .card-title {
  font-size: 28px;
  color: #fff;
  margin-bottom: 16px;
}

.headline-main .card-title a:hover {
  color: var(--accent-light);
}

.headline-main .card-meta {
  color: rgba(255,255,255,0.8);
}

.headline-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.headline-sidebar .card {
  flex: 1;
}

.headline-sidebar .card-image {
  height: 120px;
}

.headline-sidebar .card-title {
  font-size: 15px;
}

/* 特色内容网格 */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 280px 280px;
  gap: var(--gap);
  margin-bottom: 40px;
}

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

.featured-large .card-image {
  height: 100%;
}

.featured-large .card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
}

.featured-large .card-title {
  color: #fff;
  font-size: 22px;
}

.featured-large .card-title a:hover {
  color: var(--accent-light);
}

.featured-item .card-image {
  height: 160px;
}

.featured-item .card-title {
  font-size: 16px;
}

/* 三栏文章列表 */
.three-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
}

.column-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--accent-color);
  display: inline-block;
}

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

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

.article-list a {
  color: var(--text-primary);
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
}

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

.article-list .meta {
  font-size: 13px;
  color: var(--text-secondary);
}

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

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

.category-hero-main .card-image {
  position: absolute;
  inset: 0;
}

.category-hero-main .card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: #fff;
  padding: 32px;
}

.category-hero-main .card-title {
  font-size: 24px;
  color: #fff;
}

.category-sidebar .widget {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: var(--gap);
}

.category-sidebar .widget-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

.category-tag {
  display: inline-block;
  background: var(--bg-primary);
  padding: 6px 14px;
  margin: 4px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

/* 分类内容网格 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: 40px;
}

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

.category-grid .lead-story .card-image {
  height: 280px;
}

.category-grid .lead-story .card-title {
  font-size: 20px;
}

.category-grid .grid-item .card-image {
  height: 160px;
}

.category-grid .grid-item .card-title {
  font-size: 15px;
}

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

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

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

.article-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
  color: var(--text-primary);
}

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

.article-meta .author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-meta .author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}

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

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

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

.article-content h2 {
  font-size: 26px;
  font-weight: 600;
  margin: 40px 0 20px;
  color: var(--text-primary);
}

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

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

.article-content ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

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

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

/* 文章侧边栏 */
.article-sidebar .widget {
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.article-sidebar .widget-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

.author-card {
  text-align: center;
}

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

.author-card .author-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.author-card .author-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

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

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

.related-list a {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

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

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--bg-primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

/* ========================================
   404 页面
   ======================================== */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 0;
}

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

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

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

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

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

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

/* ========================================
   推荐文章区域 (通用)
   ======================================== */
.recommended-section {
  padding: 48px 0;
  border-top: 1px solid var(--border-color);
}

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

.related-tags {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.related-tags a {
  color: var(--text-secondary);
  font-size: 14px;
}

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

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

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

  .headline-sidebar {
    flex-direction: row;
  }

  .headline-sidebar .card {
    flex: 1;
  }

  .featured-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .featured-large {
    grid-column: span 2;
    grid-row: span 1;
  }

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

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

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

  .article-sidebar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

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

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
  }

  .nav {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    gap: 20px;
    flex-wrap: wrap;
  }

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

  .headline-main .card-title {
    font-size: 20px;
  }

  .headline-sidebar {
    flex-direction: column;
  }

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

  .featured-large {
    grid-column: span 1;
  }

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

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

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

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

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

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

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

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

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

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

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

  .headline-main .card-body {
    padding: 20px;
  }

  .headline-main .card-title {
    font-size: 18px;
  }

  .article-content {
    font-size: 16px;
  }

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

  .article-content h3 {
    font-size: 18px;
  }
}
