/* ── 字体 ─────────────────────────────────────────────── */
@import url('https://fonts.loli.net/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@400;500&display=swap');

/* ── 变量 ─────────────────────────────────────────────── */
:root {
  --primary:        #2D6A4F;
  --primary-light:  #40916C;
  --primary-dark:   #1B4332;
  --primary-faint:  #D8F3DC;
  --surface:        #FAF7F2;
  --card:           #FFFFFF;
  --on-surface:     #1C1C1C;
  --on-muted:       #6B6B6B;
  --divider:        #E8E0D5;
  --shadow:         rgba(44, 107, 79, 0.10);
  --radius-sm:      4px;
  --radius:         8px;
  --radius-lg:      12px;
  --serif:          'Noto Serif SC', 'Songti SC', STSong, '宋体', Georgia, serif;
  --sans:           'Noto Sans SC', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  --bar-height:     72px;
}

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── 容器 ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── App Bar ──────────────────────────────────────────── */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--card);
  border-bottom: 1px solid var(--divider);
  box-shadow: 0 1px 6px var(--shadow);
  height: var(--bar-height);
}
.app-bar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-bar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.app-bar__logo img {
  height: 54px;
  width: auto;
  border-radius: 4px;
}
.app-bar__title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .05em;
  white-space: nowrap;
}
.app-bar__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding-left: 28px;
}
.app-bar__nav-link {
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: 20px;
  color: var(--on-muted);
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.app-bar__nav-link:hover,
.app-bar__nav-link.active {
  background: var(--primary-faint);
  color: var(--primary);
}
.app-bar__actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-muted);
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--primary-faint); color: var(--primary); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }

/* ── 搜索浮层 ────────────────────────────────────────── */
.search-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.35);
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-overlay.open { display: flex; }
.search-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 560px;
  max-width: calc(100vw - 48px);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--serif);
  font-size: 1rem;
  background: transparent;
  color: var(--on-surface);
}
.search-box input::placeholder { color: var(--on-muted); }
.search-btn {
  padding: 7px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 500;
  transition: background .2s;
}
.search-btn:hover { background: var(--primary-light); }

/* 汉堡菜单（移动端） */
.hamburger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  align-items: center; justify-content: center;
  color: var(--on-muted);
  transition: background .2s;
}
.hamburger:hover { background: var(--primary-faint); }
.hamburger svg { width: 22px; height: 22px; fill: currentColor; }

/* 移动端侧抽屉 */
.drawer-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.4);
}
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 500;
  width: 260px;
  background: var(--card);
  padding: 24px 0;
  transform: translateX(-100%);
  transition: transform .28s ease;
  box-shadow: 4px 0 20px var(--shadow);
}
.drawer.open { transform: translateX(0); }
.drawer__logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 12px;
}
.drawer__logo img { height: 32px; border-radius: 4px; }
.drawer__logo-title { font-family: var(--serif); font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.drawer__link {
  display: flex; align-items: center;
  padding: 13px 24px;
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--on-surface);
  transition: background .18s, color .18s;
}
.drawer__link:hover, .drawer__link.active {
  background: var(--primary-faint); color: var(--primary);
}

/* ── 首页 ─────────────────────────────────────────────── */
.page-home { padding: 0 0 56px; }

/* 入场动画 */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero 介绍区 */
.home-hero {
  text-align: center;
  padding: 56px 0 52px;
}

.home-hero__badge {
  display: inline-block;
  font-family: var(--serif);
  font-size: .8125rem;
  letter-spacing: .28em;
  color: var(--primary);
  border: 1px solid rgba(45,106,79,.28);
  padding: 5px 20px;
  border-radius: 20px;
  margin-bottom: 22px;
  animation: fadeSlideUp .7s ease both;
}

.home-hero__title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.625rem);
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: .05em;
  line-height: 1.35;
  margin-bottom: 20px;
  animation: fadeSlideUp .7s .1s ease both;
}

.home-hero__desc {
  font-family: var(--serif);
  font-size: .9375rem;
  line-height: 2.1;
  color: var(--on-muted);
  max-width: 580px;
  margin: 0 auto 48px;
  animation: fadeSlideUp .7s .2s ease both;
}

