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

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

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

.animate-fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.6s ease-out forwards; }
.animate-fade-in-right { animation: fadeInRight 0.6s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.5s ease-out forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* 初始隐藏，等待滚动触发 */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

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

.scroll-animate-left.visible {
  opacity: 1;
  transform: translateX(0);
}

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

.scroll-animate-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scroll-animate-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* 数字计数动画 */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 卡片悬停增强 */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 按钮脉冲效果 */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

.btn-pulse {
  animation: pulse 2s infinite;
}

/* 渐变边框动画 */
@keyframes gradientBorder {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-border {
  background: linear-gradient(90deg, #10b981, #34d399, #10b981);
  background-size: 200% 200%;
  animation: gradientBorder 3s ease infinite;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 移除主题默认的链接下划线，修复按钮和导航带下划线的问题 */
a, button {
  text-decoration: none !important;
}

/* 移动端/平板端导航按钮使用明确样式，避免工具类未生效 */
#mobile-menu-btn {
  background-color: #f5f5f4 !important; /* stone-100 */
  border-radius: 0.375rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

#mobile-menu-btn:hover {
  color: #059669 !important; /* emerald-600 */
}

/* 修复主题高优先级 CSS 导致 hover:text-* 失效变成黑色的问题 */
.hover\:text-emerald-400:hover { color: #34d399 !important; }
.hover\:text-emerald-500:hover { color: #10b981 !important; }
.hover\:text-emerald-600:hover { color: #059669 !important; }
.hover\:text-emerald-700:hover { color: #047857 !important; }
.hover\:text-emerald-800:hover { color: #065f46 !important; }
.hover\:text-emerald-900:hover { color: #064e3b !important; }
.hover\:text-white:hover { color: #ffffff !important; }
.hover\:text-stone-900:hover { color: #1c1917 !important; }
.hover\:text-stone-800:hover { color: #292524 !important; }
.hover\:text-stone-600:hover { color: #57534e !important; }

/* 所有带背景色且本身是白字的 a 按钮在 hover 时保持白字 */
a[class*="bg-"][class*="text-white"]:hover {
  color: #ffffff !important;
}

a[class*="bg-"][class*="text-white"]:hover svg {
  color: #ffffff !important;
}

/* 浅色按钮在 hover 时保持绿色文字 */
a[class*="bg-white"][class*="text-emerald-"]:hover {
  color: #059669 !important;
}

a[class*="bg-white"][class*="text-emerald-"]:hover svg {
  color: #059669 !important;
}




/* ==========================================================================
   SiWei Core Section Components (SW) - Based on HTML Prototypes
   ========================================================================== */

/* 通用 Section 样式 */
.sw-section {
  padding: 5rem 1.5rem;
}
@media (min-width: 1024px) {
  .sw-section { padding: 8rem 3rem; }
}

.sw-section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: #1c1917; /* stone-900 */
  margin-bottom: 1.5rem;
  text-align: center;
}
@media (min-width: 1024px) {
  .sw-section-title { font-size: 3rem; }
}

.sw-section-subtitle {
  font-size: 1.125rem;
  color: #57534e; /* stone-600 */
  text-align: center;
  max-width: 48rem;
  margin: 0 auto 3rem auto;
  line-height: 1.6;
}

/* 1. Banner (Hero Section) */
.sw-banner {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ffffff;
  padding: 6rem 1.5rem;
  overflow: hidden;
}
.sw-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5); /* 默认遮罩层 */
  z-index: 1;
}
.sw-banner-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 64rem;
  margin: 0 auto;
}

/* 2. CTA (Call to Action) */
.sw-cta-box {
  background-color: #059669; /* emerald-600 */
  color: #ffffff;
  border-radius: 1.5rem;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(5, 150, 105, 0.2);
}

/* 3. 合作流程 (Cooperation Process) */
.sw-process-card {
  background: #ffffff;
  border: 1px solid #e7e5e4; /* stone-200 */
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  height: 100%;
}
.sw-process-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
  border-color: #10b981; /* emerald-500 */
}
.sw-process-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background-color: #ecfdf5; /* emerald-50 */
  color: #059669; /* emerald-600 */
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

/* 4. FAQs */
.sw-faq-item {
  border-bottom: 1px solid #e7e5e4; /* stone-200 */
  transition: all 0.3s ease;
}
.sw-faq-item:last-child {
  border-bottom: none;
}
.sw-faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1c1917; /* stone-900 */
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
}
.sw-faq-question:hover {
  color: #059669; /* emerald-600 */
}
.sw-faq-answer {
  padding-bottom: 1.5rem;
  color: #57534e; /* stone-600 */
  line-height: 1.6;
  display: none;
}
.sw-faq-item.active .sw-faq-answer {
  display: block;
  animation: fadeInUp 0.3s ease-out forwards;
}
.sw-faq-item.active .sw-faq-icon {
  transform: rotate(180deg);
}
.sw-faq-icon {
  transition: transform 0.3s ease;
}

/* 5. 产品展示 (Product Cards) */
.sw-product-card {
  background: #ffffff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.sw-product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.sw-product-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background-color: #f5f5f4; /* stone-100 */
}

/* 6. 工厂实力/核心优势 (Features / Capabilities) */
.sw-feature-item {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e7e5e4;
  transition: all 0.3s ease;
}
.sw-feature-item:hover {
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  border-color: #10b981;
}
.sw-feature-icon {
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  background: #ecfdf5; /* emerald-50 */
  color: #059669; /* emerald-600 */
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 7. 客户评价 (Testimonials) */
.sw-testimonial-card {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.sw-testimonial-quote-icon {
  color: #059669; /* emerald-600 */
  opacity: 0.15;
  margin-bottom: 1.5rem;
}

/* 8. CTA Popup */
body.sw-cta-popup-open {
  overflow: hidden;
}

.sw-cta-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sw-cta-popup.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sw-cta-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.58);
}

.sw-cta-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(1280px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  border-radius: 1.5rem;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.18);
}

.sw-cta-popup__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sw-cta-popup__close svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.sw-cta-popup__close:hover {
  background: #059669;
  color: #ffffff;
}

.sw-cta-popup__form,
.sw-cta-popup__form .infility-form {
  width: 100%;
}

.sw-cta-popup__form .infility-form-row-3 .infility-form-col-1 .label {
  display: none;
}

.sw-cta-popup__form .infility-form-row-3 .infility-form-col-file input[type="file"] {
  padding: 0;
}

.sw-cta-popup__form .infility-form-row-submit button {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .sw-cta-popup__dialog {
    width: min(960px, 100%);
  }
}

@media (max-width: 767px) {
  .sw-cta-popup {
    padding: 0.75rem;
  }

  .sw-cta-popup__dialog {
    max-height: calc(100vh - 1.5rem);
    overflow-y: auto;
    border-radius: 1rem;
  }

  .sw-cta-popup__close {
    top: 0.5rem;
    right: 0.5rem;
  }
}

/* 9. Exit Intent Popup */
body.sw-exit-popup-open {
  overflow: hidden;
}

.sw-exit-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sw-exit-popup.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sw-exit-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.58);
}

.sw-exit-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  gap: 3rem;
  padding: 40px;
  background: #f8f8f8;
  border: 1px solid rgba(28, 25, 23, 0.15);
  border-radius: 1.5rem;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.18);
}

.sw-exit-popup__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  color: #111827;
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
}

.sw-exit-popup__close:hover,
.sw-exit-popup__close:focus,
.sw-exit-popup__close:focus-visible {
  background: transparent;
  color: #111827;
}

.sw-exit-popup__media {
  min-height: 520px;
  border-radius: 0;
  overflow: hidden;
  background: #ececec;
}

.sw-exit-popup__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sw-exit-popup__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 30rem;
}

