/* ============ 生活指南 - 全局样式 ============ */
:root {
  --primary: #e8590c;
  --primary-dark: #c74608;
  --primary-light: #fff4e6;
  --text: #2b2b2b;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f8f7f5;
  --border: #e7e5e4;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", 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.7;
  font-size: 16px;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--primary-dark);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============ 头部 ============ */
.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;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.brand-logo {
  font-size: 24px;
}
.brand:hover {
  color: var(--text);
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}
.main-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
}
.main-nav a:hover {
  background: var(--bg-soft);
  color: var(--primary);
}
.main-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.search-form {
  display: flex;
  gap: 8px;
}
.search-form input,
.hero-search input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  width: 220px;
  outline: none;
  transition: border-color 0.2s;
}
.search-form input:focus,
.hero-search input:focus {
  border-color: var(--primary);
}
.search-form button,
.hero-search button,
.btn {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.search-form button:hover,
.hero-search button:hover,
.btn:hover {
  background: var(--primary-dark);
  color: #fff;
}
.btn-ghost {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--border);
  color: var(--text);
}

/* ============ Hero ============ */
.hero {
  text-align: center;
  padding: 64px 20px 48px;
  background: linear-gradient(180deg, var(--primary-light), #fff);
  border-radius: 0 0 24px 24px;
  margin-bottom: 40px;
}
.hero h1 {
  font-size: 40px;
  margin-bottom: 12px;
  color: var(--text);
}
.hero p {
  max-width: 640px;
  margin: 0 auto 24px;
  color: var(--text-muted);
  font-size: 17px;
}
.hero-search {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.hero-search input {
  width: 360px;
  padding: 12px 16px;
  font-size: 15px;
}
.hero-search button {
  padding: 12px 24px;
}

/* ============ 区块标题 ============ */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-head h2 {
  font-size: 24px;
}
.section-more {
  font-size: 14px;
}

/* ============ 卡片网格 ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.card-link {
  display: block;
  padding: 20px;
  color: var(--text);
}
.card-link:hover {
  color: var(--text);
}
.card-title {
  font-size: 17px;
  margin-bottom: 8px;
  line-height: 1.5;
}
.card-title:hover {
  color: var(--primary);
}
.card-summary {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
}
.badge.tag {
  margin: 4px 4px 4px 0;
}

/* ============ 分类 ============ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
.category-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all 0.2s;
}
.category-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--text);
}
.category-icon {
  font-size: 28px;
}
.category-name {
  font-size: 17px;
  font-weight: 600;
}
.category-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============ 按分类浏览 ============ */
.cat-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.cat-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.cat-card-icon {
  font-size: 30px;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 12px;
}
.cat-card-title h3 {
  font-size: 18px;
  margin-bottom: 4px;
}
.cat-card-title p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.cat-article-list {
  list-style: none;
  flex: 1;
}
.cat-article-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.cat-article-list li:last-child {
  border-bottom: none;
}
.cat-article-list a {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: color 0.15s;
}
.cat-article-list a:hover {
  color: var(--primary);
}
.cat-article-list time {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.cat-card-more {
  display: block;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
}
.link-list {
  list-style: none;
}
.link-list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.link-list li:last-child {
  border-bottom: none;
}

/* ============ 页面头部 / 面包屑 ============ */
.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  padding: 16px 0;
}
.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--primary);
}
.page-head {
  margin-bottom: 28px;
}
.page-head h1 {
  font-size: 32px;
  margin-bottom: 8px;
}
.page-head p {
  color: var(--text-muted);
}
.muted {
  color: var(--text-muted);
  font-size: 14px;
}

/* ============ 文章页 ============ */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  padding-bottom: 48px;
}

.article-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.article-header h1 {
  font-size: 32px;
  line-height: 1.4;
  margin-bottom: 12px;
}
.article-meta {
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.article-content {
  font-size: 16.5px;
  line-height: 1.9;
}
.article-content h2 {
  font-size: 24px;
  margin: 32px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}
.article-content h3 {
  font-size: 19px;
  margin: 24px 0 10px;
}
.article-content p {
  margin-bottom: 14px;
}
.article-content ul,
.article-content ol {
  margin: 0 0 14px 24px;
}
.article-content img {
  max-width: 100%;
  border-radius: var(--radius);
}

.article-tags {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.side-card {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 18px;
}
.side-card h3 {
  font-size: 16px;
  margin-bottom: 12px;
}
.hot-list {
  list-style: none;
  counter-reset: hot;
}
.hot-list li {
  counter-increment: hot;
  padding: 6px 0;
  font-size: 14px;
}
.hot-list li::before {
  content: counter(hot);
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  font-size: 12px;
  margin-right: 8px;
  font-weight: 600;
}

/* ============ 分页 ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 32px 0 48px;
  font-size: 14px;
}
.page-link {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  transition: all 0.2s;
}
.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.page-info {
  color: var(--text-muted);
}

/* ============ 空状态 / 404 ============ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty p {
  margin-bottom: 8px;
}
.not-found .nf-code {
  font-size: 72px;
  font-weight: 800;
  color: var(--primary);
}
.not-found h1 {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--text);
}

/* ============ 页脚 ============ */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  margin-top: 32px;
}
.footer-inner {
  padding: 40px 20px 24px;
}
.footer-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.footer-desc {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 560px;
  margin-bottom: 16px;
}
.footer-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.footer-nav a {
  color: var(--text-muted);
  font-size: 14px;
}
.footer-nav a:hover {
  color: var(--primary);
}
.copyright {
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .card-grid,
  .category-grid,
  .cat-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .side-card {
    flex: 1;
    min-width: 220px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }
  .main-nav {
    order: 3;
    width: 100%;
  }
  .search-form input {
    width: 140px;
  }
  .hero {
    padding: 40px 16px 32px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero-search {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-search input {
    width: 100%;
  }
  .card-grid,
  .category-grid,
  .cat-card-grid {
    grid-template-columns: 1fr;
  }
  .article-header h1 {
    font-size: 26px;
  }
}
