/* ============================================
   阿姨优选 - 全局自定义样式
   ============================================ */

/* --- 基础设置 --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- 自定义动画 --- */

/* 淡入 */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 从下方淡入 */
@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 zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 滑动显示（用于导航栏隐藏/显示） */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 动画工具类 */
.animate-fade-in     { animation: fadeIn    0.6s ease forwards; }
.animate-fade-in-up  { animation: fadeInUp  0.7s ease forwards; }
.animate-fade-in-left{ animation: fadeInLeft 0.7s ease forwards; }
.animate-fade-in-right{animation: fadeInRight 0.7s ease forwards; }
.animate-zoom-in     { animation: zoomIn    0.6s ease forwards; }

/* 滚动触发动画（初始隐藏） */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* --- 轮播图样式 --- */
.banner-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1920 / 550;
  max-height: 550px;
}

.banner-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.banner-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* 轮播指示器 */
.banner-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.banner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
  border: none;
  padding: 0;
}

.banner-dot.active {
  background: #3CB39F;
  transform: scale(1.3);
}

/* 轮播箭头 */
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  color: #333;
}

.banner-arrow:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #3CB39F;
}

.banner-arrow--prev { left: 16px; }
.banner-arrow--next { right: 16px; }

/* --- 导航栏滚动效果 --- */
.nav-scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(6px);
}

/* 当前页面导航高亮 */
.nav-link-active {
  color: #3CB39F !important;
  font-weight: 600;
}

/* --- 卡片悬浮效果 --- */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(60, 179, 159, 0.18);
}

/* --- 按钮样式 --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  background: #3CB39F;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background: #339e8d;
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border: 2px solid #3CB39F;
  color: #3CB39F;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
  text-decoration: none;
}

.btn-outline:hover {
  background: #3CB39F;
  color: #fff;
  transform: translateY(-2px);
}

/* --- 分区标题 --- */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: #2D3436;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1rem;
  color: #636E72;
  text-align: center;
  margin-bottom: 3rem;
}

/* 标题装饰线 */
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #3CB39F, #4ECDC4);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* --- 移动端菜单动画 --- */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

#mobile-menu.open {
  max-height: 500px;
}

/* --- 加载占位 --- */
.img-placeholder {
  background: linear-gradient(135deg, #e0f2ef 0%, #f0f9f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3CB39F;
  font-size: 0.875rem;
}

/* --- 页面内锚点偏移（避免 fixed header 遮挡） --- */
[id] {
  scroll-margin-top: 80px;
}

/* --- 子页面Banner横幅 --- */
.page-hero {
  max-height: 400px;
  overflow: hidden;
}

/* --- SEO友好隐藏 - 视觉隐藏但搜索引擎可读 --- */
.seo-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- 响应式调整 --- */
@media (max-width: 1024px) and (min-width: 769px) {
  .banner-slider {
    aspect-ratio: 1920 / 450;
    max-height: 450px;
  }
  .page-hero {
    max-height: 320px;
  }
}

@media (max-width: 768px) {
  .section-title {
    font-size: 1.5rem;
  }
  .banner-arrow {
    width: 36px;
    height: 36px;
  }
  .banner-slider {
    aspect-ratio: 1920 / 550;
    max-height: 350px;
  }
  .page-hero {
    max-height: 250px;
  }
}

/* --- 悬浮挂件 --- */
#floating-widget {
  transition: opacity 0.3s ease;
}

/* 移动端隐藏挂件（避免遮挡内容） */
@media (max-width: 768px) {
  #floating-widget {
    display: none;
  }
}