/* 三栏卡片 */
.home-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.home-pillar {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 30px 24px 28px;
  text-align: center;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s;
  animation: fadeSlideUp .7s ease both;
}
.home-pillar:nth-child(1) { animation-delay: .3s; }
.home-pillar:nth-child(2) { animation-delay: .45s; }
.home-pillar:nth-child(3) { animation-delay: .6s; }
.home-pillar:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 28px var(--shadow);
  border-color: #B7E4C7;
}

.home-pillar__icon {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  background: var(--primary-faint);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .22s;
}
.home-pillar:hover .home-pillar__icon { background: #B7E4C7; }
.home-pillar__icon svg { width: 26px; height: 26px; fill: var(--primary); }

.home-pillar__title {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.home-pillar__desc {
  font-family: var(--sans);
  font-size: .8375rem;
  line-height: 1.8;
  color: var(--on-muted);
}

/* 精选文章分割线 */
.home-section-divider {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 0 28px;
}
.home-section-divider::before,
.home-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--divider);
}
.home-section-divider__title {
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
  flex-shrink: 0;
}

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

/* 文章卡片 */
.post-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--divider);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px var(--shadow);
  border-color: #B7E4C7;
}
.post-card__cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.post-card__cover-ph {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--primary-faint) 0%, #B7E4C7 100%);
  display: flex; align-items: center; justify-content: center;
}
.post-card__cover-ph svg { width: 32px; height: 32px; fill: #52B788; opacity: .5; }
.post-card__body {
  padding: 16px 18px 18px;
  flex: 1; display: flex; flex-direction: column;
}
.post-card__cat {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--primary-faint);
  color: var(--primary);
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 500;
  margin-bottom: 9px;
}
.post-card__title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--on-surface);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__excerpt {
  font-size: .875rem;
  color: var(--on-muted);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}
.post-card__meta {
  font-family: var(--sans);
  font-size: .75rem;
  color: #9E9E9E;
}

/* ── 文章列表（分类/搜索页）────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 2px; }

.post-list-item {
  display: block;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  margin-bottom: 8px;
  border-left: 3px solid transparent;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.post-list-item:hover {
  border-left-color: var(--primary);
  box-shadow: 0 4px 16px var(--shadow);
  transform: translateX(2px);
}
.post-list-item__title {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--on-surface);
  line-height: 1.55;
  margin-bottom: 8px;
  display: block;
  transition: color .18s;
}
.post-list-item:hover .post-list-item__title { color: var(--primary); }

.post-list-item__excerpt {
  font-family: var(--serif);
  font-size: .9rem;
  color: var(--on-muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.post-list-item__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: .8rem;
  color: #ADADAD;
}
.post-list-item__cat {
  padding: 1px 8px;
  background: var(--primary-faint);
  color: var(--primary);
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 500;
}


.page-list { padding: 32px 0 56px; }
.page-list__header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary);
  display: flex; align-items: baseline; gap: 12px;
}
.page-list__title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.page-list__count {
  font-family: var(--sans);
  font-size: .875rem;
  color: var(--on-muted);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 48px;
}
.page-btn {
  min-width: 38px; height: 38px;
  padding: 0 12px;
  border-radius: 19px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans);
  font-size: .875rem;
  color: var(--on-muted);
  border: 1px solid var(--divider);
  background: var(--card);
  transition: all .2s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-faint); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; pointer-events: none; }
.page-ellipsis { pointer-events: none; border-color: transparent; color: var(--on-muted); }

/* ── 文章详情页 ───────────────────────────────────────── */
.page-post { padding: 40px 0 60px; }
.page-post__inner {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 40px;
  align-items: start;
}

.article__header { margin-bottom: 32px; }
.article__cats { display: flex; gap: 8px; margin-bottom: 14px; }
.article__title {
  font-family: var(--serif);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--on-surface);
  margin-bottom: 14px;
}
.article__meta {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--on-muted);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--divider);
}
.article__cover {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 28px;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.article__content {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.95;
  color: #2A2A2A;
}
.article__content p { margin-bottom: 1.4em; }
.article__content h2 {
  font-size: 1.375rem; font-weight: 700;
  margin: 2em 0 .75em;
  color: var(--primary-dark);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-faint);
}
.article__content h3 {
  font-size: 1.125rem; font-weight: 600;
  margin: 1.5em 0 .5em;
  color: var(--primary-dark);
}
.article__content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 1.2em 0;
}
.article__content a { color: var(--primary); border-bottom: 1px solid var(--primary-faint); }
.article__content a:hover { border-color: var(--primary); }
.article__content blockquote {
  border-left: 3px solid var(--primary-light);
  margin: 1.5em 0;
  padding: 10px 20px;
  background: var(--primary-faint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--on-muted);
  font-style: italic;
}
.article__content ul, .article__content ol {
  padding-left: 1.5em;
  margin-bottom: 1.4em;
}
.article__content li { margin-bottom: .4em; }
.article__content strong { font-weight: 700; color: var(--on-surface); }
.article__content hr {
  border: none; border-top: 1px solid var(--divider);
  margin: 2em 0;
}

