@import url("./assets/daisyui@5.css");
:root {
  --nav: #fff;
  --body: linear-gradient(to right, #8080db 0%, #1cb5e0 100%);
  --font: #eee;
  --footer: rgba(0, 0, 0, 0.3);
  --a: #fff;
  --heading-bg: rgba(0, 0, 0, 0.2);
  --footer-text: #f5f5f5;
  --footer-link-hover: #ffd700;
  --bottom-nav-bg: rgba(255, 255, 255, 0.95);
  --bottom-nav-text: #333;
  --bottom-nav-active: #ff416c;
}

* {
  box-sizing: border-box;
}

body {
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--font);
  background: var(--body);
  background-size: contain;
}
html {
  font-size: 16px;
}
a {
  line-height: 20px;
  text-decoration: none;
  color: var(--a);
}

a:hover,
a:active {
  text-decoration: none;
}

strong {
  font-weight: bolder;
}

img {
  object-fit: cover;
}

.fx-r {
  display: flex;
  flex-direction: row;
}

.fx-h {
  display: flex;
  flex-direction: column;
}

.fx-ac {
  justify-content: center;
}

.fx-bc {
  align-items: center;
}

/* 定义全局滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  border-radius: 4px;
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #c1c1c1;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 回到顶部按钮样式 */
#back-to-top {
  font-size: 24px;
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: opacity 0.3s;
  color: white;
  border: none;
  border-radius: 50%;
  background-color: #007bff;
}

#back-to-top:hover {
  opacity: 0.8;
}

.back {
  z-index: 2;
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 4px 10px;
  background-color: #fff;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;

  img {
    width: 10px;
    height: 10px;
    cursor: pointer;
    background-size: 100% 100%;
  }
}

/* 为内容区域添加最大宽度约束 */
main {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.navLogo {
  width: 40px;
  aspect-ratio: 1/1;
}

.navtitle {
  font-size: 36px;
}

.des {
  margin-top: 30px;
  padding: 18px 0;
}
.des-tit {
  font-size: 12px;
}
.des h3 {
  margin-top: 10px;
  margin-bottom: 10px;
}
@media (max-width: 768px) {
}

/* 新增：小标题样式 */
.section-heading {
  background: var(--heading-bg);
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  margin: 0.2rem 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--font);
}

.section-heading img {
  width: 24px;
  height: 24px;
  cursor: pointer;
}

/* 页脚区域优化 */
footer {
  margin-top: 2rem;
  padding: 1rem 0;
  width: 100%;
  position: relative;
  clear: both;
}

.des {
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  text-align: center;
}

.des-tit {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--font);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.des h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--footer-text);
}

/* 确保页脚文本不会导致布局偏移 */
.des-font {
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: break-word;
}

.container {
  max-width: 1200px;
}
/* 为游戏卡片容器添加明确的尺寸约束和过渡效果 */
#bestLikeGames,
#hotPicks,
#popular {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.75rem 0;
  min-height: 200px; /* 添加最小高度避免布局塌陷 */
}

/* 优化游戏卡片的尺寸和加载行为 */
.gamecards {
  aspect-ratio: 4/3 !important;
  width: 100%;
  overflow: hidden;
  position: relative;
  border-radius: 8px;
  background-color: #f0f0f0; /* 加载前显示背景色 */
}

/* 图片加载优化 */
.gamecards img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease-in-out;
  opacity: 0;
}

/* 图片加载完成后显示 */
.gamecards img.loaded {
  opacity: 1;
}
.detailback {
  width: 40px;
  height: 30px;
  position: absolute;
  z-index: 11;
  top: 40px;
  left: 0px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  cursor: pointer;
  justify-content: center;
  border-top-right-radius: 40px;
  border-bottom-right-radius: 40px;
  box-shadow: 0 2px 10px 1px rgba(0, 0, 0, 0.76);
}

footer ul {
  list-style: none;
  padding: 0;
}

footer a {
  color: var(--a);
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 2px;
}

footer a:hover {
  color: var(--footer-link-hover);
}

footer a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--footer-link-hover);
  transition: width 0.3s ease;
}

footer a:hover::after {
  width: 100%;
}

/* 新增：底部导航样式 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  background-color: var(--bottom-nav-bg);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 15;
  padding: 0.5rem 0;
}

.bottom-nav-container {
  display: flex;
  justify-content: space-around;
  max-width: 500px;
  margin: 0 auto;
}

.navbar {
  cursor: pointer;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--bottom-nav-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--bottom-nav-active);
}

.bottom-nav-item img {
  width: 24px;
  height: 24px;
  margin-bottom: 0.25rem;
}

.bottom-nav-item span {
  font-size: 0.75rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  nav {
    left: 0;
  }
  #bestLikeGames {
    grid-template-columns: repeat(3, 1fr);
  }
  #hotPicks {
    grid-template-columns: repeat(2, 1fr);
  }
  #popular {
    grid-template-columns: 1fr;
  }
}
