/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --accent-travel: #059669;
  --accent-tech: #2563eb;
  --accent-fitness: #dc2626;
  --accent-food: #d97706;
  --accent-life: #7c3aed;
  --accent-code: #0891b2;
  --accent-diet: #db2777;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 24px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10);
  --max-width: 1200px;
  --header-h: 64px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px; line-height: 1.7; color: var(--text); background: #f8fafc; min-height: 100vh;
  display: flex; flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

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

/* === Container === */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* === Header / Navigation (设计稿: active 蓝色下划线) === */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); max-width: var(--max-width); margin: 0 auto; padding: 0 48px;
}
.logo { display: flex; align-items: center; }
.logo:hover { opacity: 0.85; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  font-size: 14px; font-weight: 500; color: var(--text); padding: 22px 0;
  text-decoration: none; transition: color var(--transition); position: relative;
}
.nav a:hover { color: var(--primary); }
.nav a.active { color: var(--primary); }
.nav a.active::after {
  content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px; background: var(--primary); border-radius: 2px;
}

/* Mobile nav toggle */
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; background: none; border: none; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }

/* === Hero / Carousel (设计稿: 分类标签 + 毛玻璃按钮) === */
.hero { margin: 0; }
.carousel { position: relative; overflow: hidden; }
.carousel-track { display: flex; transition: transform 0.5s ease; }
.carousel-slide {
  min-width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 60px 48px 40px; min-height: 380px; position: relative;
}
.slide-content { flex: 1; max-width: 520px; z-index: 2; }
.carousel-cat { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 2px; color: rgba(255,255,255,0.7); margin-bottom: 16px; }
.carousel-title { font-size: 38px; font-weight: 800; line-height: 1.15; letter-spacing: -0.5px; color: #fff; margin-bottom: 16px; }
.carousel-title .highlight { background: linear-gradient(135deg, #f5a623, #ffd54f); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.carousel-desc { font-size: 16px; line-height: 1.6; color: rgba(255,255,255,0.6); margin-bottom: 24px; }
.carousel-btn {
  display: inline-block; padding: 10px 24px;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 24px;
  color: #fff; font-size: 14px; font-weight: 600; text-decoration: none;
  transition: all 0.3s;
}
.carousel-btn:hover { background: rgba(255,255,255,0.25); transform: translateY(-2px); color: #fff; }
.slide-visual { font-size: 120px; opacity: 0.6; user-select: none; z-index: 2; }

.carousel-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 5; }
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3);
  cursor: pointer; transition: all 0.3s;
}
.dot.active { width: 24px; border-radius: 4px; background: #fff; }

.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15); color: #fff; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}
.carousel-arrow:hover { background: rgba(255,255,255,0.2); }
.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }

/* === Categories / Filter (设计稿: 深色active) === */
.categories-bar, .filter-bar {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px;
  padding: 0 48px 40px;
}
.cat, .filter {
  padding: 6px 18px; border-radius: 20px; font-size: 13px; font-weight: 500;
  cursor: pointer; background: #f1f5f9; color: var(--text-secondary);
  transition: all var(--transition); user-select: none;
}
.cat:hover, .filter:hover { background: #e2e8f0; }
.cat.active, .filter.active { background: var(--text); color: #fff; }

/* === Search (设计稿: 圆角full) === */
.page-header { display: flex; justify-content: flex-end; align-items: center; margin-bottom: -1px; padding: 24px 48px 0; }
.page-header .search-box { position: relative; }
.page-header .search-box input {
  width: 260px; padding: 10px 16px 10px 40px;
  border: 1px solid var(--border); border-radius: 24px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: #f8fafc; outline: none; transition: all 0.2s;
}
.page-header .search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); background: var(--bg); }
.page-header .search-box input::placeholder { color: var(--text-muted); }
.page-header .search-box .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--text-muted); pointer-events: none; }

