/* 电竞椅 - 电子书风格样式 */
/* 主色调: #795548 (棕色) */

:root {
  --accent-color: #795548;
  --accent-light: #8d6e63;
  --accent-dark: #5d4037;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #fafafa;
  --bg-border: #e0e0e0;
  --star-color: #ffb300;
  --link-color: #795548;
  --link-hover: #5d4037;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 4px;
  --max-width: 1200px;
  --content-width: 800px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

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

a:hover {
  color: var(--link-hover);
}

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

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

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

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

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

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

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

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 8px 16px;
  border: 1px solid var(--bg-border);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 160px;
  font-size: 0.9rem;
}

.search-box button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

/* Hero区域 */
.hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #f5f0ee 100%);
  padding: 60px 20px;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* 面包屑 */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

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

.breadcrumb span {
  margin: 0 8px;
}

/* 主容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* 分类标题 */
.category-header {
  padding: 24px 0;
  border-bottom: 1px solid var(--bg-border);
  margin-bottom: 32px;
}

.category-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

.category-count {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* 筛选排序 */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--bg-border);
}

.filter-options {
  display: flex;
  gap: 24px;
}

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

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

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.card {
  background: var(--bg-primary);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-image {
  aspect-ratio: 16 / 10;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.card-body {
  padding: 16px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-rating {
  color: var(--star-color);
  font-size: 0.9rem;
}

/* 列表视图 */
.list-view {
  margin-bottom: 40px;
}

.list-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--bg-border);
}

.list-item-image {
  width: 120px;
  height: 80px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.list-item-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

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

/* 文章详情页布局 */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* 文章主体 */
.article-main {
  max-width: var(--content-width);
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--bg-border);
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--accent-dark);
}

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

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

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 40px 0 20px;
  color: var(--accent-dark);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bg-border);
}

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

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

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

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

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

/* 目录侧边栏 */
.toc-sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.toc-box {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  padding: 20px;
}

.toc-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent-dark);
}

.toc-list {
  list-style: none;
  padding: 0;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: block;
  padding: 4px 0;
}

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

.toc-list .toc-h2 {
  font-weight: 500;
}

.toc-list .toc-h3 {
  padding-left: 16px;
  font-size: 0.85rem;
}

/* 推荐文章区域 */
.recommend-section {
  background: var(--bg-secondary);
  padding: 40px 0;
  margin-top: 40px;
}

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

.recommend-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--accent-dark);
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.recommend-list {
  list-style: none;
  padding: 0;
}

.recommend-list li {
  margin-bottom: 12px;
}

.recommend-list a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recommend-list a::before {
  content: "•";
  color: var(--accent-color);
}

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

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 40px 0;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

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

/* 404页面 */
.error-page {
  text-align: center;
  padding: 80px 20px;
  max-width: 600px;
  margin: 0 auto;
}

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

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent-dark);
}

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

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

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

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

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

.footer-copy {
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

  .toc-sidebar {
    position: static;
    order: -1;
    margin-bottom: 24px;
  }

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

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

  .nav {
    order: 3;
    width: 100%;
    gap: 16px;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid var(--bg-border);
  }

  .search-box {
    flex: 1;
    max-width: 200px;
  }

  .hero {
    padding: 40px 16px;
  }

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

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .list-item {
    flex-direction: column;
    gap: 12px;
  }

  .list-item-image {
    width: 100%;
    height: 160px;
  }

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

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

  .filter-bar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

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

  .nav {
    font-size: 0.85rem;
  }

  .pagination a,
  .pagination span {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

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