/* AI 互动游戏分类页：在 djds-skin.css 的站点基础上仅补充页面专属样式。 */
.ai-game-page {
  padding-bottom: 56px;
}

.ai-game-intro {
  background: linear-gradient(135deg, rgba(255, 65, 138, .14), rgba(117, 65, 255, .1));
}

.ai-game-section-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: 30px 0 14px;
}

.ai-game-section-heading > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.ai-game-section-heading h2,
.ai-game-card h2 {
  margin: 0;
}

.ai-game-section-meta {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, .56);
  font-size: 13px;
}

.ai-game-eyebrow,
.ai-game-card-type,
.ai-game-card-cta {
  color: #ff78ae;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}

.ai-game-eyebrow {
  margin: 0;
}

.ai-game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ai-game-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.ai-game-categories a {
  display: flex;
  min-height: 74px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid rgba(255, 120, 174, .35);
  border-radius: 8px;
  background: rgba(255, 65, 138, .1);
  color: #ffb0cf;
  font-weight: 700;
  text-decoration: none;
}

.ai-game-categories a::after {
  content: attr(data-count);
  margin-top: 4px;
  color: rgba(255, 255, 255, .52);
  font-size: 12px;
  font-weight: 500;
}

.ai-game-categories a:hover,
.ai-game-categories a:focus-visible {
  border-color: #ff78ae;
  background: rgba(255, 65, 138, .22);
}

/* 卡片＝海报式：封面铺满整卡，文字压在底部渐变遮罩上 */
.ai-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 3 / 4;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  overflow: hidden;
  background: #1a1720;
  color: #fff;
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.ai-game-card-media {
  position: absolute;
  inset: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #1a1720;
  z-index: 0;
}

.ai-game-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

/* 底部渐变遮罩，保证文字在封面上可读 */
.ai-game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top,
    rgba(10, 8, 12, .94) 0%,
    rgba(10, 8, 12, .82) 22%,
    rgba(10, 8, 12, .35) 52%,
    rgba(10, 8, 12, 0) 78%);
  pointer-events: none;
}

.ai-game-card > .ai-game-card-type,
.ai-game-card > h2,
.ai-game-card > p,
.ai-game-card > .ai-game-card-cta {
  position: relative;
  z-index: 2;
}

.ai-game-card-type {
  align-self: flex-start;
}

.ai-game-card h2 {
  margin: 0;
  font-size: 19px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}

.ai-game-card p {
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
}

.ai-game-card-cta {
  margin-top: 2px;
}

.ai-game-card:hover .ai-game-card-media img,
.ai-game-card:focus-visible .ai-game-card-media img {
  transform: scale(1.05);
}

.ai-game-card:hover,
.ai-game-card:focus-visible {
  border-color: #ff5c9f;
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(255, 65, 138, .25);
}

@media (max-width: 1100px) {
  .ai-game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .ai-game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .ai-game-categories {
    gap: 8px;
  }
}

/* 分类筛选 Tab（就地筛选，不跳转） */
.ai-game-categories {
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: none;
  gap: 10px;
}
.ai-game-cat-tab {
  cursor: pointer;
  padding: 8px 16px;
  border: 1px solid rgba(255, 120, 174, .35);
  border-radius: 999px;
  background: rgba(255, 65, 138, .08);
  color: #ffb0cf;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.ai-game-cat-tab span {
  margin-left: 4px;
  color: rgba(255, 255, 255, .5);
  font-weight: 500;
  font-size: 12px;
}
.ai-game-cat-tab:hover,
.ai-game-cat-tab:focus-visible {
  border-color: #ff78ae;
  background: rgba(255, 65, 138, .18);
}
.ai-game-cat-tab.is-active {
  border-color: #ff5c9f;
  background: linear-gradient(135deg, #ff418a, #ff78ae);
  color: #1a0d14;
}
.ai-game-cat-tab.is-active span { color: rgba(26, 13, 20, .7); }