/* === Articles Grid (设计稿: 固定3列) === */
.articles-section { padding: 16px 48px 48px; }
.articles-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.article-card {
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 16px;
  overflow: hidden; transition: all 0.3s; cursor: pointer;
}
.article-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.06); transform: translateY(-4px); border-color: var(--border); }
.card-img {
  height: 180px; display: flex; align-items: center; justify-content: center;
  font-size: 36px; position: relative; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img.travel { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.card-img.tech { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.card-img.fitness { background: linear-gradient(135deg, #fff7ed, #ffedd5); }
.card-img.food { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.card-img.life { background: linear-gradient(135deg, #fdf2f8, #fce7f3); }
.card-img.code { background: linear-gradient(135deg, #f0f0ff, #e0e0ff); }
.card-img.diet { background: linear-gradient(135deg, #fce7f3, #fbcfe8); }
.card-body { padding: 20px; }
.cat-tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.card-body h3 { font-size: 16px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.excerpt { font-size: 13px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; }
.meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }

/* === Pagination (设计稿: 居中) === */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  padding: 16px 48px 48px;
}
.page, .page-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; font-size: 14px; font-weight: 500;
  cursor: pointer; color: var(--text-secondary); transition: all 0.2s;
}
.page:hover, .page-arrow:hover { background: #f1f5f9; }
.page.active { background: var(--text); color: #fff; }
.page.dots { cursor: default; }
.page-arrow { font-size: 18px; color: var(--text-muted); }
.page-arrow:hover { color: var(--text); }
.page-count { font-size: 13px; color: var(--text-muted); margin: 0 8px; }

/* === Breadcrumb === */
.breadcrumb { max-width: 780px; margin: 0 auto 24px; font-size: 14px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 8px; color: var(--text-muted); }
.breadcrumb .current { color: var(--text); }

/* === Article Detail === */
.article-main { max-width: 780px; margin: 0 auto 48px; }
.article-header { margin-bottom: 28px; }
.article-header h1 { font-size: 32px; font-weight: 700; line-height: 1.3; margin: 12px 0; }
.article-header .meta { display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; color: var(--text-muted); }
.feature-image { border-radius: var(--radius); margin-bottom: 32px; overflow: hidden; height: 360px; }
.feature-image img { width: 100%; height: 100%; object-fit: cover; }
.article-content { background: var(--bg); padding: 0; }
.article-content h2 { font-size: 24px; font-weight: 700; margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.article-content p { margin-bottom: 18px; color: var(--text-secondary); font-size: 16px; line-height: 1.8; }
.article-content blockquote {
  margin: 24px 0; padding: 20px 24px; border-left: 4px solid var(--primary);
  background: var(--bg-alt); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-secondary);
  font-style: italic;
}
.article-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 16px 0; }

/* === Footer (设计稿: 有导航链接) === */
.site-footer {
  border-top: 1px solid var(--border-light); background: var(--bg-alt); padding: 40px 48px;
  margin-top: auto; text-align: center;
  text-align: center;
  padding: 32px 48px;
}
@media (max-width: 900px) {
  .carousel-slide { padding: 40px 32px; min-height: 300px; }
  .carousel-title { font-size: 26px; }
  .slide-visual { font-size: 72px; }
  .article-header h1 { font-size: 26px; }
}
@media (max-width: 768px) {
  .header-inner { padding: 0 20px; }
  .categories-bar, .filter-bar { padding: 0 20px 24px; }
  .articles-section { padding: 16px 20px 32px; }
  .page-header { padding: 16px 20px 0; }
  .page-header .search-box input { width: 100%; }
  .site-footer { padding: 32px 20px; }
  .articles-grid { grid-template-columns: 1fr; }
  .carousel-title { font-size: 22px; }
}
@media (max-width: 640px) {
  .nav { display: none; flex-direction: column; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: rgba(255,255,255,0.98); backdrop-filter: blur(12px); padding: 12px;
    border-bottom: 1px solid var(--border); gap: 4px;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .carousel-slide { flex-direction: column; padding: 32px 24px; min-height: 320px; text-align: center; }
  .slide-content { max-width: 100%; }
  .carousel-title { font-size: 22px; }
  .slide-visual { font-size: 60px; margin-top: 20px; }
  .articles-grid { grid-template-columns: 1fr; }
  .site-stats { gap: 24px; flex-wrap: wrap; }
  .stat .num { font-size: 28px; }
  .feature-image img { max-height: 200px; }
  .article-header h1 { font-size: 22px; }
  .pagination { padding: 16px 20px 32px; }
}

/* === Fade In Animation === */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.article-card, .stat, .about-section { animation: fadeInUp 0.5s ease forwards; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.2s; }
.article-card:nth-child(4) { animation-delay: 0.3s; }
.article-card:nth-child(5) { animation-delay: 0.4s; }
.article-card:nth-child(6) { animation-delay: 0.5s; }

/* === About Page === */
.about-main {
  max-width: 680px;
  margin: 60px auto 80px;
  padding: 0 24px;
  text-align: center;
}

.logo-large {
  margin-bottom: 24px;
}

.about-main h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text);
}

.site-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 40px;
}

.stat {
  text-align: center;
}

.stat .num {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.stat .label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.about-section {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.about-section p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* === Back to Top === */
#backToTop {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--text);
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  line-height: 1;
}

#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
}

#backToTop:hover {
  background: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}

@media (max-width: 640px) {
  .about-main {
    margin: 40px auto 60px;
  }
  .about-main h1 {
    font-size: 22px;
  }
  .site-stats {
    gap: 28px;
  }
  .stat .num {
    font-size: 28px;
  }
  #backToTop {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}
