/* ========================================
   登山 - 时间线归档风格样式
   www.tumudidi.cn - 提供登山旅游线路 营地搭建 文化历史及摄影技巧的平台
   ======================================== */

/* CSS 变量 */
: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: #263238;
  --border-color: #e0e0e0;
  --timeline-line: #c5cae9;
  --timeline-dot: var(--accent-color);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

/* 重置样式 */
*, *::before, *::after {
  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.6;
  color: var(--text-primary);
  background: var(--bg-primary);
}

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

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

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

ul {
  list-style: none;
}

/* ========================================
   布局组件
   ======================================== */

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

/* 页头 */
.header {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  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 {
  color: var(--text-secondary);
  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);
}

/* 页脚 */
.footer {
  background: var(--bg-dark);
  color: #fff;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

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

.footer-title {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #fff;
}

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

.footer-links a {
  color: #b0bec5;
  font-size: 0.9rem;
}

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

.footer-bottom {
  border-top: 1px solid #455a64;
  padding-top: 1.5rem;
  text-align: center;
  color: #78909c;
  font-size: 0.875rem;
}

/* ========================================
   Hero 区域
   ======================================== */

.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: #fff;
  padding: 4rem 0;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* ========================================
   面包屑导航
   ======================================== */

.breadcrumb {
  background: var(--bg-secondary);
  padding: 1rem 0;
  font-size: 0.875rem;
}

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

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

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

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

/* ========================================
   时间线组件 - 核心样式
   ======================================== */

.timeline-section {
  padding: 3rem 0;
}

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* 中心线 */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--timeline-line);
  transform: translateX(-50%);
}

/* 时间线项目 */
.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  display: flex;
  align-items: flex-start;
}

.timeline-item:nth-child(odd) {
  flex-direction: row-reverse;
}

.timeline-item:nth-child(odd) .timeline-content {
  text-align: right;
  padding-right: 3rem;
  padding-left: 0;
}

.timeline-content {
  width: 50%;
  padding-left: 3rem;
}

/* 时间线节点 */
.timeline-dot {
  position: absolute;
  left: 50%;
  top: 0.5rem;
  width: 16px;
  height: 16px;
  background: var(--timeline-dot);
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.timeline-dot.milestone {
  width: 24px;
  height: 24px;
  background: var(--accent-dark);
}

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

.year-marker::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  background: var(--accent-color);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.year-marker span {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 60px;
}

/* 时间线内容卡片 */
.timeline-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

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

.timeline-date {
  font-size: 0.875rem;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.timeline-title a {
  color: inherit;
}

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

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

.timeline-meta {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ========================================
   文章列表组件
   ======================================== */

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.3s;
}

.article-item:hover {
  background: #e8eaf6;
}

.article-thumb {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

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

.article-info {
  flex: 1;
  min-width: 0;
}

.article-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

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

/* ========================================
   三栏布局组件
   ======================================== */

.three-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 3rem 0;
}

.column {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.column-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

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

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

.column-list a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* ========================================
   文章详情页样式
   ======================================== */

.article-section {
  padding: 2rem 0;
}

.article-header {
  text-align: center;
  margin-bottom: 2rem;
}

.article-header .timeline-date {
  font-size: 1rem;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 1rem 0;
  color: var(--text-primary);
}

.article-meta-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--accent-color);
}

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

.article-body img {
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-md);
}

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

.article-body ul,
.article-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

/* 文章导航 */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.article-nav-prev,
.article-nav-next {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.article-nav-next {
  text-align: right;
}

.article-nav-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

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

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

/* ========================================
   分类页样式
   ======================================== */

.category-header {
  text-align: center;
  padding: 2rem 0;
}

.category-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

/* ========================================
   404 页面
   ======================================== */

.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 0;
}

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

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

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

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background 0.3s;
}

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

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 992px) {
  .three-columns {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  .nav {
    display: none;
  }

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

  /* 时间线移动端适配 - 单侧显示 */
  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    flex-direction: column !important;
    padding-left: 50px;
  }

  .timeline-item:nth-child(odd) .timeline-content {
    text-align: left;
    padding-right: 0;
    padding-left: 0;
  }

  .timeline-content {
    width: 100%;
    padding-left: 0;
  }

  .timeline-dot {
    left: 20px;
    transform: translateX(-50%);
  }

  .year-marker::before {
    left: 20px;
    transform: translate(-50%, -50%);
  }

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

  .article-nav {
    grid-template-columns: 1fr;
  }

  .article-nav-next {
    text-align: left;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .hero {
    padding: 2.5rem 0;
  }

  .timeline-section {
    padding: 2rem 0;
  }

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