/* ==========================================================================
   Open Source 首页（展示页） - csr-home
   模板：template-home.php
   ========================================================================== */

/* Astra 容器复位：让 Hero 可以整屏铺满 */
.page-template-template-home .site-content > .ast-container,
.page-template-template-home .ast-container,
.page-template-template-home #primary,
.page-template-template-home .ast-article-single,
.page-template-template-home .entry-content {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.page-template-template-home .entry-header,
.page-template-template-home .ast-single-entry-breadcrumbs,
.page-template-template-home .ast-breadcrumbs-wrapper {
  display: none;
}

/* 兜底：首页不显示站点页脚（正常情况已由模板 remove_action 移除，此处防止附加组件再次注入） */
.page-template-template-home #colophon.site-footer,
.page-template-template-home .site-footer {
  display: none;
}

.page-template-template-home .entry-content > * {
  margin-top: 0;
}

.csr-home {
  --csr-ink: #0f1f18;
  --csr-muted: #41544a;
  --csr-line: rgba(20, 40, 31, 0.1);
  --csr-primary: #2e8555;
  --csr-primary-dark: #1f6a41;
  --csr-accent: #d98324;
  --csr-surface: #ffffff;
  --csr-soft: #f2f8f4;

  width: 100%;
  color: var(--csr-ink);
  background: var(--csr-soft);
  line-height: 1.7;
}

.csr-wrap {
  width: min(1160px, 92vw);
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Hero Banner
   -------------------------------------------------------------------------- */

.csr-hero {
  position: relative;
  padding: 86px 0 64px;
  overflow: hidden;
  background:
    radial-gradient(900px 460px at 8% -10%, rgba(46, 133, 85, 0.22), transparent 62%),
    radial-gradient(760px 420px at 100% 0%, rgba(217, 131, 36, 0.16), transparent 58%),
    linear-gradient(168deg, #f7fbf8 0%, #eaf5ee 58%, #f7fbf8 100%);
}

.csr-hero__inner {
  position: relative;
  z-index: 1;
}

.csr-hero__eyebrow {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(46, 133, 85, 0.24);
  background: rgba(46, 133, 85, 0.1);
  color: #1f6a41;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.csr-hero__title {
  margin: 18px 0 18px;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: #0b1e16;
}

.csr-hero__title span {
  display: block;
}

.csr-hero__title em {
  display: block;
  font-style: normal;
  background: linear-gradient(96deg, var(--csr-primary) 0%, #47a06d 55%, var(--csr-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.csr-hero__lead {
  margin: 0;
  max-width: 76ch;
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.85;
  color: var(--csr-muted);
}

.csr-hero__actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.csr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(20, 40, 31, 0.14);
  background: #fff;
  color: #234034 !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 6px 18px rgba(16, 35, 26, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.csr-btn:hover,
.csr-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(20, 40, 31, 0.24);
  box-shadow: 0 12px 26px rgba(16, 35, 26, 0.12);
}

.csr-btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--csr-primary) 0%, #26905a 100%);
  color: #fff !important;
  box-shadow: 0 14px 30px rgba(46, 133, 85, 0.28);
}

.csr-btn--primary:hover,
.csr-btn--primary:focus-visible {
  background: linear-gradient(135deg, var(--csr-primary-dark) 0%, #1e7b4b 100%);
}

.csr-hero__stats {
  list-style: none;
  margin: 42px 0 0;
  padding: 20px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  border-top: 1px solid rgba(20, 40, 31, 0.1);
}

.csr-hero__stats li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.csr-hero__stats strong {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.1;
  color: var(--csr-primary-dark);
  letter-spacing: -0.01em;
}

.csr-hero__stats span {
  font-size: 13px;
  color: var(--csr-muted);
}

/* --------------------------------------------------------------------------
   区块通用
   -------------------------------------------------------------------------- */

.csr-section {
  padding: 64px 0;
}

.csr-section__head {
  margin-bottom: 28px;
}

.csr-section__head h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #10231a;
}

.csr-section__head p {
  margin: 0;
  color: var(--csr-muted);
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   分类卡片：每行 3 个
   -------------------------------------------------------------------------- */

.csr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.csr-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  min-height: 196px;
  border: 1px solid var(--csr-line);
  border-radius: 16px;
  background: var(--csr-surface);
  text-decoration: none !important;
  color: inherit;
  box-shadow: 0 10px 26px rgba(16, 35, 26, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.csr-card:hover,
.csr-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(46, 133, 85, 0.42);
  box-shadow: 0 20px 40px rgba(16, 35, 26, 0.14);
}

.csr-card__badge {
  align-self: flex-start;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(46, 133, 85, 0.1);
  color: var(--csr-primary-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.csr-card.is-plain .csr-card__badge {
  background: rgba(20, 40, 31, 0.06);
  color: #55655d;
}

.csr-card__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  color: #12261c;
}

.csr-card__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--csr-muted);
}

.csr-empty {
  padding: 26px;
  border: 1px dashed rgba(20, 40, 31, 0.24);
  border-radius: 14px;
  background: #fff;
  color: var(--csr-muted);
}

/* --------------------------------------------------------------------------
   开源说明
   -------------------------------------------------------------------------- */

.csr-section--about {
  background: #fff;
  border-top: 1px solid var(--csr-line);
  border-bottom: 1px solid var(--csr-line);
}

.csr-about__lead {
  margin: 0 0 26px;
  max-width: 90ch;
  font-size: 16px;
  line-height: 1.9;
  color: #3c4b43;
}

.csr-about__points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.csr-about__points li {
  padding: 20px 22px;
  border: 1px solid var(--csr-line);
  border-left: 3px solid var(--csr-primary);
  border-radius: 12px;
  background: var(--csr-soft);
}

.csr-about__points strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  color: #12261c;
}

.csr-about__points span {
  font-size: 14px;
  line-height: 1.75;
  color: var(--csr-muted);
}

/* --------------------------------------------------------------------------
   底部入口
   -------------------------------------------------------------------------- */

.csr-band {
  padding: 46px 0;
  background: linear-gradient(120deg, #17392a 0%, #1f6a41 100%);
  color: #fff;
}

.csr-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.csr-band h2 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 28px);
  color: #fff;
  letter-spacing: -0.01em;
}

.csr-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.csr-band .csr-btn {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: #fff !important;
  box-shadow: none;
}

.csr-band .csr-btn:hover,
.csr-band .csr-btn:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.csr-band .csr-btn--primary {
  border-color: transparent;
  background: #fff;
  color: #17392a !important;
}

.csr-band .csr-btn--primary:hover,
.csr-band .csr-btn--primary:focus-visible {
  background: rgba(255, 255, 255, 0.88);
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .csr-hero {
    padding: 68px 0 52px;
  }

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

@media (max-width: 780px) {
  .csr-section {
    padding: 46px 0;
  }

  .csr-grid,
  .csr-about__points {
    grid-template-columns: 1fr;
  }

  .csr-hero__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .csr-hero__stats strong {
    font-size: 22px;
  }

  .csr-band__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .csr-hero__actions .csr-btn,
  .csr-band__actions .csr-btn {
    width: 100%;
  }

  .csr-hero__stats {
    grid-template-columns: 1fr;
  }

  .csr-hero__stats li {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
}
