/* ===== PAGE LAYOUT ===== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-auto-rows: calc((100vw - 32px - 9 * 6px) / 10 * 142 / 218);
  grid-auto-flow: row dense;
  gap: 6px;
  width: 100%;
  margin: calc(var(--nav-h) + 16px) auto 0;
  padding: 0 16px 16px;
  box-sizing: border-box;
}

/* ===== LEFT SIDEBAR ===== */
.sidebar-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--card-bg);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  will-change: transform;
  transition: transform .2s;
}
.sidebar-card:hover { transform: scale(1.06); box-shadow: 0 6px 22px rgba(0,0,0,.55); }
.sidebar-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.sidebar-card .card-title {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 22px 6px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,.88));
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  z-index: 1;
}

/* ===== CENTER: 主游戏区 ===== */
.main-game {
  grid-column: 3 / span 6;
  grid-row: 1 / span 6;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-self: start;
}
.game-frame-wrap {
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 8;
  position: relative;
}
.game-frame-wrap iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}
.game-cover {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.cover-bg {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0a1e30, #152a40);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.cover-name {
  font-size: clamp(20px, 3vw, 36px);
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 2px 12px rgba(0,0,0,.8);
  pointer-events: none;
}
.play-btn {
  position: absolute;
  width: 64px; height: 64px;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
}
.play-btn:hover { background: var(--accent); transform: scale(1.1); }
.play-btn svg { fill: #fff; margin-left: 4px; }

/* ===== GAME BAR ===== */
.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 8px 14px;
  flex-shrink: 0;
}
.game-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-bar-icon {
  width: 36px; height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
}
.game-bar-name { font-weight: 600; font-size: 16px; }
.game-bar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--text); background: #1e3a55; }
.like-count { font-size: 14px; color: var(--text-muted); }

/* ===== RIGHT SIDEBAR ===== */
.sidebar-right {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-content: start;
}
.more-games { margin-top: 4px; }
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.more-games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* 大卡片：横跨2列，高度×2 */
.game-card.span-2 {
  grid-column: span 2;
  grid-row: span 2;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, 154px);
    grid-auto-rows: auto;
    width: 100%;
    padding: 0 8px 8px;
    justify-content: center;
  }
  .main-game {
    grid-column: 1 / -1;
    grid-row: auto;
    display: block;
  }
  .game-frame-wrap {
    aspect-ratio: 16 / 9;
    min-height: auto;
  }
  .game-card {
    width: 154px;
    height: 154px;
    aspect-ratio: auto;
  }
  .game-card.span-2 {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* ===== IO GAMES PAGE TITLE ===== */
.io-page-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--accent);
  text-align: left;
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 24px) 16px 8px;
}
.io-page-title + .game-grid {
  max-width: 1400px;
  margin-top: 0;
  grid-auto-rows: calc((min(100vw, 1400px) - 32px - 9 * 6px) / 10 * 142 / 218);
}

/* ===== BREADCRUMB ===== */
.bj-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.bj-breadcrumb a { color: var(--accent); }
.bj-breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #3a5570; }

/* ===== ARTICLE ===== */
.bj-article {
  max-width: 1400px;
  margin: 40px auto 0;
  padding: 0 48px 56px;
}
.bj-h1 {
  font-size: clamp(1.6em, 2.8vw, 2.2em);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 28px;
  line-height: 1.3;
}
.bj-h2 {
  font-size: 1.45em;
  font-weight: 700;
  color: var(--accent);
  margin: 40px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bj-h3 {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 12px;
}
.bj-article p {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* TOC */
.bj-toc {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 32px;
}
.bj-toc-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--accent);
  margin-bottom: 10px;
}
.bj-toc ol {
  padding-left: 18px;
  margin: 0;
}
.bj-toc li {
  font-size: 16px;
  line-height: 2.1;
  color: var(--text-muted);
}
.bj-toc a {
  color: var(--text-muted);
  transition: color .15s;
}
.bj-toc a:hover { color: var(--accent); }
.bj-toc ol ol { margin-top: 0; }

/* Lists */
.bj-list {
  padding-left: 0;
  list-style: none;
  margin-bottom: 12px;
}
.bj-list li {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-muted);
  padding-left: 22px;
  position: relative;
  margin-bottom: 8px;
}
.bj-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.bj-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 24px;
}

/* Table */
.bj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  margin: 14px 0 18px;
}
.bj-table th {
  text-align: left;
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.bj-table td {
  padding: 11px 14px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.bj-table tr:last-child td { border-bottom: none; }

/* Tip box */
.bj-tip {
  background: rgba(59,232,176,0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 16px 0;
}
.bj-tip b { color: var(--accent); }

/* FAQ */
.bj-faq { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bj-faq-item {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.bj-faq-q {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.bj-faq-item p {
  font-size: 16px;
  margin-bottom: 0;
}

/* Screenshot */
.bj-screenshot {
  margin: 24px auto;
  max-width: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.bj-screenshot img {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  display: block;
}
.bj-screenshot figcaption {
  background: var(--card-bg);
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* YouTube embed */
.bj-yt {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 9/16;
  margin: 16px auto 24px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}
.bj-yt-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}
.bj-yt-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  transition: background .2s;
}
.bj-yt-play::after {
  content: '';
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,0,0,.85);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 36px;
  box-shadow: 0 4px 18px rgba(0,0,0,.5);
  transition: transform .2s;
}
.bj-yt:hover .bj-yt-play { background: rgba(0,0,0,.5); }
.bj-yt:hover .bj-yt-play::after { transform: scale(1.1); }

.bj-cta {
  background: linear-gradient(135deg, #0e2a3a, #0a1e2e);
  border: 1px solid rgba(59,232,176,0.2);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  margin-top: 36px;
}
.bj-cta h2 {
  font-size: 1.4em;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}
.bj-cta p {
  color: var(--text-muted);
  margin-bottom: 20px;
}
.bj-cta a {
  display: inline-block;
  background: var(--accent);
  color: #0f1923;
  font-weight: 700;
  font-size: 16px;
  padding: 12px 32px;
  border-radius: 24px;
  transition: opacity .2s, transform .2s;
}
.bj-cta a:hover { opacity: .88; transform: scale(1.03); }

@media (max-width: 900px) {
  .bj-list-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .bj-article { padding: 0 12px 40px; }
}
