/* ===== 半亩田农场官网全局样式 ===== */

/* === CSS变量 === */
:root {
  /* 主色调 - 从设计图提取 */
  --primary-green: #4CD964;
  --primary-green-dark: #2E7D32;
  --primary-green-light: #E8F5E9;
  --primary-green-gradient: linear-gradient(135deg, #4CD964 0%, #2E7D32 100%);

  /* 蓝色系 */
  --sky-blue: #5BB8EA;
  --sky-blue-light: #D6F0FD;
  --sky-blue-dark: #3A8BC8;
  --water-blue: #4FC3F7;

  /* 橙/金色系 */
  --accent-orange: #F5A623;
  --accent-orange-light: #FFF3E0;
  --accent-gold: #FFD700;

  /* 棕色系 */
  --brown: #5C3D2E;
  --brown-dark: #3E2723;
  --brown-light: #8D6E63;

  /* 中性色 */
  --white: #FFFFFF;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EEEEEE;
  --gray-300: #E0E0E0;
  --gray-400: #BDBDBD;
  --gray-500: #9E9E9E;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;

  /* 功能色 */
  --red: #FF5252;
  --red-light: #FFEBEE;
  --yellow: #FFEB3B;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 2px 8px rgba(46, 125, 50, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(46, 125, 50, 0.15);

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;

  /* 过渡 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* 最大宽度 */
  --max-width: 1200px;
  --content-width: 960px;
}

/* === 重置与基础 === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  color: var(--brown-dark);
  background-color: var(--gray-50);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* === 布局工具类 === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.content-width {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.gap-xl {
  gap: var(--space-xl);
}

.text-center {
  text-align: center;
}

/* === 文字工具类 === */
.text-xs {
  font-size: 12px;
}

.text-sm {
  font-size: 14px;
}

.text-base {
  font-size: 16px;
}

.text-lg {
  font-size: 18px;
}

.text-xl {
  font-size: 20px;
}

.text-2xl {
  font-size: 24px;
}

.text-3xl {
  font-size: 32px;
}

.text-4xl {
  font-size: 40px;
}

.text-5xl {
  font-size: 48px;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.font-medium {
  font-weight: 500;
}

/* === 颜色工具类 === */
.text-primary {
  color: var(--primary-green);
}

.text-brown {
  color: var(--brown);
}

.text-brown-dark {
  color: var(--brown-dark);
}

.text-gray {
  color: var(--gray-600);
}

.text-white {
  color: var(--white);
}

.text-orange {
  color: var(--accent-orange);
}

.text-blue {
  color: var(--sky-blue);
}

.text-red {
  color: var(--red);
}

.bg-green {
  background-color: var(--primary-green);
}

.bg-green-light {
  background-color: var(--primary-green-light);
}

.bg-blue-light {
  background-color: var(--sky-blue-light);
}

.bg-orange-light {
  background-color: var(--accent-orange-light);
}

.bg-white {
  background-color: var(--white);
}

.bg-gray {
  background-color: var(--gray-100);
}

/* === 按钮组件 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 600;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.btn-primary {
  background: var(--primary-green-gradient);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(76, 217, 100, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 217, 100, 0.4);
}

.btn-blue {
  background: linear-gradient(135deg, var(--sky-blue) 0%, var(--sky-blue-dark) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(91, 184, 234, 0.3);
}

.btn-blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 184, 234, 0.4);
}

.btn-orange {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #E69100 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

.btn-orange:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.4);
}

.btn-white {
  background: var(--white);
  color: var(--primary-green);
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--primary-green);
  border: 2px solid var(--primary-green);
}

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

.btn-sm {
  padding: 8px 20px;
  font-size: 14px;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 18px;
}

/* === 卡片组件 === */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
}

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

.card-green {
  background: linear-gradient(135deg, var(--primary-green-light) 0%, var(--white) 100%);
  border: 1px solid rgba(76, 217, 100, 0.15);
}

.card-blue {
  background: linear-gradient(135deg, var(--sky-blue-light) 0%, var(--white) 100%);
  border: 1px solid rgba(91, 184, 234, 0.15);
}

.card-orange {
  background: linear-gradient(135deg, var(--accent-orange-light) 0%, var(--white) 100%);
  border: 1px solid rgba(245, 166, 35, 0.15);
}

/* === 标签组件 === */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.tag-green {
  background: var(--primary-green-light);
  color: var(--primary-green-dark);
}

.tag-blue {
  background: var(--sky-blue-light);
  color: var(--sky-blue-dark);
}

.tag-orange {
  background: var(--accent-orange-light);
  color: #E69100;
}

.tag-red {
  background: var(--red-light);
  color: var(--red);
}

/* === 徽章组件 === */
.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: var(--red);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(255, 82, 82, 0.3);
}

