/* ============================================================
   cai游戏 · 网站样式
   简洁现代风 · 浅色主题 · 响应式
   ============================================================ */

:root {
  --primary: #6d5dfc;
  --primary-dark: #5647e0;
  --ink: #1b1b2f;
  --ink-soft: #55556b;
  --ink-faint: #8a8aa0;
  --bg: #ffffff;
  --bg-alt: #f6f6fb;
  --line: #ececf4;
  --radius: 18px;
  --shadow: 0 8px 30px rgba(27, 27, 47, 0.08);
  --shadow-lg: 0 20px 60px rgba(27, 27, 47, 0.16);
  --font: "Inter", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { color: var(--primary); font-size: 22px; line-height: 1; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
.brand-en { font-size: 11px; color: var(--ink-faint); letter-spacing: 2px; }

.main-nav { display: flex; gap: 32px; }
.main-nav a {
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}
.main-nav a:hover { color: var(--primary); }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.25s;
}
.main-nav a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: 0.25s;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 110px 0 96px;
  background: linear-gradient(180deg, #f4f2ff 0%, #ffffff 100%);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}
.orb-1 { width: 420px; height: 420px; background: #d6d0ff; top: -140px; right: -80px; }
.orb-2 { width: 320px; height: 320px; background: #ffe0ef; bottom: -120px; left: -60px; }
.orb-3 { width: 220px; height: 220px; background: #d0f0ff; top: 40%; left: 55%; }

.hero-inner { position: relative; text-align: center; }
.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--primary);
  font-weight: 700;
  background: rgba(109, 93, 252, 0.1);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(120deg, var(--ink) 30%, var(--primary) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--ink);
}
.hero-sub {
  margin-top: 20px;
  font-size: 17px;
  color: var(--ink-soft);
}
.hero-actions { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(109, 93, 252, 0.35);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 12px 30px rgba(109, 93, 252, 0.45); }
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(27, 27, 47, 0.05);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.hero-stats {
  margin-top: 56px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stat-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 26px;
  box-shadow: var(--shadow);
  min-width: 150px;
}
.stat-chip b { display: block; font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-chip span { font-size: 13px; color: var(--ink-faint); }

/* ---------- 通用 section ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }

.section-head { text-align: center; margin-bottom: 52px; }
.section-eyebrow {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; letter-spacing: -0.5px; }
.section-desc { margin-top: 10px; color: var(--ink-faint); font-size: 15px; }

/* ---------- 游戏卡片 ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
}
.game-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 4px 16px rgba(27, 27, 47, 0.05);
}
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.game-cover {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.game-cover .cover-art { width: 64px; height: 64px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.18)); }
.game-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.12));
}
.game-status {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.game-body { padding: 20px 22px 24px; }
.game-body h3 { font-size: 19px; font-weight: 700; }
.game-en { font-size: 12px; color: var(--ink-faint); letter-spacing: 1px; margin-top: 2px; }
.game-tagline { margin-top: 10px; font-size: 14px; color: var(--ink-soft); min-height: 44px; }
.game-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.game-tags span {
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
}
.game-cta {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.game-cta .genre { font-size: 13px; color: var(--ink-faint); }
.game-cta .more { font-size: 14px; font-weight: 600; color: var(--primary); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-faint);
}
.back-top { color: var(--ink-soft); font-weight: 600; }
.back-top:hover { color: var(--primary); }

/* ---------- 详情弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.open { display: flex; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 35, 0.5);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s;
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}
.modal-close:hover { transform: scale(1.1); }
.modal-content { padding: 0; }

.detail-cover {
  position: relative;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-cover .cover-art { width: 92px; height: 92px; filter: drop-shadow(0 8px 20px rgba(0,0,0,0.25)); }
.detail-cover .game-status { top: 18px; right: 18px; }
.detail-body { padding: 28px 32px 32px; }
.detail-body h3 { font-size: 24px; font-weight: 800; }
.detail-en { font-size: 13px; color: var(--ink-faint); letter-spacing: 1px; margin-top: 3px; }
.detail-desc { margin-top: 16px; font-size: 15px; color: var(--ink-soft); }
.detail-features { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.detail-features li {
  list-style: none;
  font-size: 14px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.detail-features li::before { content: "✦"; color: var(--primary); font-size: 12px; margin-top: 4px; }
.detail-tags { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.detail-tags span {
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
}
.detail-downloads { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.detail-downloads h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--ink-soft); }
.download-list { display: flex; flex-direction: column; gap: 12px; }

.dl-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.2s;
  cursor: pointer;
}
.dl-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.dl-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.dl-btn.primary:hover { background: var(--primary-dark); }
.dl-btn .dl-left { display: flex; align-items: center; gap: 12px; }
.dl-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.dl-btn .arrow { font-size: 13px; }

/* ---------- 弹窗：扫码下载 ---------- */
.qr-download {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  background: var(--bg-alt);
  border: 1px dashed #d4d2e8;
  border-radius: 14px;
}
.qr-download img {
  width: 108px;
  height: 108px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.qr-download span {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.6;
}

/* ---------- 动画 ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 独立游戏详情页 ---------- */
.game-detail-page { padding: 0 0 80px; }
.detail-hero {
  height: 320px;
  border-radius: 0 0 24px 24px;
  position: relative;
}
.detail-hero-status {
  position: absolute;
  top: 20px; right: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  padding: 5px 14px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.detail-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}
.back-link {
  display: inline-block;
  margin: 28px 0 4px;
  font-size: 14px;
  color: var(--ink-faint);
  transition: color 0.2s;
}
.back-link:hover { color: var(--primary); }
.detail-main h1 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-top: 8px;
}
.detail-en { font-size: 14px; color: var(--ink-faint); margin-top: 4px; }
.detail-tagline {
  font-size: 17px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 18px;
}
.detail-desc { margin-top: 12px; font-size: 15px; color: var(--ink-soft); line-height: 1.8; }
.detail-h2 { font-size: 18px; font-weight: 800; margin-top: 34px; margin-bottom: 12px; }
.detail-features { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.detail-features li { font-size: 15px; display: flex; gap: 10px; color: var(--ink); }
.detail-features li::before { content: "✦"; color: var(--primary); font-size: 13px; margin-top: 3px; }
.detail-tags { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; }
.detail-tags span {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
}
.detail-downloads-list { margin-top: 4px; }
.detail-qr { max-width: 360px; }
.share-btn { margin-top: 32px; }
.detail-loading {
  text-align: center;
  padding: 110px 0;
  color: var(--ink-faint);
  font-size: 15px;
}
.detail-404 { text-align: center; padding: 90px 0; }
.detail-404-icon { font-size: 56px; }
.detail-404 h2 { font-size: 24px; font-weight: 800; margin: 16px 0 8px; }
.detail-404 p { color: var(--ink-faint); margin-bottom: 26px; }

@media (max-width: 720px) {
  .detail-hero { height: 220px; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
    padding: 8px 0;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 24px; font-size: 16px; }
  .main-nav a::after { display: none; }
  .section { padding: 72px 0; }
  .hero { padding: 80px 0 72px; }
}

@media (max-width: 480px) {
  .game-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 8px; }
  .stat-chip { min-width: 0; flex: 1; padding: 12px 14px; }
  .brand-en { display: none; }
}
