/* 沙漠探险 - 马赛克杂志风格 CSS */
/* 查询关键词: 沙漠探险 www.shamotanxian.cn 专注沙漠越野驾驶 赛车赛事与装备改装 为越野爱好者提供专业内容与路线推荐 */

/* CSS 变量 */
:root {
  --accent-color: #c75b39;
  --accent-dark: #a0482c;
  --bg-primary: #f5f0e8;
  --bg-secondary: #e8e0d4;
  --bg-card: #ffffff;
  --text-primary: #2c2416;
  --text-secondary: #5c4d3c;
  --text-muted: #8b7d6b;
  --border-color: #d4c8b8;
  --shadow: 0 2px 8px rgba(44, 36, 22, 0.1);
  --shadow-hover: 0 4px 16px rgba(44, 36, 22, 0.15);
  --radius: 4px;
  --gap: 20px;
  --max-width: 1200px;
}

/* 重置样式 */
*, *::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;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

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

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: linear-gradient(135deg, #2c2416 0%, #4a3c28 100%);
  color: #fff;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

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

.nav ul {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  transition: color 0.3s;
}

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

/* Breadcrumb */
.breadcrumb {
  background: var(--bg-secondary);
  padding: 0.75rem 0;
  font-size: 0.875rem;
}

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

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

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

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

/* 马赛克网格布局 */
.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

/* 卡片基础样式 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  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: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

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

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

.card-content {
  padding: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-title a {
  color: inherit;
}

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

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

/* 卡片尺寸变体 */
.card-large {
  grid-column: span 2;
  grid-row: span 2;
}

.card-large .card-image {
  height: 280px;
}

.card-large .card-title {
  font-size: 1.35rem;
}

.card-medium {
  grid-column: span 2;
}

.card-medium .card-image {
  height: 160px;
}

.card-small .card-image {
  height: 140px;
}

.card-tall {
  grid-row: span 2;
}

.card-tall .card-image {
  height: 200px;
}

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

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

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

.headline-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(transparent, rgba(44, 36, 22, 0.9));
  color: #fff;
}

.headline-content .card-category {
  position: static;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.headline-content h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

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

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

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

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

/* 特色内容区 */
.featured-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.featured-left .card {
  height: 100%;
}

.featured-left .card-image {
  height: 280px;
}

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

/* 三栏文章列表 */
.three-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  background: var(--bg-secondary);
  padding: var(--gap);
  border-radius: var(--radius);
}

.column h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.column ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.column li {
  position: relative;
  padding-left: 1rem;
}

.column li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-color);
}

.column a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: block;
}

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

.column .meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

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

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

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

.category-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(transparent, rgba(44, 36, 22, 0.9));
  color: #fff;
}

.category-hero-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

/* 文章网格 */
.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.article-grid .card:first-child {
  grid-column: span 2;
}

.article-grid .card:first-child .card-image {
  height: 200px;
}

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

.article-header {
  margin-bottom: 1.5rem;
}

.article-header .card-category {
  position: static;
  display: inline-block;
  margin-bottom: 1rem;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

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

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

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

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

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

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 1rem;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
}

.article-body ul, .article-body ol {
  margin: 1rem 0 1.25rem 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

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

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

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

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

.sidebar-widget {
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar-widget h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

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

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  object-fit: cover;
}

.author-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.author-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--bg-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all 0.3s;
}

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

.sidebar-widget ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-widget li {
  display: flex;
  gap: 0.75rem;
}

.sidebar-widget li img {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 2px;
}

.sidebar-widget li .info {
  flex: 1;
}

.sidebar-widget li .info a {
  font-size: 0.875rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.25rem;
}

.sidebar-widget li .info .meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 推荐区域 */
.recommended-section {
  margin-top: calc(var(--gap) * 1.5);
  padding-top: var(--gap);
  border-top: 1px solid var(--border-color);
}

.recommended-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.related-list {
  display: flex;
  gap: 1.5rem;
  margin-bottom: var(--gap);
}

.related-list a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

/* Footer */
.footer {
  background: #2c2416;
  color: rgba(255, 255, 255, 0.8);
  padding: 2rem 0;
  margin-top: 2rem;
}

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

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

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

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

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

.footer-copy {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

/* 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: 6rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.error-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background 0.3s;
}

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

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

  .card-large {
    grid-column: span 2;
  }

  .headline-section,
  .category-hero,
  .featured-section,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .headline-main {
    height: 300px;
  }

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

  .article-grid .card:first-child {
    grid-column: span 2;
  }

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

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

  .nav ul {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

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

  .card-large,
  .card-medium,
  .card-tall {
    grid-column: span 1;
    grid-row: span 1;
  }

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

  .headline-main {
    height: 250px;
  }

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

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

  .footer .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .related-list {
    flex-direction: column;
    gap: 0.75rem;
  }
}

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

  .logo {
    font-size: 1.25rem;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .card-large .card-title {
    font-size: 1.1rem;
  }
}