/* 侧边栏 */
.sidebar { position: sticky; top: calc(var(--bar-height) + 20px); }
.widget {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.widget__title {
  font-family: var(--serif);
  font-size: .9375rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--divider);
}
.widget__cat-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--divider);
  font-family: var(--sans);
  font-size: .9rem;
  color: var(--on-surface);
  transition: color .18s;
}
.widget__cat-link:last-child { border: none; }
.widget__cat-link:hover { color: var(--primary); }
.widget__cat-badge {
  font-size: .75rem;
  background: var(--primary-faint);
  color: var(--primary);
  padding: 1px 8px;
  border-radius: 10px;
}
.widget__recent-link {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
  font-size: .875rem;
  color: var(--on-surface);
  line-height: 1.5;
  transition: color .18s;
}
.widget__recent-link:last-child { border: none; }
.widget__recent-link:hover { color: var(--primary); }

/* ── Chip 标签 ────────────────────────────────────────── */
.chip {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 14px;
  background: var(--primary-faint);
  color: var(--primary);
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 500;
}

/* ── 搜索结果 ────────────────────────────────────────── */
.search-result-list { display: flex; flex-direction: column; gap: 1px; }
.search-result-item {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.search-result-item:hover { border-color: #B7E4C7; box-shadow: 0 4px 16px var(--shadow); }
.search-result-item__title {
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--on-surface);
}
.search-result-item__title:hover { color: var(--primary); }
.search-result-item__meta {
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--on-muted);
  margin-bottom: 8px;
}
.search-result-item__excerpt { font-size: .9375rem; color: var(--on-muted); line-height: 1.65; }

/* ── 搜索输入框（页面内） ────────────────────────────── */
.search-form {
  display: flex; gap: 12px;
  margin-bottom: 32px;
}
.search-form input {
  flex: 1;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--divider);
  border-radius: 23px;
  font-family: var(--serif);
  font-size: .9375rem;
  background: var(--card);
  outline: none;
  transition: border-color .2s;
}
.search-form input:focus { border-color: var(--primary); }
.search-form button {
  height: 46px;
  padding: 0 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 23px;
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 500;
  transition: background .2s;
}
.search-form button:hover { background: var(--primary-light); }

/* ── Footer ───────────────────────────────────────────── */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.75);
  padding: 20px 0;
  margin-top: 24px;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer__brand-name {
  font-family: var(--serif);
  font-size: .9rem;
  color: rgba(255,255,255,.9);
  margin-right: 8px;
}
.footer__links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer__link {
  font-family: var(--sans);
  font-size: .8125rem;
  color: rgba(255,255,255,.65);
  transition: color .18s;
}
.footer__link:hover { color: #fff; }
.footer__copy { font-family: var(--sans); font-size: .8125rem; }

/* ── 通用空状态 ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--on-muted);
  font-family: var(--sans);
}
.empty-state__icon { font-size: 3rem; margin-bottom: 16px; opacity: .4; }
.empty-state p { font-size: .9375rem; }

/* ── 响应式 ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .page-post__inner { grid-template-columns: 1fr 200px; gap: 28px; }
}
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .page-post__inner { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .home-pillars { grid-template-columns: 1fr; gap: 12px; max-width: 480px; }
  .home-hero { padding: 40px 0 40px; }
}
@media (max-width: 768px) {
  .app-bar__nav { display: none; }
  .hamburger { display: flex; }
  .post-grid { grid-template-columns: 1fr; gap: 16px; }
  .article__title { font-size: 1.5rem; }
  .container { padding: 0 16px; }
  .home-hero { padding: 36px 0 32px; }
  .home-hero__desc { font-size: .875rem; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 20px; }
}
