/* 隐藏滚动条但保留功能 (用于横向导航) */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* 瀑布流效果 */
/* 瀑布流容器 - 兼容Safari */
.masonry-grid {
  /* 核心列布局属性：添加webkit前缀 + 均衡列高 */
  -webkit-column-count: 2;
  column-count: 2;
  -webkit-column-gap: 1rem;
  column-gap: 1rem;
  /* 让Safari各列高度尽可能均衡 */
  -webkit-column-fill: balance;
  column-fill: balance;
  /* 防止容器内边距/边框干扰列宽 */
  box-sizing: border-box;
}

/* 响应式适配 - 统一添加webkit前缀 */
@media (min-width: 640px) {
  .masonry-grid {
    -webkit-column-count: 2;
    column-count: 2;
  }
}
@media (min-width: 1024px) {
  .masonry-grid {
    -webkit-column-count: 3;
    column-count: 3;
  }
}
@media (min-width: 1280px) {
  .masonry-grid {
    -webkit-column-count: 4;
    column-count: 4;
  }
}

/* 瀑布流子项 - Safari核心兼容 */
.masonry-item {
  /* 1. 多前缀兼容：覆盖新旧Safari的break-inside识别 */
  -webkit-break-inside: avoid;
  break-inside: avoid;
  -webkit-page-break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid; /* 极旧版Safari降级 */
  column-break-inside: avoid;

  /* 2. 解决Safari中break-inside失效的关键：inline-block + 100%宽 */
  display: inline-block;
  width: 100%;

  /* 3. 基础样式 + 盒模型兼容 */
  margin-bottom: 1rem;
  position: relative;
  box-sizing: border-box;
}

/* 额外：图片适配（瀑布流常见场景） */
.masonry-item img {
  /* 防止图片溢出列宽 */
  max-width: 100%;
  height: auto;
  /* 去除图片底部默认空白（Safari行高问题） */
  display: block;
}

/* 卡片悬停效果 */
.card-overlay { opacity: 0; transition: opacity 0.3s ease; }
.masonry-item:hover .card-overlay { opacity: 1; }

/* 图片缩放效果 */
.masonry-item img {transition: transform 0.3s ease; }
.masonry-item:hover img { transform: scale(1.05); }

/* 首页固定背景 */
.home-hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    object-fit: cover;
}

/* 移动端优化 */
@media (max-width: 640px) {
    /* 优化触摸交互 */
    button, a {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* 优化图片加载 */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    /* 防止固定背景在移动端的问题 */
    .fixed {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    /* 优化滚动性能 */
    * {
        -webkit-overflow-scrolling: touch;
    }
}

/* 触摸反馈优化 */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* 移动端按钮激活状态 */
@media (max-width: 768px) {
    button:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* 图片懒加载样式 */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background-color: #f0f0f0;
    background-image: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s ease-in-out infinite;
}

.lazy-loaded {
    opacity: 1;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

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

/* 首页图片轮播样式 - 无左右边距 */
.index-image-swiper {
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
}

.index-image-swiper .swiper-wrapper {
    padding-left: 0;
    padding-right: 0;
}

.index-image-swiper .swiper-slide {
    width: auto;
    height: auto;
}

/* 移动端：每张图片占屏幕宽度的 80% */
.index-image-swiper .swiper-slide {
    width: 80%;
    max-width: 300px;
}

/* 平板端：每张图片占屏幕宽度的 45% */
@media (min-width: 640px) {
    .index-image-swiper .swiper-slide {
        width: 45%;
        max-width: 400px;
    }
}

/* 桌面端：每张图片占屏幕宽度的 30% */
@media (min-width: 1024px) {
    .index-image-swiper .swiper-slide {
        width: 30%;
        max-width: 500px;
    }
}

/* 大屏幕：每张图片占屏幕宽度的 22% */
@media (min-width: 1280px) {
    .index-image-swiper .swiper-slide {
        width: 22%;
        max-width: 600px;
    }
}


 /* 隐藏滚动条样式 */
  .no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .no-scrollbar::-webkit-scrollbar {
    display: none;
  }
  
  /* 折叠/展开效果 */
  /* 基础样式 */
  .community-tags-container {
    transition: max-height 0.3s ease;
  }
  
  /* 桌面端：默认折叠，显示加载更多按钮 */
  @media (min-width: 768px) {
    .community-tags-container {
      position: relative;
      max-height: 44px; /* 一行的高度 */
      overflow: hidden;
      padding-right: 100px; /* 为加载更多按钮预留空间 */
    }
    
    .community-tags-container.expanded {
      max-height: none;
      padding-right: 0;
    }
    
    .load-more-btn {
      display: none;
    }
    
    .community-tags-container:not(.expanded) .load-more-btn {
      display: inline-flex;
      position: absolute;
      right: 0;
      top: 0;
      background: white;
      z-index: 10;
    }
    
    .show-less-btn {
      display: none;
    }
    
    .community-tags-container.expanded .show-less-btn {
      display: inline-flex;
    }
    
    .community-tags-container.expanded .load-more-btn {
      display: none;
    }
  }
  
  /* 移动端：始终显示全部标签，可横向滚动 */
  @media (max-width: 767px) {
    .community-tags-container {
      max-height: none;
      overflow: visible;
      padding-right: 0 !important;
    }
    
    /* 移动端隐藏加载更多和收起按钮 */
    .load-more-btn,
    .show-less-btn {
      display: none !important;
    }
  }
  
  /* 标签样式 */
  .tag-item {
    flex-shrink: 0;
}
  
  
  
  
  