/* styles.css */
/* 网格容器 - 基础样式 */
.nav-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 20px 0;
  margin: 0 !important;
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
}

/* 单个导航项 - 基础样式 */
.nav-item {
  flex: 0 0 auto;
  width: 76px;
  text-align: center;
}

/* 图标样式 */
.nav-item img {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 文字样式 */
.nav-item span {
  display: block;
  font-size: 13px;
  margin-top: 8px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 仅图标有悬停特效 */
.nav-item img:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* 电脑端（1列）浅蓝色流光滚动条（WebKit浏览器） */
.nav-grid::-webkit-scrollbar {
  height: 8px; /* 滚动条高度 */
}

.nav-grid::-webkit-scrollbar-track {
  background: #f0f7ff; /* 浅蓝底色轨道 */
  border-radius: 10px;
}

.nav-grid::-webkit-scrollbar-thumb {
  position: relative;
  background: linear-gradient(90deg, 
    rgba(142, 197, 252, 0) 0%, 
    rgba(142, 197, 252, 0.8) 50%, 
    rgba(142, 197, 252, 0) 100%); /* 流光渐变 */
  background-size: 200% 100%;
  border-radius: 10px;
  animation: flowLight 3s infinite linear; /* 流光动画 */
}

.nav-grid::-webkit-scrollbar-thumb::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.6) 50%, 
    rgba(255, 255, 255, 0) 100%); /* 高光效果 */
  background-size: 200% 100%;
  animation: flowHighlight 2s infinite linear;
}

/* 流光动画关键帧 */
@keyframes flowLight {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

/* 响应式适配 - 平板端（2列） */
@media (max-width: 768px) and (min-width: 577px) {
  .nav-grid {
    flex-wrap: wrap;
    overflow-x: hidden;
    justify-content: flex-start;
  }
  .nav-item {
    width: calc(50% - 5px);
    margin-bottom: 10px;
  }
}

/* 响应式适配 - 手机端（4列） */
@media (max-width: 576px) {
  .nav-grid {
    flex-wrap: wrap;
    overflow-x: hidden;
    justify-content: flex-start;
  }
  .nav-item {
    width: calc(25% - 5px);
    margin-bottom: 10px;
  }
}

/* 宽屏保持横向滚动（1列） */
@media (min-width: 769px) {
  .nav-grid {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
}