/* 首页独立样式 */

/* 顶部导航栏 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.header-logo {
  font-size: 1.125rem;
  font-weight: 600;
  color: #52c41a;
  text-decoration: none;
}

/* 汉堡菜单图标 */
.hamburger-menu {
  width: 24px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  padding: 2px 0;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #52c41a;
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger-menu:active {
  opacity: 0.7;
}

/* 分类菜单弹出层 */
.category-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-overlay.active {
  display: block;
  opacity: 1;
}

.category-panel {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.category-overlay.active .category-panel {
  transform: translateY(0);
}

.category-tabs {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
}

.category-tab {
  flex: 1;
  padding: 12px 0;
  background-color: transparent;
  border: none;
  font-size: 0.938rem;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-tab.active {
  color: #52c41a;
  font-weight: 600;
  border-bottom: 2px solid #52c41a;
}

.category-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.category-content {
  display: none;
}

.category-content.active {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* 网格卡片样式 */
.category-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  background-color: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 100px;
}

.category-grid-item:active {
  background-color: #f5f5f5;
  transform: scale(0.98);
}

.category-grid-name {
  font-size: 0.938rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  text-align: center;
}

.category-grid-count {
  font-size: 0.75rem;
  color: #999;
  text-align: center;
}

/* 主内容区 */
.main-content {
  padding-top: 44px;
}

/* 轮播Banner */
.banner-section {
  width: 100%;
  overflow: hidden;
  background-color: #f5f5f5;
}

.banner-slider {
  position: relative;
}

.banner-slides {
  display: flex;
  transition: transform 0.3s ease;
}

.banner-slide {
  flex-shrink: 0;
  width: 100%;
}

.banner-image {
  width: 100%;
  height: auto;
  display: block;
}

/* 轮播箭头按钮 */
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background-color: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  opacity: 0.8;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.banner-arrow:hover {
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 1;
}

.banner-arrow:active {
  background-color: rgba(0, 0, 0, 0.6);
  transform: translateY(-50%) scale(0.9);
  opacity: 1;
}

.banner-arrow-prev {
  left: 12px;
}

.banner-arrow-next {
  right: 12px;
}

/* 移动端隐藏箭头 */
@media (max-width: 768px) {
  .banner-arrow {
    display: none;
  }
}

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

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

.banner-dot:hover {
  background-color: rgba(255, 255, 255, 0.7);
}

.banner-dot.active {
  width: 24px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.9);
}

/* 快捷导航 */
.quick-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 16px 12px;
  background-color: #fff;
  margin-bottom: 8px;
}

.quick-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.quick-nav-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-nav-text {
  font-size: 0.75rem;
  color: #666;
}

/* 游戏区块 */
.game-section {
  background-color: #fff;
  padding: 12px;
  margin-bottom: 8px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.section-more {
  font-size: 0.813rem;
  color: #999;
  text-decoration: none;
}

.section-more::after {
  content: '>';
  font-size: 1rem;
}

/* 游戏网格 */
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
}

.game-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  min-width: 0;
    min-height: 0;
}

.game-grid-icon {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #e8e8e8;
}

.game-grid-name {
  font-size: 0.75rem;
  color: #333;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* 底部Tab导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  padding: 6px 12px;
  transition: all 0.2s ease;
}

.bottom-nav-icon {
  fill: #999;
  transition: fill 0.2s ease;
}

.bottom-nav-text {
  font-size: 0.688rem;
  color: #999;
  transition: color 0.2s ease;
}

.bottom-nav-item.active .bottom-nav-icon {
  fill: #52c41a;
}

.bottom-nav-item.active .bottom-nav-text {
  color: #52c41a;
  font-weight: 600;
}

/* 横幅广告区 */
.banner-ads {
  background-color: #fff;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.banner-ads::-webkit-scrollbar {
  display: none;
}

.banner-ad-item {
  flex-shrink: 0;
  width: 85%;
  text-decoration: none;
}

.banner-ad-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* 大家最爱玩/本周最热软件 (featured列表样式) */
.featured-section {
  background-color: #fff;
  padding: 12px;
  margin-bottom: 8px;
}

.featured-bg {
  margin: -12px -12px 12px -12px;
  height: 40px;
  overflow: hidden;
}

.featured-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.featured-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 12px;
  background-color: #f8f8f8;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.featured-item:active {
  background-color: #f0f0f0;
}

.featured-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex-shrink: 0;
  border: 1px solid #e8e8e8;
}

.featured-name {
  flex: 1;
  font-size: 0.875rem;
  color: #333;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.featured-detail {
  padding: 6px 16px;
  background-color: #52c41a;
  color: #fff;
  border-radius: 16px;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* 下拉有惊喜 */
.surprise-section {
  background-color: #fff;
  padding: 12px;
  margin-bottom: 8px;
}

.surprise-tabs {
  display: flex;
  gap: 8px;
}

.surprise-tab {
  padding: 4px 12px;
  background-color: #f5f5f5;
  border: none;
  border-radius: 12px;
  font-size: 0.813rem;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.surprise-tab.active {
  background-color: #52c41a;
  color: #fff;
}

.surprise-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
}

.surprise-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 12px;
  background-color: #f8f8f8;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  margin-bottom: 12px;
}

.surprise-item:active {
  background-color: #f0f0f0;
}

.surprise-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex-shrink: 0;
  border: 1px solid #e8e8e8;
}

.surprise-info {
  flex: 1;
  min-width: 0;
}

.surprise-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.surprise-meta {
  font-size: 0.75rem;
  color: #999;
  margin-bottom: 2px;
}

.surprise-version {
  font-size: 0.688rem;
  color: #999;
}

.surprise-detail {
  padding: 6px 16px;
  background-color: #52c41a;
  color: #fff;
  border-radius: 16px;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* 实时热词 */
.hot-keywords {
  background-color: #fff;
  padding: 12px;
  margin-bottom: 8px;
}

.keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-tag {
  display: inline-block;
  padding: 6px 12px;
  background-color: #f5f5f5;
  color: #666;
  border-radius: 16px;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.keyword-tag:active {
  background-color: #e8e8e8;
  color: #52c41a;
}

/* 底部链接 */
.bottom-links {
  background-color: #fff;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.bottom-link-item {
  font-size: 0.875rem;
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

.bottom-link-item:active {
  color: #52c41a;
}

/* 页脚 */
.footer {
  background-color: #f5f5f5;
  padding: 16px 12px;
  margin-bottom: 60px;
  text-align: center;
}

.back-to-top {
  display: inline-block;
  padding: 8px 20px;
  background-color: #fff;
  color: #52c41a;
  border: 1px solid #52c41a;
  border-radius: 20px;
  font-size: 0.875rem;
  text-decoration: none;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.back-to-top:active {
  background-color: #52c41a;
  color: #fff;
}

.footer-links {
  font-size: 0.75rem;
  color: #999;
}

.footer-link {
  color: #999;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:active {
  color: #52c41a;
}

.footer-divider {
  margin: 0 8px;
  color: #ddd;
}

/* 响应式调整 */
@media (max-width: 360px) {
  .game-grid {
    gap: 8px 6px;
  }
  
  .game-grid-icon {
    border-radius: 12px;
  }
  
  .quick-nav-icon {
    width: 44px;
    height: 44px;
  }
  
  .featured-icon,
  .surprise-icon {
    width: 48px;
    height: 48px;
  }
  
  .banner-ad-item {
    width: 90%;
  }
}
