/* 自行车旅行 - 资讯风格样式表 */

/* CSS 变量 */
:root {
  --accent-color: #2d8659;
  --accent-light: #3da76f;
  --accent-dark: #1e5c3d;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f9fa;
  --bg-dark: #e9ecef;
  --border-color: #dee2e6;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --radius: 8px;
  --max-width: 1200px;
  --sidebar-width: 220px;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

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

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

ul {
  list-style: none;
}

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

/* 布局容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 15px;
}

/* 三栏布局 */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 15px;
}

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

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

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

.nav a {
  color: var(--text-primary);
  font-weight: 500;
  padding: 5px 0;
  border-bottom: 2px solid transparent;
}

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

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

.search input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius) 0 0 var(--radius);
  width: 180px;
  outline: none;
}

.search button {
  padding: 8px 15px;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
}

/* Hero 区域 */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-light) 100%);
  color: #fff;
  padding: 50px 0;
  text-align: center;
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 15px;
}

.hero p {
  font-size: 16px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* 侧边栏 */
.sidebar {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
  height: fit-content;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-color);
  margin-bottom: 15px;
}

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

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

.sidebar-list a {
  color: var(--text-secondary);
  display: block;
}

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

/* 主内容区 */
.main {
  min-height: 500px;
}

/* 卡片 */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-color);
}

/* 特色内容 */
.featured-item {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

.featured-item:last-child {
  border-bottom: none;
}

.featured-img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.featured-content h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.featured-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* 内容列表 */
.content-list {
  background: var(--bg-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.content-item {
  display: flex;
  gap: 15px;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

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

.content-img {
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.content-body h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.content-body p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-meta {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

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

/* 标签 */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 4px 10px;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

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

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

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

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

.breadcrumb span {
  margin: 0 8px;
}

/* 分类标题 */
.category-header {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.category-header h1 {
  font-size: 24px;
  margin-bottom: 10px;
}

.category-header p {
  color: var(--text-secondary);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
}

.pagination a {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.pagination .current {
  background: var(--accent-color);
  color: #fff;
}

/* 文章页 */
.article {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

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

.article-title {
  font-size: 28px;
  line-height: 1.4;
  margin-bottom: 15px;
}

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

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

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

.article-body h2 {
  font-size: 22px;
  margin: 30px 0 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
  font-size: 18px;
  margin: 25px 0 12px;
}

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

.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 20px 0;
}

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

.article-body ul,
.article-body ol {
  margin: 15px 0;
  padding-left: 25px;
}

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

/* 作者卡片 */
.author-card {
  text-align: center;
}

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

.author-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
}

.author-bio {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 目录 */
.toc {
  position: sticky;
  top: 80px;
}

.toc ul {
  padding-left: 0;
}

.toc li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.toc a {
  color: var(--text-secondary);
  font-size: 13px;
}

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

/* 404页面 */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

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

.error-title {
  font-size: 24px;
  margin-bottom: 15px;
}

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

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

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

/* 页脚 */
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 40px 0 20px;
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 15px;
}

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

.footer-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
}

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

.footer-links a {
  color: var(--text-secondary);
  font-size: 13px;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-muted);
}

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

  .sidebar-right {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    margin-top: 15px;
    gap: 20px;
    overflow-x: auto;
  }

  .search {
    display: none;
  }

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

  .sidebar-left {
    display: none;
  }

  .hero h1 {
    font-size: 24px;
  }

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

  .content-img {
    width: 100%;
    height: 180px;
  }

  .featured-item {
    flex-direction: column;
  }

  .featured-img {
    width: 100%;
    height: 150px;
  }

  .article {
    padding: 20px;
  }

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

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

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

  .pagination {
    flex-wrap: wrap;
  }
}
