/* ===== 沙漠穿越 - 马赛克杂志风格 CSS ===== */
/* 主色调: 沙漠橙/棕色系 */
:root {
  --primary-color: #c75b39;
  --accent-color: #d4a574;
  --dark-color: #2c1810;
  --light-color: #f5f0eb;
  --text-color: #333;
  --text-muted: #666;
  --border-color: #e0d5cc;
  --card-bg: #fff;
  --header-height: 70px;
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
  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-color);
  background-color: var(--light-color);
}

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

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

ul {
  list-style: none;
}

/* ===== 头部导航 ===== */
.header {
  background: var(--dark-color);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

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

.nav a {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.3s;
}

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

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

/* ===== 面包屑导航 ===== */
.breadcrumb {
  padding: 15px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary-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 auto;
  grid-template-areas:
    "headline sidebar"
    "feature stories"
    "feature stories2";
}

.headline-area {
  grid-area: headline;
}

.sidebar-area {
  grid-area: sidebar;
}

.feature-large {
  grid-area: feature;
}

.stories-area {
  grid-area: stories;
}

.stories-area-2 {
  grid-area: stories2;
}

/* ===== 卡片组件 ===== */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

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

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

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

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

.card-content {
  padding: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--dark-color);
}

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

.card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 15px;
}

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

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

/* 头条卡片 */
.headline-card .card-image {
  height: 350px;
}

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

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

/* 特色大卡片 */
.feature-card .card-image {
  height: 400px;
}

.feature-card .card-title {
  font-size: 22px;
}

/* 小卡片 */
.small-card {
  display: flex;
  gap: 15px;
}

.small-card .card-image {
  width: 120px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 8px;
}

.small-card .card-content {
  padding: 0;
}

.small-card .card-title {
  font-size: 15px;
  margin-bottom: 8px;
}

.small-card .card-meta {
  font-size: 12px;
}

/* 故事网格 */
.stories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

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

/* ===== 侧边栏组件 ===== */
.sidebar-widget {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.widget-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark-color);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: 15px;
  text-transform: uppercase;
}

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

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

.widget-list a {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.widget-list .num {
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.widget-list .num.gray {
  background: var(--text-muted);
}

.widget-list .text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-color);
}

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

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

.column-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-color);
}

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

.article-list a {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--text-color);
}

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

.article-list .dot {
  color: var(--primary-color);
  font-weight: bold;
}

/* ===== 分类页布局 ===== */
.category-grid {
  grid-template-columns: 2fr 1fr;
  grid-template-areas:
    "hero sidebar"
    "lead items";
}

.category-hero {
  grid-area: hero;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 350px;
}

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

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

.category-hero-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
}

.category-hero-desc {
  font-size: 15px;
  opacity: 0.9;
}

.lead-story {
  grid-area: lead;
}

.lead-story .card-image {
  height: 300px;
}

.items-grid {
  grid-area: items;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.items-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.item-card .card-image {
  height: 180px;
}

/* ===== 文章页布局 ===== */
.article-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.article-main {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.article-header {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

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

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

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

.article-image {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 30px;
}

.article-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

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

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

.article-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark-color);
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark-color);
  margin: 30px 0 15px;
}

.article-content img {
  border-radius: 8px;
  margin: 20px 0;
}

/* 作者卡片 */
.author-card {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 20px;
  background: var(--light-color);
  border-radius: 8px;
  margin-bottom: 20px;
}

.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
}

.author-info h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark-color);
}

.author-info p {
  font-size: 13px;
  color: var(--text-muted);
}

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--light-color);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-color);
  transition: all 0.3s;
}

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

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

.error-code {
  font-size: 120px;
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 20px;
  text-shadow: 4px 4px 0 var(--accent-color);
}

.error-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 15px;
}

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

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn:hover {
  background: var(--dark-color);
  transform: translateY(-2px);
}

/* ===== 页脚 ===== */
.footer {
  background: var(--dark-color);
  color: #fff;
  padding: 50px 0 30px;
  margin-top: 60px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.footer-brand .logo {
  margin-bottom: 15px;
}

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

.footer-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--accent-color);
}

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

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

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

.footer-bottom {
  padding-top: 30px;
  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: 992px) {
  .home-grid,
  .category-grid,
  .article-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "headline"
      "sidebar"
      "feature"
      "stories"
      "stories2";
  }

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

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

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

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

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

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

  .items-row {
    grid-template-columns: 1fr;
  }

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

  .headline-card .card-image {
    height: 250px;
  }

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

  .article-main {
    padding: 25px;
  }

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

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

@media (max-width: 480px) {
  .small-card {
    flex-direction: column;
  }

  .small-card .card-image {
    width: 100%;
    height: 150px;
  }

  .category-hero-title {
    font-size: 24px;
  }
}
