/* ===== ChoiceGuide 全局样式 ===== */
:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #dcfce7;
  --bg: #ffffff;
  --bg-alt: #f6f8f7;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  display: block;
  width: 100%;
}

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
}

.main-nav {
  display: flex;
  gap: 28px;
}

.nav-link {
  color: var(--text-light);
  font-size: 15px;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-dark);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #f0fdf4 0%, #e6f7ee 100%);
  padding: 72px 0 64px;
  text-align: center;
}

.hero-title {
  font-size: 44px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 1px;
}

.hero-subtitle {
  margin: 14px auto 32px;
  max-width: 560px;
  color: var(--text-light);
  font-size: 17px;
}

.search-box {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}

.search-box input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.1s;
}

.btn-primary {
  padding: 14px 28px;
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

/* ===== 通用 Section ===== */
.section {
  padding: 64px 0;
}

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

.section-head {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
}

.section-desc {
  margin-top: 8px;
  color: var(--text-light);
}

/* ===== 文章卡片 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card-body {
  padding: 18px;
}

.card-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-excerpt {
  font-size: 14px;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 分类 ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.category-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.category-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.category-icon {
  font-size: 34px;
  display: block;
  margin-bottom: 10px;
}

.category-name {
  font-weight: 600;
  font-size: 15px;
}

.category-count {
  font-size: 13px;
  color: var(--text-light);
}

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

.article-row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

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

.article-row-img {
  width: 160px;
  border-radius: 8px;
  flex-shrink: 0;
}

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

.article-row-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.article-row-excerpt {
  font-size: 14px;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-row-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-light);
}

/* ===== 关于 ===== */
.about-box {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.about-box p {
  margin-top: 12px;
  color: var(--text-light);
}

/* ===== 页脚 ===== */
.site-footer {
  background: #111827;
  color: #9ca3af;
  padding: 48px 0 24px;
}

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

.footer-brand .logo-text {
  color: #fff;
}

.footer-desc {
  margin-top: 8px;
  font-size: 14px;
}

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

.footer-links a {
  font-size: 14px;
  transition: color 0.2s;
}

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

.copyright {
  font-size: 13px;
  margin-top: 8px;
}

/* ===== 空状态 ===== */
.empty-tip {
  text-align: center;
  color: var(--text-light);
  padding: 40px 0;
  font-size: 15px;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }

  .main-nav.open {
    display: flex;
  }

  .nav-link {
    padding: 14px 20px;
  }

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

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

  .article-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-row-img {
    width: 100%;
  }

  .search-box {
    flex-direction: column;
  }
}
