/* ==========================================================================
   四川永丰农业科技有限公司 - 全局样式系统 (Design System - 修正重构版)
   - 品牌色系: 深翠绿 #1b4332 / 科技绿 #2d6a4f / 活力金 #d97706
   - 防御性布局: 彻底解决移动端横向溢出问题
   ========================================================================== */

/* 1. Design System 变量定义
   ========================================================================== */
:root {
  /* 品牌色系 */
  --primary-dark: #1b4332;      /* 深翠绿 - 沉稳信任 */
  --primary-medium: #2d6a4f;    /* 科技绿 - 主色调 */
  --primary-light: #40916c;     /* 亮翠绿 - 悬停与细节 */
  --accent-gold: #d97706;       /* 活力金/橙 - 高亮 CTA */
  --accent-gold-hover: #b45309; /* 活力金悬停 */
  
  /* 中性色系 */
  --bg-main: #f8fafc;           /* 暖白/浅灰背景 */
  --bg-surface: #ffffff;        /* 卡片白背景 */
  --bg-dark: #081c15;           /* 深色页脚背景 */
  --text-main: #1e293b;         /* 正文主要文字 */
  --text-muted: #64748b;        /* 辅助文字 */
  --text-light: #f1f5f9;        /* 暗色背景下的浅色文字 */
  --border-color: #e2e8f0;      /* 边框分割线 */

  /* 布局与留白 */
  --max-width: 1200px;
  --header-height: 80px;
  --section-padding: 5rem 1.5rem;
  
  /* 视觉效果 */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(27, 67, 50, 0.08);
  --shadow-lg: 0 12px 24px rgba(27, 67, 50, 0.12);
  --shadow-glow: 0 8px 20px rgba(217, 119, 6, 0.3);
  --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. 重置与全局防御性设置 (关键修复)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 防御性修复：禁止全局 X 轴滚动条 */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  /* 防御性修复：确保 body 宽度严格锁定 */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  padding-top: var(--header-height);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

ul {
  list-style: none;
}

/* 3. 通用布局与排版类
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-padding {
  padding: var(--section-padding);
}

.text-center { text-align: center; }
.text-gold { color: var(--accent-gold); }

/* 标题规范 */
.section-header {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  display: inline-block;
  padding: 0.35rem 1rem;
  background-color: rgba(45, 106, 79, 0.1);
  color: var(--primary-medium);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 50px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.section-title {
  font-size: 2.25rem;
  color: var(--primary-dark);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
  word-break: break-word;
}

.section-desc {
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* 4. 按钮样式 (包含 Hover 变色、缩放、发光阴影)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.85rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent-gold);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.2);
}

.btn-primary:hover {
  background-color: var(--accent-gold-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--primary-medium);
  color: var(--primary-medium);
}

.btn-secondary:hover {
  background-color: var(--primary-medium);
  color: #ffffff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-md);
}

/* 5. 吸顶导航栏 (Header)
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition-fast);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
  height: 70px;
}

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

/* 纯文字+CSS Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary-medium), var(--primary-dark));
  color: #ffffff;
  border-radius: 8px;
  font-size: 1.2rem;
}

.logo-text span {
  color: var(--accent-gold);
}

/* 桌面端导航 */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-medium);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-medium);
  transition: var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* 汉堡包按钮 */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--primary-dark);
  transition: var(--transition-fast);
}

/* 汉堡包按钮动画 */
.mobile-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-toggle.open span:nth-child(2) {
  opacity: 0;
}
.mobile-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 6. 英雄区 (Hero Section)
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  background: linear-gradient(rgba(8, 28, 21, 0.75), rgba(27, 67, 50, 0.85)), url('images/hero-bg.jpg') center/cover no-repeat;
  color: #ffffff;
  padding: 5rem 0;
  width: 100%;
  overflow: hidden;
}

