/* ===== 基础变量 ===== */
:root {
  --accent-color: #3f51b5;
  --accent-light: #5c6bc0;
  --accent-dark: #283593;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --bg-dark: #1a1a2e;
  --border-color: #e0e0e0;
  --timeline-color: #3f51b5;
  --timeline-width: 3px;
  --timeline-dot: 14px;
  --max-width: 1200px;
  --gap: 24px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== 重置样式 ===== */
* {
  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-primary);
  background: var(--bg-secondary);
}

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

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

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

/* ===== 页头 ===== */
.header {
  background: var(--bg-dark);
  color: #fff;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
}

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

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

.nav a {
  color: rgba(255,255,255,0.8);
  font-size: 15px;
}

.nav a:hover {
  color: #fff;
}

/* ===== 页脚 ===== */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.6);
  padding: 48px 0 24px;
  margin-top: 64px;
}

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

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

.footer-title {
  color: #fff;
  font-size: 16px;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

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

.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 14px;
}

/* ===== Hero 区域 ===== */
.hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #16213e 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}

.hero-title {
  font-size: 48px;
  margin-bottom: 16px;
}

.hero-title span {
  color: var(--accent-color);
}

.hero-desc {
  font-size: 18px;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-keywords {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.keyword-tag {
  background: rgba(63,81,181,0.2);
  border: 1px solid var(--accent-color);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  background: var(--bg-primary);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
  font-size: 14px;
  color: var(--text-secondary);
}

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

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

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

/* ===== 时间线 ===== */
.timeline-section {
  padding: 48px 0;
}

.timeline-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.timeline {
  position: relative;
  padding: 32px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: var(--timeline-width);
  height: 100%;
  background: var(--timeline-color);
  top: 0;
}

.timeline-item {
  display: flex;
  justify-content: flex-end;
  padding-right: calc(50% + 32px);
  position: relative;
  margin-bottom: 48px;
}

.timeline-item:nth-child(even) {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: calc(50% + 32px);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: var(--timeline-dot);
  height: var(--timeline-dot);
  background: var(--accent-color);
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-color);
}

.timeline-content {
  background: var(--bg-primary);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 420px;
}

.timeline-date {
  font-size: 14px;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 8px;
}

.timeline-title {
  font-size: 18px;
  margin-bottom: 8px;
}

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

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

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

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

/* ===== 年份标记 ===== */
.year-marker {
  text-align: center;
  margin: 48px 0;
  position: relative;
}

.year-marker::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: var(--timeline-width);
  height: 100%;
  background: var(--timeline-color);
  top: 0;
  z-index: -1;
}

.year-badge {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: bold;
}

/* ===== 内容网格 ===== */
.content-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--gap);
}

.grid-title {
  font-size: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.grid-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.grid-col {
  background: var(--bg-primary);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.col-title {
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

.col-list {
  list-style: none;
}

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

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

.col-list a {
  color: var(--text-primary);
  font-size: 14px;
  display: block;
}

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

/* ===== 分类页标题 ===== */
.category-header {
  background: var(--bg-primary);
  padding: 48px 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.category-title {
  font-size: 36px;
  margin-bottom: 12px;
}

.category-desc {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== 文章页 ===== */
.article-section {
  padding: 48px 0;
}

.article-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--gap);
}

.article-header {
  text-align: center;
  margin-bottom: 48px;
}

.article-title {
  font-size: 32px;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.article-content {
  background: var(--bg-primary);
  padding: 48px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-content h2 {
  font-size: 24px;
  margin: 32px 0 16px;
  color: var(--accent-color);
}

.article-content h3 {
  font-size: 20px;
  margin: 24px 0 12px;
}

.article-content p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

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

.article-content li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

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

/* ===== 文章导航 ===== */
.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.article-nav-prev,
.article-nav-next {
  max-width: 45%;
}

.article-nav-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.article-nav-title {
  font-size: 14px;
  color: var(--text-primary);
}

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

/* ===== 推荐文章 ===== */
.recommend-section {
  background: var(--bg-primary);
  padding: 48px 0;
  margin-top: 48px;
}

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

.recommend-title {
  font-size: 20px;
  margin-bottom: 24px;
  text-align: center;
}

.recommend-tags {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.recommend-tag {
  background: var(--bg-secondary);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

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

/* ===== 404 页面 ===== */
.error-section {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px var(--gap);
}

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

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

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

.error-btn {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 12px 32px;
  border-radius: var(--radius);
  font-size: 16px;
}

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

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 16px;
  }

  .nav {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

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

  .timeline::before {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    padding-left: 56px;
    padding-right: 0;
    justify-content: flex-start;
  }

  .timeline-dot {
    left: 20px;
  }

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

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

  .article-content {
    padding: 24px;
  }

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

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

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

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