/* === 导航栏 === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all var(--transition-normal);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 20px;
  color: var(--brown-dark);
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-700);
  transition: color var(--transition-fast);
  position: relative;
  padding: 4px 0;
}

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

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-green);
  border-radius: var(--radius-full);
}

.nav-cta {
  background: var(--primary-green-gradient);
  color: var(--white) !important;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(76, 217, 100, 0.3);
}

.nav-cta:hover {
  box-shadow: 0 4px 12px rgba(76, 217, 100, 0.4);
  transform: translateY(-1px);
}

/* === 移动端导航 === */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--brown-dark);
  border-radius: 2px;
  transition: all var(--transition-normal);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-md);
  box-shadow: var(--shadow-lg);
  z-index: 999;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav .nav-link {
  display: block;
  padding: var(--space-md);
  border-bottom: 1px solid var(--gray-100);
  text-align: center;
}

.mobile-nav .nav-link:last-child {
  border-bottom: none;
}

/* === Footer === */
.footer {
  background: linear-gradient(135deg, var(--brown-dark) 0%, #2a1a10 100%);
  color: var(--gray-400);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.footer-brand .logo {
  color: var(--white);
  margin-bottom: var(--space-md);
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-500);
}

.footer-title {
  color: var(--white);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: var(--space-lg);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-links a {
  color: var(--gray-500);
  font-size: 14px;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-green);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 13px;
  color: var(--gray-600);
}

/* === 页面标题区 === */
.page-header {
  padding: 120px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--primary-green-light) 0%, var(--gray-50) 100%);
}

.page-header h1 {
  font-size: 40px;
  font-weight: 700;
  color: var(--brown-dark);
  margin-bottom: var(--space-md);
}

.page-header p {
  font-size: 18px;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto;
}

/* === Section 通用 === */
.section {
  padding: var(--space-4xl) 0;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--brown-dark);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  font-size: 18px;
  color: var(--gray-600);
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-3xl);
}

.section-tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary-green-light);
  color: var(--primary-green-dark);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
  text-align: center;
}

/* === 动画 === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-bounce {
  animation: bounce 2s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* === 响应式 === */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --space-4xl: 64px;
    --space-3xl: 48px;
  }

  .section-title {
    font-size: 28px;
  }

  .section-subtitle {
    font-size: 16px;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .page-header h1 {
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .container,
  .content-width {
    padding: 0 var(--space-md);
  }

  .section {
    padding: var(--space-3xl) 0;
  }

  .section-title {
    font-size: 24px;
  }

  .btn-lg {
    padding: 14px 32px;
    font-size: 16px;
  }
}

/* === 装饰元素 === */
.decoration-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.1;
}

.decoration-leaf {
  position: absolute;
  pointer-events: none;
  opacity: 0.15;
}

/* === 渐变背景 === */
.bg-gradient-green {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 50%, #E8F5E9 100%);
}

.bg-gradient-blue {
  background: linear-gradient(135deg, #D6F0FD 0%, #B3E0F7 50%, #D6F0FD 100%);
}

.bg-gradient-warm {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 50%, #FFF3E0 100%);
}

/* === 分割线 === */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-300), transparent);
  margin: var(--space-2xl) 0;
}

/* === 滚动条美化 === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}