.sw-exit-popup__title {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  font-weight: 800;
  color: #111827;
}

.sw-exit-popup__desc {
  margin: 0 0 2rem;
  color: #44403c;
  font-size: 1.125rem;
  line-height: 1.6;
}

.sw-exit-popup__form,
.sw-exit-popup__form .infility-form {
  width: 100%;
}

.sw-exit-popup__form .infility-form-row-0,
.sw-exit-popup__form .infility-form-row-1,
.sw-exit-popup__form .infility-form-row-4,
.sw-exit-popup__form .infility-form-col-file,
.sw-exit-popup__form .privacy {
  /* display: none !important; */
}

.sw-exit-popup__form .infility-form-row-2,
.sw-exit-popup__form .infility-form-row-3 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.sw-exit-popup__form .infility-form-col-textarea {
  grid-column: 1 / -1;
}

.sw-exit-popup__form label,
.sw-exit-popup__form .label,
.sw-exit-popup__form .input {
  display: block;
  width: 100%;
}

.sw-exit-popup__form .label {
  margin-bottom: 0.55rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #44403c;
}

.sw-exit-popup__form .label span:last-child {
  color: #44403c;
}

.sw-exit-popup__form input[type="text"],
.sw-exit-popup__form input[type="email"],
.sw-exit-popup__form textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid #bfb8b1;
  border-radius: 0;
  background: #ffffff;
  color: #1f2937;
  box-shadow: none;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sw-exit-popup__form input[type="text"],
.sw-exit-popup__form input[type="email"] {
  min-height: 3rem;
}

.sw-exit-popup__form textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.sw-exit-popup__form input[type="text"]:focus,
.sw-exit-popup__form input[type="email"]:focus,
.sw-exit-popup__form textarea:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.sw-exit-popup__form textarea::placeholder {
  color: #a8a29e;
}

.sw-exit-popup__form .infility-form-row-submit {
  margin-top: 1.5rem;
}

.sw-exit-popup__form button[type="submit"],
.sw-exit-popup__fallback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 3.5rem;
  padding: 0.95rem 1.5rem;
  background: #242424;
  color: #ffffff !important;
  border: none;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.sw-exit-popup__form button[type="submit"]:hover,
.sw-exit-popup__fallback-btn:hover {
  background: #111827;
  transform: translateY(-1px);
}

.sw-exit-popup__privacy {
  margin: 1rem 0 0;
  color: #a8a29e;
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .sw-exit-popup__dialog {
    gap: 2rem;
    padding: 3rem 2rem 2rem;
  }
}

@media (max-width: 767px) {
  .sw-exit-popup {
    padding: 1rem;
  }

  .sw-exit-popup__dialog {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 3rem 1.25rem 1.5rem;
  }

  .sw-exit-popup__media {
    min-height: 240px;
  }

  .sw-exit-popup__content {
    max-width: none;
  }

  .sw-exit-popup__form .infility-form-row-2,
  .sw-exit-popup__form .infility-form-row-3 {
    grid-template-columns: 1fr;
  }

  .sw-exit-popup__form button[type="submit"],
  .sw-exit-popup__fallback-btn {
    width: 100%;
  }
}
