/* 复用组件：三页共享。改这里必须同步复查 index / category / detail */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, dl, dd, dt, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container {
  width: min(var(--w-container), calc(100% - 54px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--c-brand);
  color: var(--c-hero-text);
  padding: 10px 16px;
  z-index: 99;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn::after {
  content: "→";
  font-size: 14px;
  line-height: 1;
}
.btn-solid { background: var(--c-accent); color: #f7f9ef; }
.btn-solid:hover { background: var(--c-accent-dark); }
.btn-ghost { border-color: rgba(244, 245, 236, 0.55); color: var(--c-hero-text); background: transparent; }
.btn-ghost:hover { background: rgba(244, 245, 236, 0.12); border-color: rgba(244, 245, 236, 0.85); }
.btn-dark { background: var(--c-brand); color: #eef1e3; }
.btn-dark:hover { background: #16281b; }
.btn-sage { background: var(--c-sage-2); color: #2c3d27; height: 32px; padding: 0 14px; font-size: 12.5px; }
.btn-sage:hover { background: #cfdcb9; }

.text-link {
  color: var(--c-accent-dark);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid rgba(61, 97, 64, 0.35);
}
.text-link:hover { border-bottom-color: var(--c-accent-dark); }

/* ---------------------------------------------------------------- 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-brand);
  color: var(--c-hero-text);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--h-header);
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #7fae6d;
  color: #1f2f18;
  flex: none;
}
.brand-icon svg { width: 18px; height: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: 0.01em; }
.brand-sub { font-size: 10.5px; color: #b9c9b1; letter-spacing: 0.02em; }

.site-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.site-nav a {
  position: relative;
  font-size: var(--fs-nav);
  color: #e7ecdc;
  white-space: nowrap;
  padding: 6px 0;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #9dc77f;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.site-nav a:hover::after,
.site-nav a.is-active::after { opacity: 1; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(231, 236, 220, 0.45);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--c-hero-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.nav-toggle::before {
  content: "";
  width: 14px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

/* ---------------------------------------------------------------- 区块栏头 */
.section-head { display: flex; align-items: center; gap: 18px; }
.section-head h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.section-head .rule { flex: 1; height: 1px; background: var(--c-line-2); }
.section-head.center { justify-content: center; }
.section-head.center .rule { flex: 0 0 90px; }
.section-head.center h2 { flex: none; }

.col-head { display: flex; align-items: center; gap: 14px; }
.col-head h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-left: 14px;
  border-left: 4px solid #7f9f6a;
  line-height: 1.2;
}

/* ---------------------------------------------------------------- 小元件 */
.tag {
  display: inline-block;
  font-size: 12px;
  line-height: 1.6;
  color: #4c5c41;
  background: rgba(94, 128, 84, 0.12);
  border-radius: 4px;
  padding: 1px 7px;
}
.thumb { overflow: hidden; border-radius: var(--r-sm); background: var(--c-sage); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- 页脚 */
.site-footer {
  background: var(--c-brand);
  color: #dfe6d4;
  padding: 30px 0 19px;
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.72fr 1.1fr;
  gap: 0;
}
.footer-col { padding: 0 30px; border-left: 1px solid rgba(220, 230, 205, 0.16); }
.footer-col:first-child { border-left: 0; padding-left: 0; }
.footer-col h3 {
  font-size: 15px;
  font-weight: 700;
  color: #f0f3e6;
  margin-bottom: 10px;
}
.footer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.footer-brand .brand-icon { width: 26px; height: 26px; background: #7fae6d; }
.footer-brand span { font-size: 17px; font-weight: 700; color: #f2f5e8; }
.footer-tagline { color: #c3cfb7; line-height: 1.8; max-width: 300px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #ccd8bf; }
.footer-links a:hover { color: #ffffff; text-decoration: underline; text-underline-offset: 3px; }
.footer-note { color: #b9c6ad; line-height: 1.9; }
.footer-bottom {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(220, 230, 205, 0.16);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #a8b79c;
  font-size: 12px;
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1180px) {
  .site-nav { gap: 18px; }
  .brand-sub { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 0; }
  .footer-col:nth-child(3) { border-left: 0; padding-left: 0; }
}

@media (max-width: 900px) {
  .container { width: calc(100% - 40px); }
  :root { --fs-h1: 48px; --fs-h2: 26px; --fs-hero-sub: 22px; }
  .site-nav {
    position: fixed;
    inset: var(--h-header) 0 auto 0;
    z-index: 49;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 18px;
    background: var(--c-brand);
    box-shadow: 0 18px 30px rgba(15, 25, 15, 0.3);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid rgba(220, 230, 205, 0.14); }
  .site-nav a::after { display: none; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
}

@media (max-width: 620px) {
  :root { --fs-h1: 40px; --fs-h2: 22px; --fs-hero-sub: 18px; --fs-lede: 15px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-col { border-left: 0; padding: 0; border-top: 1px solid rgba(220, 230, 205, 0.16); padding-top: 16px; }
  .footer-col:first-child { border-top: 0; padding-top: 0; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}
