/* ========= 基础 ========= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  -webkit-font-smoothing: antialiased;
  /* 弹性布局：内容不足一屏时把页脚钉在底部 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ========= 顶部导航 ========= */
.site-header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img { height: 40px; width: auto; }

.nav { display: flex; gap: 44px; }
.nav a {
  position: relative;
  font-size: 15px;
  color: #555;
  line-height: 64px;
  transition: color .2s;
}
.nav a:hover { color: #e60012; }
.nav a.active { color: #e60012; font-weight: bold; }
.nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 8px;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: #e60012;
}

.menu-toggle { display: none; }

/* ========= 横幅 ========= */
.banner { width: 100%; }
.banner img { width: 100%; height: auto; }

/* ========= 游戏推荐 ========= */
.recommend {
  max-width: 1420px;
  margin: 0 auto;
  padding: 48px 20px 60px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.section-title h2 {
  font-size: 26px;
  letter-spacing: 6px;
  color: #3a3a3a;
  font-weight: 600;
}
.section-title .line {
  width: 90px;
  height: 1px;
  background: #ccc;
  position: relative;
}
.section-title .line::before {
  content: "";
  position: absolute;
  top: -2.5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9a06a;
}
.section-title .line:first-child::before { right: -3px; }
.section-title .line:last-child::before  { left: -3px; }

.section-sub {
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 3px;
  color: #bbb;
  text-transform: uppercase;
}

/* ========= 卡片 ========= */
.game-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
/* 单游戏：按原型卡片尺寸居中展示，整卡（图+文字）比例 550:570 */
.game-grid.single {
  grid-template-columns: minmax(0, 346px);
  justify-content: center;
}
.game-grid.single .game-card {
  aspect-ratio: 550 / 570;
  display: flex;
  flex-direction: column;
}
.game-grid.single .card-cover {
  flex: 1;
  aspect-ratio: auto;
  min-height: 0;
}
.game-card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  position: relative;
  transition: transform .25s, box-shadow .25s;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.card-cover {
  position: relative;
  aspect-ratio: 346 / 172;  /* 原型卡片封面比例 */
  overflow: hidden;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-body { padding: 12px 14px 14px; }

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.card-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-tags { font-size: 12px; color: #999; white-space: nowrap; }

.card-intro {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: #666;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  white-space: normal;
}
.card-intro::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #d8a26a;
  background: #f3e0c4;
}
.card-intro .intro-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 下载按钮区 */
.card-actions { display: none; }
.btn-dl {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border: none;
  border-radius: 4px;
  background: #d8a26a;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background .2s;
}
.btn-dl:hover { background: #c98f52; }
.btn-dl svg { width: 16px; height: 16px; fill: #fff; }
.btn-dl.ghost { background: #fff; color: #d8a26a; border: 1px solid #d8a26a; }

/* PC 底部「游戏下载」按钮 */
.card-actions-pc {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.card-actions-pc .btn-dl { width: 140px; flex: none; }

/* PC 悬浮遮罩（电脑/苹果/安卓 三按钮） */
.card-hover {
  position: absolute;
  inset: 0;
  background: rgba(30, 26, 22, .78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
  z-index: 5;
}
.game-card:hover .card-hover,
.game-card.show-hover .card-hover {
  opacity: 1;
  visibility: visible;
}
.card-hover .btn-hover {
  width: 150px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.85);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.card-hover .btn-hover:hover {
  background: #d8a26a;
  border-color: #d8a26a;
}
.card-hover .btn-hover svg { width: 16px; height: 16px; fill: #fff; }

/* ========= 页脚 ========= */
.site-footer {
  background: #2b2b2b;
  color: #888;
  text-align: center;
  padding: 22px 0;
  font-size: 13px;
  /* 内容不足一屏时页脚钉在视口底部 */
  margin-top: auto;
  letter-spacing: 1px;
}

/* ========= 移动端 ========= */
@media (max-width: 768px) {
  .header-inner { height: 48px; padding: 0 14px; }
  .logo img { height: 28px; }

  .nav {
    position: fixed;
    top: 48px;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    width: 160px;
    box-shadow: -2px 2px 10px rgba(0,0,0,.1);
    transform: translateX(100%);
    transition: transform .25s;
  }
  .nav.open { transform: translateX(0); }
  .nav a { line-height: 46px; padding: 0 22px; border-bottom: 1px solid #f2f2f2; }
  .nav a.active::after { display: none; }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
  }
  .menu-toggle span {
    width: 22px;
    height: 2px;
    background: #444;
    border-radius: 2px;
  }

  .recommend { padding: 30px 14px 40px; }
  .section-title h2 { font-size: 21px; letter-spacing: 4px; }
  .section-title .line { width: 60px; }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 24px;
  }
  .card-cover { aspect-ratio: 16 / 9; }
  .card-title { font-size: 17px; }
  .card-intro { white-space: normal; }
  .card-actions { display: flex; gap: 12px; }
  /* 移动端隐藏 PC 下载按钮 */
  .card-actions-pc { display: none; }
  /* 移动端不显示悬浮遮罩 */
  .card-hover { display: none; }
}

/* 中等宽度（平板）：3 列 */
@media (min-width: 769px) and (max-width: 1024px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}
