/* 全局变量 */
:root {
  --primary-color: #FF6700;
  --secondary-color: #ff6b6b;
  --text-color: #ffffff;
  --text-light: #cccccc;
  --text-lighter: #999999;
  --bg-color: #f5f7fa;
  --white: #fff;
  --bg-card: #282a2e;
  --bg-dark: #0e0f15;
  --text-secondary: #e3e3e3;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-dark);
}

/* 容器样式 */
.container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* 轮播图样式 */
.hero-carousel {
  position: relative;
  width: 100%;
  height: 550px;
  margin: 20px 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.carousel-inner {
  position: relative;
  height: 100%;
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}

.carousel-item.active {
  opacity: 1;
  z-index: 1;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 40px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
  color: var(--white);
}

.carousel-caption h5 {
  font-size: 24px;
  margin-bottom: 10px;
  font-weight: 600;
}

.carousel-caption p {
  font-size: 16px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.carousel-button {
  display: inline-block;
  padding: 10px 24px;
  background-color: var(--primary-color);
  color: var(--white);
  text-decoration: none;
  border-radius: 25px;
  font-weight: 500;
  transition: var(--transition);
}

.carousel-button:hover {
  background-color: #bf5107;
  transform: translateY(-2px);
}

/* 轮播指示器 */
.carousel-indicators {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.carousel-indicators button.active {
  background-color: var(--primary-color);
  width: 30px;
  border-radius: 6px;
}

/* 区域标题样式 */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 20px;
  padding: 0 10px;
}

.section-title h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-color);
}

.section-title a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}

.section-title a:hover {
  color: var(--primary-color);
}

/* 新游发布部分的游戏网格 - 4列布局 */
.new-games .game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

/* 游戏推荐部分的游戏网格 - 4列布局 */
.game-recommendations .game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .new-games .game-grid,
  .game-recommendations .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .new-games .game-grid,
  .game-recommendations .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 游戏卡片样式 */
.game-grid-item {
  position: relative;
}

.game-card {
  position: relative;
  background-color: rgba(40, 42, 46, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.game-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.game-card:hover img {
  transform: scale(1.05);
}

.game-info {
  padding: 15px;
}

.game-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-btn {
  display: inline-block;
  padding: 6px 0;
  color: var(--white);
  font-size: 14px;

}

.game-btn:hover {
  background-color: #008ac8;
}

/* 游戏悬停弹窗 */
.pop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(40, 42, 46, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.8);
  transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s 0.5s;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.game-grid-item:hover .pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1.15);
  box-shadow: var(--shadow-hover);
  transition-delay: 0s;
}

.pop img,
.pop video {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.pop .content {
  padding: 15px;
  flex: 1;
  display: flex;
  min-height: 230px;
  flex-direction: column;
}

.pop .game-title {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-score {
  font-size: 14px;
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  gap: 5px;
}

.game-release-date {
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  gap: 8px;
  align-items: center;
}

.like-button {
  cursor: pointer;
  transition: var(--transition);
}

.like-button:hover {
  transform: scale(1.2);
  color: var(--secondary-color);
}

.game-label {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.filter-label {
  padding: 2px 8px;
  background-color: #3a3d42;
  color: var(--text-light);
  font-size: 11px;
  border-radius: 3px;
}

.platfrom {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.platfrom .name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 5px;
  }
  
.platform-icon {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}

.action-buttons {
  height: 54px;
  margin: 12px -20px 0;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.play-button {
  display: inline-block;
  padding: 0;
  background-color: transparent;
  color: var(--text-lighter);
  text-align: left;
  text-decoration: none;
  border-radius: 0;
  font-size: 13px;
  transition: color 0.3s ease;
}

.play-button:hover {
  background-color: transparent;
  color: var(--primary-color);
}

.favorite-button {
  color: var(--text-lighter);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.favorite-button:hover {
  color: var(--secondary-color);
}

/* 排行榜样式 */
.index-rank-wrap {
  background-color: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

/* 排行榜分隔线样式 */
.rank-divider {
  width: 1px;
  background-color: rgba(228,228,228,0.1);
  height: auto;
  align-self: stretch;
}

.index-container {
  display: flex;
  gap: 30px;
}

.rank-box {
  flex: 1;
}

.rank-box .title {
  font-size: 20px;
  font-weight: 600;
  padding-left: 28px;
  padding-bottom: 24px;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: var(--border-radius);
  cursor: pointer;
  position: relative;
  background-color: var(--bg-card);
  transition: background-color 0.3s ease;
}

/* 排名数字样式 */
.rank-badge {
    flex-shrink: 0;
    color: #999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    margin-right: 10px;
    font-family: 'mfgeheinumber', sans-serif;
  }
  
  /* 保留hover时的背景色变化，移除其他动态效果 */
  .rank-item:hover {
    background-color: #3a3c43;
  }
  
  .rank-item .image {
  width: 117px;
  height: 70px;
  background-size: cover;
  background-position: center;
  border-radius: 5px;
  flex-shrink: 0;
}

.rank-item .content {
  flex: 1;
  min-width: 0;
}

.rank-item .name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 3px;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-item .recommend {
  display: block;
  font-size: 12px;
  color: var(--text-lighter);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .hero-carousel {
    height: 350px;
  }
  
  .carousel-caption h5 {
    font-size: 20px;
  }
  
  .carousel-caption p {
    font-size: 14px;
  }
  
  .index-container {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .hero-carousel {
    height: 280px;
  }
  
  .carousel-caption {
    padding: 20px 30px;
  }
  
  .carousel-caption h5 {
    font-size: 18px;
  }
  
  .carousel-button {
    padding: 8px 20px;
    font-size: 14px;
  }
  
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }
  
  .game-card img {
    height: 220px;
  }
  
  .index-container {
    flex-direction: column;
    gap: 25px;
  }
  
  .rank-box .title {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .hero-carousel {
    height: 200px;
    margin: 10px 0;
  }
  
  .carousel-caption {
    padding: 15px 20px;
  }
  
  .carousel-caption h5 {
    font-size: 16px;
    margin-bottom: 5px;
  }
  
  .carousel-caption p {
    font-size: 12px;
    margin-bottom: 10px;
  }
  
  .carousel-button {
    padding: 6px 16px;
    font-size: 12px;
  }
  
  .carousel-indicators button {
    width: 10px;
    height: 10px;
  }
  
  .carousel-indicators button.active {
    width: 25px;
  }
  
  .section-title {
    margin: 20px 0 15px;
  }
  
  .section-title h2 {
    font-size: 18px;
  }
  
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .game-card img {
    height: 180px;
  }
  
  .game-info {
    padding: 10px;
  }
  
  .game-title {
    font-size: 14px;
  }
  
  .game-meta {
    font-size: 11px;
  }
  
  .index-rank-wrap {
    padding: 15px;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-carousel,
.hot-games,
.index-rank-wrap {
  animation: fadeIn 0.6s ease-out;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 加载优化 */
img {
  loading: lazy;
}