@layer utilities {
  .text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
  .transition-all-300 {
    transition: all 0.3s ease;
  }
  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }
  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  /* 顶部和底部滚动条样式 */
  .custom-scrollbar {
    position: relative;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
  .custom-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
  }
  .scrollbar-top,
  .scrollbar-bottom {
    position: absolute;
    height: 3px;
    background-color: #4CAF50;
    transition: opacity 0.3s ease;
    z-index: 20;
  }
  .scrollbar-top {
    top: 0;
    left: 0;
    border-radius: 0 0 2px 2px;
  }
  .scrollbar-bottom {
    bottom: 0;
    left: 0;
    border-radius: 2px 2px 0 0;
  }
}

/* 自定义样式 - 彻底隐藏滚动条方案 */
html, body {
  font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  /* 禁用默认滚动条 */
  overflow: hidden;
  height: 100%;
  -webkit-overflow-scrolling: touch;
}

/* 为body设置安全区域，适配iPhone刘海屏 */
body {
  padding-bottom: env(safe-area-inset-bottom);
  padding-top: env(safe-area-inset-top);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* 为滚动容器添加滚动条隐藏样式 */
.scroll-container,
.scrollbar-hidden {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* 彻底隐藏WebKit滚动条 */
.scroll-container::-webkit-scrollbar,
.scrollbar-hidden::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none !important;
}

/* 针对所有可能滚动的元素 */
*,
*:before,
*:after,
html,
body,
:root {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

*::-webkit-scrollbar,
*:before::-webkit-scrollbar,
*:after::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none !important;
}

/* Chrome, Safari, Opera 和其他基于WebKit的浏览器 - 强化版 */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
:root::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none !important;
}

/* WebKit内核浏览器的所有滚动条元素 */
::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-corner {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* 确保所有滚动容器都隐藏滚动条 - 增强选择器 */
*,
*:before,
*:after,
html,
body,
:root {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* 为所有可能滚动的元素添加隐藏样式 */
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none !important;
}

/* 为所有可能出现滚动条的组件添加隐藏样式 */
.carousel-container,
.product-detail-page,
.main-content,
.content-section,
body,
html,
:root {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  overflow-y: auto;
  overflow-x: hidden;
}

.carousel-container::-webkit-scrollbar,
.product-detail-page::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.content-section::-webkit-scrollbar,
body::-webkit-scrollbar,
html::-webkit-scrollbar,
:root::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none !important;
}

/* 三部分布局样式 */
.top-section {
  position: relative;
  z-index: 10;
}

.content-section {
  /* min-height: calc(100vh - 14rem); */
  padding-bottom: 4rem; /* 为底部导航栏留出空间 */
  position: relative;
}

.bottom-section {
  position: relative;
  z-index: 50;
}

/* 底部导航样式优化 */
.fixed.bottom-0.left-0.right-0 {
  height: auto; /* 自动高度，避免高度冲突 */
  padding: 0.5rem 0; /* 调整内边距，确保一致的高度 */
}

/* 底部导航栏增强 */
.fixed.bottom-0 {
   box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.05);
 }

.fixed.bottom-0.left-0.right-0 .flex.justify-around {
  height: 100%;
  align-items: center;
}

.fixed.bottom-0.left-0.right-0 .nav-tab {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.category-item.active {
  color: #4CAF50;
  border-bottom: 2px solid #4CAF50;
}

.product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-inner {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-item {
  min-width: 100%;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  margin: 0 4px;
  transition: background-color 0.3s ease;
}

.indicator.active {
  background-color: white;
  width: 24px;
  border-radius: 4px;
}

/* 响应式调整 */
@media screen and (max-width: 375px) {
  .content-section {
    min-height: calc(100vh - 13rem);
    padding-bottom: 3.5rem;
  }
}

@media screen and (max-width: 320px) {
  .content-section {
    min-height: calc(100vh - 12rem);
    padding-bottom: 3rem;
  }
}
.mt-3 {
  margin-top: 0.3rem;
}

/* 商品卡片标题限制两行显示，保持固定高度 */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px; /* 设置固定高度为40px */
  line-height: 20px; /* 设置行高为20px，确保两行文本垂直居中 */
}