/* ===== 游戏机改装 - 维基风格样式 ===== */
/* 主色调: #7c6a46 */

/* ===== CSS 变量 ===== */
:root {
  --accent-color: #7c6a46;
  --accent-light: #9a8560;
  --accent-dark: #5c4f35;
  --bg-primary: #faf8f5;
  --bg-secondary: #f5f2ed;
  --bg-card: #ffffff;
  --text-primary: #2d2a26;
  --text-secondary: #6b6560;
  --text-muted: #9a9590;
  --border-color: #e8e4de;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

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

ul, ol {
  list-style: none;
}

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

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

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

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

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

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

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-color);
  background: var(--bg-secondary);
}

/* ===== 搜索框 ===== */
.search-box {
  position: relative;
  width: 280px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  font-size: 14px;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  background: var(--bg-card);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

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

.hero-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hero-search {
  max-width: 600px;
  margin: 0 auto;
}

.hero-search .search-input {
  padding: 16px 20px 16px 48px;
  font-size: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

/* ===== 区块标题 ===== */
.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 2px;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

/* ===== 分类标签 ===== */
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.category-tag:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.category-tag .count {
  padding: 2px 8px;
  background: var(--bg-secondary);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 列表样式 ===== */
.list-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.list-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

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

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

.list-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
}

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

.list-item .time {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 三栏布局 ===== */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

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

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

.breadcrumb .sep {
  margin: 0 8px;
  color: var(--text-muted);
}

.breadcrumb .current {
  color: var(--text-primary);
}

/* ===== 页面头部 ===== */
.page-header {
  padding: 40px 0;
  background: var(--bg-secondary);
  margin-bottom: 40px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-desc {
  font-size: 16px;
  color: var(--text-secondary);
}

.page-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== 文章列表 ===== */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.article-item:hover {
  box-shadow: var(--shadow-md);
}

.article-thumb {
  width: 120px;
  height: 80px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}

.article-content {
  flex: 1;
}

.article-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.article-title a {
  color: var(--text-primary);
}

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

.article-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

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

/* ===== 侧边栏 ===== */
.sidebar {
  width: 260px;
  flex-shrink: 0;
}

.sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.toc-list {
  font-size: 14px;
}

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

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

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

.toc-list .toc-h2 {
  padding-left: 0;
}

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

/* ===== 内容区域 ===== */
.content-wrapper {
  display: flex;
  gap: 40px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 40px;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* ===== 文章详情 ===== */
.article-header {
  margin-bottom: 32px;
}

.article-header h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

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

.article-body {
  font-size: 16px;
  line-height: 1.8;
}

.article-body h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 40px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 16px;
}

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

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

.article-body ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-body ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

.article-body strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== 信息框 ===== */
.info-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0;
}

.info-box-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--accent-color);
}

.info-box table {
  width: 100%;
  font-size: 14px;
}

.info-box td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.info-box td:first-child {
  width: 120px;
  color: var(--text-secondary);
}

.info-box tr:last-child td {
  border-bottom: none;
}

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

.tag {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

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

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

.footer-info {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
}

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

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

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

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

.error-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
}

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

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

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

/* ===== 子分类 ===== */
.sub-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sub-category {
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.2s;
}

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

/* ===== 区块间距 ===== */
.section {
  padding: 40px 0;
}

.section-alt {
  background: var(--bg-secondary);
}

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

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

  .sidebar {
    width: 100%;
  }
}

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

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .search-box {
    width: 100%;
    order: 2;
  }

  .hero {
    padding: 40px 0;
  }

  .hero-title {
    font-size: 28px;
  }

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

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

  .article-thumb {
    width: 100%;
    height: 160px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

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

@media (max-width: 480px) {
  .hero-title {
    font-size: 24px;
  }

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

  .article-header h1 {
    font-size: 24px;
  }

  .article-body h2 {
    font-size: 20px;
  }

  .article-body h3 {
    font-size: 18px;
  }
}
