/* ==========================================
   抗旱保水剂 Programmatic SEO - Main Styles
   ========================================== */

/* --- CSS Variables --- */
:root {
  --color-soil: #5C4033;
  --color-soil-light: #8B7355;
  --color-green: #3A7D44;
  --color-green-light: #5DAE6B;
  --color-green-pale: #E8F3E9;
  --color-sand: #F5E6D3;
  --color-sand-light: #FBF6EF;
  --color-water: #4A90B8;
  --color-water-light: #D6EBF5;
  --color-text: #2D2D2D;
  --color-text-muted: #6B6B6B;
  --color-text-light: #8A8A8A;
  --color-white: #FFFFFF;
  --color-border: #E5E0D8;

  --font-heading: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --max-width: 1280px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-sand-light);
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-green); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-green-light); }

/* --- Utility --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

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

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

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-soil);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-green), var(--color-green-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.main-nav { display: flex; gap: 32px; }
.main-nav a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--color-green);
  border-color: var(--color-green);
}

.mobile-menu-btn {
  display: none;
  background: none; border: none;
  font-size: 1.5rem; cursor: pointer;
  color: var(--color-text);
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: block; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--color-white);
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    gap: 12px;
  }
}

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--color-text-light);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-green); }
.breadcrumb .sep { margin: 0 4px; }

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, #3D5A3C 0%, #2C4A2B 40%, #5C4033 100%);
  color: var(--color-white);
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../assets/images/hero-farmland.webp') center/cover no-repeat;
  opacity: 0.35;
  mix-blend-mode: overlay;
}

.hero .container { position: relative; z-index: 1; }

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  max-width: 700px;
}

.hero .subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 560px;
  line-height: 1.7;
}

.hero-search {
  margin-top: 32px;
  display: flex;
  gap: 0;
  max-width: 520px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
  color: var(--color-text);
}

.hero-search input::placeholder { color: var(--color-text-light); }

.hero-search button {
  background: var(--color-green);
  color: white;
  border: none;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.hero-search button:hover { background: var(--color-green-light); }

/* --- Section Common --- */
.section {
  padding: 64px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--color-soil);
  margin-bottom: 8px;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

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

@media (max-width: 1024px) { .card-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .card-grid-3, .card-grid-4 { grid-template-columns: 1fr; }
}

/* --- Card Styles --- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--color-green-pale);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.card:hover .card-image img { transform: scale(1.05); }

.card-body { padding: 20px 24px 24px; flex: 1; display: flex; flex-direction: column; }

.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-green);
  background: var(--color-green-pale);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--color-text);
  line-height: 1.4;
}

.card-body p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
}

.card-body .card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-green);
}
.card-body .card-link::after { content: '→'; }

/* --- Quick Nav Bento --- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
}

@media (max-width: 768px) { .bento-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .bento-grid { grid-template-columns: 1fr; } }

.bento-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bento-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-green);
}

.bento-card.featured {
  grid-column: span 2;
  grid-row: span 2;
  background: linear-gradient(135deg, var(--color-green-pale), var(--color-sand-light));
}

@media (max-width: 640px) { .bento-card.featured { grid-column: span 1; grid-row: span 1; } }

.bento-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.bento-icon.green { background: var(--color-green-pale); color: var(--color-green); }
.bento-icon.brown { background: var(--color-sand); color: var(--color-soil); }
.bento-icon.blue { background: var(--color-water-light); color: var(--color-water); }

.bento-card h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

.bento-card p {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.bento-card.featured h4 { font-size: 1.35rem; }

.bento-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-green);
}

/* --- Stats Bar --- */
.stats-bar {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 32px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

@media (max-width: 640px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-item .stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-green);
  line-height: 1.2;
}

.stat-item .stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* --- FAQ Section --- */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 24px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--color-green);
  transition: transform 0.2s;
}

.faq-item.open .faq-question::after { content: '−'; }

.faq-answer {
  display: none;
  padding: 0 24px 20px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.faq-item.open .faq-answer { display: block; }

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--color-green), #2C5A32);
  color: white;
  text-align: center;
  padding: 72px 0;
}

.cta-section h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 12px;
}

.cta-section p {
  opacity: 0.9;
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--color-white);
  color: var(--color-green);
}
.btn-primary:hover { background: var(--color-sand-light); }

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.5);
}
.btn-outline:hover { border-color: white; background: rgba(255,255,255,0.1); }

/* --- Detail Page Styles --- */
.detail-hero {
  background: linear-gradient(135deg, #3D5A3C 0%, #2C4A2B 100%);
  color: white;
  padding: 56px 0 48px;
}

.detail-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.35;
  max-width: 800px;
}

.detail-hero .meta {
  margin-top: 12px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.detail-content {
  max-width: 840px;
  margin: 0 auto;
  padding: 48px 24px;
}

.detail-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-soil);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-green-pale);
}

.detail-content h2:first-child { margin-top: 0; }

.detail-content h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--color-text);
  margin: 24px 0 10px;
}

.detail-content p {
  color: var(--color-text-muted);
  line-height: 1.85;
  margin-bottom: 16px;
}

.detail-content ul, .detail-content ol {
  padding-left: 24px;
  color: var(--color-text-muted);
  line-height: 1.85;
  margin-bottom: 16px;
}

.detail-content li { margin-bottom: 6px; }

/* --- Data Table --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.data-table thead { background: var(--color-green); color: white; }

.data-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 600;
}

.data-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.data-table tbody tr:hover { background: var(--color-green-pale); }

.data-table tbody tr:last-child td { border-bottom: none; }

/* --- Highlight Box --- */
.highlight-box {
  background: var(--color-green-pale);
  border-left: 4px solid var(--color-green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px 24px;
  margin: 24px 0;
}

.highlight-box.warning {
  background: #FFF3E0;
  border-left-color: #E67E22;
}

.highlight-box strong { color: var(--color-green); display: block; margin-bottom: 4px; }

/* --- Comparison Table --- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.compare-table th, .compare-table td {
  padding: 14px 18px;
  border: 1px solid var(--color-border);
  text-align: left;
  font-size: 0.9rem;
}

.compare-table th {
  background: var(--color-sand);
  font-weight: 600;
  color: var(--color-soil);
}

.compare-table td:first-child {
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-sand-light);
}

.compare-table .winner {
  background: var(--color-green-pale) !important;
  font-weight: 600;
}

/* --- Related Pages --- */
.related-section {
  background: var(--color-white);
  padding: 56px 0;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 768px) { .related-grid { grid-template-columns: 1fr; } }

.related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s;
}

.related-card:hover {
  border-color: var(--color-green);
  background: var(--color-green-pale);
}

.related-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-green-pale);
  color: var(--color-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.related-info h5 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.related-info span {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* --- Footer --- */
.site-footer {
  background: var(--color-soil);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-col h4 {
  color: white;
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-col p { font-size: 0.88rem; line-height: 1.7; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(255,255,255,0.6); font-size: 0.88rem; }
.footer-col a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 20px;
  font-size: 0.82rem;
  text-align: center;
}

/* --- Scroll Animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Mobile responsive helper --- */
@media (max-width: 640px) {
  .hero { padding: 48px 0 40px; }
  .hero-search { flex-direction: column; }
  .hero-search button { width: 100%; }
  .section { padding: 40px 0; }
  .detail-content { padding: 32px 16px; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 10px 12px; }
}