.hero-content {
  max-width: 800px;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  max-width: 100%;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.5rem;
  max-width: 650px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  width: 100%;
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

/* 7. 痛点剖析 (Pain Points)
   ========================================================================== */
.pain-section {
  background-color: var(--bg-surface);
}

.pain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.pain-card {
  padding: 2.5rem 2rem;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.pain-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: rgba(45, 106, 79, 0.3);
}

.pain-icon {
  width: 50px;
  height: 50px;
  background-color: rgba(217, 119, 6, 0.1);
  color: var(--accent-gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.pain-title {
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
}

.pain-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* 8. 解决方案与服务 (Solutions)
   ========================================================================== */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.solution-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

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

.solution-img-wrapper {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.solution-img-wrapper img {
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

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

.solution-body {
  padding: 2rem;
}

.solution-title {
  font-size: 1.35rem;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
}

.solution-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.solution-features {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.solution-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.solution-features li::before {
  content: "✓";
  color: var(--primary-medium);
  font-weight: bold;
}

/* 9. 信任背书 (Social Proof)
   ========================================================================== */
.proof-section {
  background-color: #ffffff;
}

.proof-flex {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.proof-img-container img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
}

.proof-content h2 {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.proof-list {
  margin: 1.5rem 0;
}

.proof-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.proof-item-icon {
  width: 24px;
  height: 24px;
  background-color: var(--primary-medium);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.cert-badges {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.cert-badge-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

/* 10. 关于我们 (About Us)
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3.5rem;
  align-items: center;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

.about-contact-card {
  background-color: var(--primary-dark);
  color: #ffffff;
  padding: 2.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.about-contact-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 0.75rem;
}

.contact-info-list li {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
}

/* 11. FAQ 手风琴
   ========================================================================== */
.faq-section {
  background-color: var(--bg-surface);
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  overflow: hidden;
  background-color: #ffffff;
  transition: var(--transition-fast);
}

.faq-item.active {
  border-color: var(--primary-medium);
  box-shadow: var(--shadow-sm);
}

.faq-header {
  width: 100%;
  padding: 1.25rem 1.5rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-icon {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
  color: var(--primary-medium);
  margin-left: 0.5rem;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0, 1, 0, 1);
  padding: 0 1.5rem;
  background-color: #fafafa;
}

.faq-item.active .faq-body {
  max-height: 500px;
  padding: 0 1.5rem 1.25rem 1.5rem;
  transition: max-height 0.35s ease-in-out;
}

/* 12. 终极呼吁与表单 (CTA)
   ========================================================================== */
.cta-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
  color: #ffffff;
}

.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
}

.cta-text h2 {
  font-size: 2.25rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

.cta-text p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.lead-form {
  background-color: #ffffff;
  padding: 2.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  width: 100%;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary-medium);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-submit-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
}

/* 13. 页脚 (Footer)
   ========================================================================== */
.site-footer {
  background-color: var(--bg-dark);
  color: var(--text-light);
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.footer-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* 14. 响应式与防溢出断点适配 (Media Queries)
   ========================================================================== */
@media (max-width: 992px) {
  .hero-title { font-size: 2.5rem; }
  .proof-flex, .about-grid, .cta-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 3.5rem 1rem;
  }
  
  /* 移动端标题缩放 */
  .hero-title { font-size: 1.85rem; line-height: 1.3; }
  .hero-subtitle { font-size: 1rem; margin-bottom: 1.5rem; }
  
  /* Hero 按钮与数据在移动端 100% 宽度保护 */
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 2rem;
  }
  
  /* 关键修复：移动端导航菜单隐显机制改版，杜绝横向撑大视口 */
  .mobile-toggle { 
    display: flex; 
  }
  
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    max-width: 100vw;
    background-color: #ffffff;
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 1.25rem;
    box-shadow: var(--shadow-lg);
    
    /* 防抖与隐显优化 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 999;
  }

  .nav-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .header-cta { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .about-contact-card, .lead-form { padding: 1.5rem; }
}