/* ========== 开方游戏 · 传奇客户端下载栏目页（纯 HTML + CSS，无 JS） ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --red: #c0392b;
  --red-dark: #96281b;
  --gold: #f5c542;
  --dark: #16161c;
  --dark-2: #1f1f27;
  --text: #e8e8ec;
  --text-dim: #a0a0ab;
  --card-bg: #ffffff;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  /* 传奇风回纹底纹 + 暖灰底色 */
  background: #f4f1ec url("../images/bg-pattern.svg") repeat;
  color: #333;
  line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--dark);
  border-bottom: 2px solid rgba(245, 197, 66, .35);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
.header-inner { display: flex; align-items: center; height: 60px; position: relative; }
.logo img { height: 40px; display: block; }

.main-nav { display: flex; margin-left: auto; }
.main-nav a {
  color: var(--text-dim); text-decoration: none;
  padding: 0 18px; height: 60px; line-height: 60px;
  font-size: 15px; transition: color .2s, background .2s;
}
.main-nav a:hover { color: #fff; }
.main-nav a.active { color: var(--gold); border-bottom: 2px solid var(--gold); }

/* 纯 CSS 移动端菜单（checkbox hack，无需 JS） */
.nav-checkbox { display: none; }
.nav-toggle {
  display: none; margin-left: auto;
  width: 42px; height: 42px; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span { width: 22px; height: 2px; background: #fff; transition: .25s; }
.nav-checkbox:checked ~ .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-checkbox:checked ~ .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-checkbox:checked ~ .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Banner ---------- */
.banner {
  background: url("../images/banner.jpg") center / cover no-repeat;
}
.banner-mask {
  background: linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,.5));
  padding: 88px 0;
}
.banner-content { text-align: center; color: #fff; }
.banner-content h1 {
  font-size: 40px; letter-spacing: 8px; font-weight: 700;
  color: var(--gold); text-shadow: 0 3px 14px rgba(0, 0, 0, .8);
}
.banner-content p {
  margin-top: 14px; font-size: 16px; letter-spacing: 3px; opacity: .95;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}

/* ---------- 区块标题 ---------- */
.section-title { display: flex; align-items: center; margin: 34px 0 22px; }
.section-title h2 {
  font-size: 22px; color: #222; letter-spacing: 2px;
  padding-left: 12px; border-left: 4px solid var(--red);
}
.section-title .line { flex: 1; height: 1px; background: #ddd; margin-left: 16px; }

/* ---------- 游戏卡片 ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-bottom: 44px;
}
.game-card {
  background: var(--card-bg);
  border-radius: 10px; overflow: hidden;
  border: 1px solid #e8e2d8;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  transition: transform .25s, box-shadow .25s;
  display: flex; flex-direction: column;
}
.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
  border-color: rgba(192, 57, 43, .4);
}
.game-card .thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.game-card .thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s;
}
.game-card:hover .thumb img { transform: scale(1.06); }

.game-info { padding: 14px 14px 16px; display: flex; flex-direction: column; flex: 1; }
.game-name {
  font-size: 17px; font-weight: 700; color: #222;
  display: flex; align-items: center; justify-content: space-between;
}
.game-name .tag {
  font-size: 11px; font-weight: 400; color: var(--red);
  border: 1px solid var(--red); border-radius: 4px;
  padding: 1px 6px; margin-left: 8px; white-space: nowrap;
}
.game-desc {
  margin-top: 8px; font-size: 13px; color: #777; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; flex: 1;
}
.game-meta { margin-top: 10px; font-size: 12px; color: #aaa; display: flex; gap: 12px; }

.dl-btns { display: flex; gap: 10px; margin-top: 12px; }
.dl-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; border-radius: 6px; text-decoration: none;
  font-size: 14px; font-weight: 600; transition: filter .2s, transform .15s, background .2s;
}
.dl-btn:active { transform: scale(.97); }
.dl-btn svg { width: 16px; height: 16px; fill: currentColor; }
.dl-btn.pc { background: var(--dark); color: #fff; }
.dl-btn.pc:hover { filter: brightness(1.35); }
.dl-btn.android { background: var(--red); color: #fff; }
.dl-btn.android:hover { background: var(--red-dark); }

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--dark); color: var(--text-dim);
  border-top: 2px solid rgba(245, 197, 66, .35);
  text-align: center; padding: 34px 0 26px; font-size: 13px;
}
.footer-brand { color: var(--gold); font-size: 18px; font-weight: 700; letter-spacing: 4px; margin-bottom: 10px; }
.copyright { margin-top: 8px; opacity: .6; }

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .banner-mask { padding: 60px 0; }
  .banner-content h1 { font-size: 28px; letter-spacing: 4px; }
  .banner-content p { font-size: 14px; }
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--dark-2); flex-direction: column;
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-checkbox:checked ~ .main-nav { max-height: 260px; }
  .main-nav a { height: 48px; line-height: 48px; padding: 0 20px; border-top: 1px solid rgba(255,255,255,.06); }
  .main-nav a.active { border-bottom: none; background: rgba(245,197,66,.08); }
}
@media (max-width: 420px) {
  .game-grid { grid-template-columns: 1fr; }
}
