/* ===== 户外背包 - 新闻门户风格样式表 ===== */

/* ===== CSS 变量定义 ===== */
:root {
  --accent-color: #c62828;
  --accent-hover: #a31515;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --bg-dark: #1a1a1a;
  --border-color: #e0e0e0;
  --sidebar-width: 200px;
  --header-height: 60px;
  --max-width: 1200px;
  --gap: 20px;
}

/* ===== 重置与基础样式 ===== */
*, *::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-secondary);
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

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

.main-wrapper {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  gap: var(--gap);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--gap);
}

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

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

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

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

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

.nav a {
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

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

.search-box {
  display: flex;
  align-items: center;
}

.search-box input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px 0 0 4px;
  width: 200px;
  outline: none;
}

.search-box button {
  padding: 0.5rem 1rem;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.search-box button:hover {
  background: var(--accent-hover);
}

/* ===== 滚动新闻条 ===== */
.ticker-bar {
  background: var(--bg-dark);
  color: white;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.ticker-bar .container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ticker-label {
  background: var(--accent-color);
  padding: 0.25rem 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.ticker-content {
  flex: 1;
  overflow: hidden;
}

.ticker-content a {
  color: #ccc;
  margin-right: 2rem;
}

.ticker-content a:hover {
  color: white;
}

/* ===== Hero 区域 ===== */
.hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #333 100%);
  color: white;
  padding: 3rem var(--gap);
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.125rem;
  color: #ccc;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== 侧边栏 ===== */
.sidebar {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 4px;
}

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

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-section h4 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.sidebar-section ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-section ul li:last-child {
  border-bottom: none;
}

.sidebar-section ul li a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: block;
}

.sidebar-section ul li a:hover {
  color: var(--accent-color);
}

/* ===== 主内容区 ===== */
.main-content {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 4px;
}

/* ===== 内容卡片 ===== */
.content-card {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.content-card:last-child {
  border-bottom: none;
}

.content-card.featured {
  flex-direction: column;
  padding: 0 0 1.5rem;
}

.content-card.featured .card-image {
  width: 100%;
  height: 200px;
}

.card-image {
  width: 120px;
  height: 80px;
  background: var(--bg-secondary);
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
}

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

.card-content {
  flex: 1;
}

.card-category {
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

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

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

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

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

.card-meta span {
  margin-right: 1rem;
}

/* ===== 精选区域 ===== */
.featured-section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

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

/* ===== 列表区域 ===== */
.list-section {
  margin-bottom: 2rem;
}

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

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

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

.breadcrumb span {
  margin: 0 0.5rem;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.875rem;
}

.pagination a:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.pagination .current {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* ===== 文章页样式 ===== */
.article-header {
  margin-bottom: 1.5rem;
}

.article-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

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

.article-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
}

.article-featured-image {
  width: 100%;
  height: 300px;
  background: var(--bg-secondary);
  border-radius: 4px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

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

.article-content {
  font-size: 1rem;
  line-height: 1.8;
}

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

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

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

.article-content ul,
.article-content ol {
  margin-bottom: 1rem;
  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: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-content img {
  max-width: 100%;
  border-radius: 4px;
  margin: 1rem 0;
}

/* ===== 目录 ===== */
.toc {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.toc-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.toc ul li {
  padding: 0.25rem 0;
  font-size: 0.875rem;
}

.toc ul li a {
  color: var(--text-secondary);
}

.toc ul li a:hover {
  color: var(--accent-color);
}

/* ===== 作者卡片 ===== */
.author-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 4px;
  text-align: center;
}

.author-card .author-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
}

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

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

/* ===== 标签云 ===== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-cloud a {
  padding: 0.25rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 0.75rem;
}

.tag-cloud a:hover {
  background: var(--accent-color);
  color: white;
}

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

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.footer-section h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: white;
}

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

.footer-section ul li a {
  color: #999;
  font-size: 0.875rem;
}

.footer-section ul li a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #333;
  margin-top: 2rem;
  padding-top: 1rem;
  text-align: center;
  color: #666;
  font-size: 0.875rem;
}

/* ===== 404 页面 ===== */
.error-page {
  text-align: center;
  padding: 4rem 0;
}

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

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

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

.error-actions a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent-color);
  color: white;
  border-radius: 4px;
  margin: 0 0.5rem;
}

.error-actions a:hover {
  background: var(--accent-hover);
  color: white;
}

/* ===== 小部件 ===== */
.widget {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.widget-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

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

.widget-list li a {
  font-size: 0.875rem;
  display: block;
}

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

  .sidebar-right {
    display: none;
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-wrap: wrap;
    height: auto;
    padding: 1rem var(--gap);
  }

  .nav {
    order: 3;
    width: 100%;
    margin-top: 1rem;
    gap: 1rem;
    overflow-x: auto;
  }

  .search-box {
    display: none;
  }

  .main-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar-left {
    display: none;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .content-card {
    flex-direction: column;
  }

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

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

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

@media (max-width: 480px) {
  .footer-content {
    grid-template-columns: 1fr;
  }

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