:root {
  --bg: #050c14;
  --bg-soft: #0a1626;
  --text: #ebf3ff;
  --muted: #91a7bf;
  --accent: #31d9ff;
  --accent-warm: #ff8b4d;
  --radius: 20px;
  --shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 223, 150, 0.3) 0%, rgba(255, 223, 150, 0) 34%),
    radial-gradient(circle at 86% 82%, rgba(255, 184, 86, 0.22) 0%, rgba(255, 184, 86, 0) 38%),
    linear-gradient(150deg, #17263a 0%, #25364d 52%, #2f425a 100%);
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 20%, black 35%, transparent 95%);
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 50rem;
  height: 50rem;
  filter: blur(68px);
  opacity: 0.44;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-a {
  top: -12rem;
  left: -8rem;
  background: #ffe3a3;
  animation: glowFloatA 11s ease-in-out infinite;
}

.bg-glow-b {
  right: -8rem;
  bottom: -10rem;
  background: #ffc16f;
  animation: glowFloatB 12.5s ease-in-out infinite;
}

.games-section,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 2.4rem));
  margin: 0 auto;
}

.games-section {
  padding-top: 1.2rem;
  padding-bottom: 4.2rem;
}

.game-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "studio c1 c2"
    "studio c3 c4"
    "c5 c6 c7";
}

.game-grid > :nth-child(1) { grid-area: studio; }
.game-grid > :nth-child(2) { grid-area: c1; }
.game-grid > :nth-child(3) { grid-area: c2; }
.game-grid > :nth-child(4) { grid-area: c3; }
.game-grid > :nth-child(5) { grid-area: c4; }
.game-grid > :nth-child(6) { grid-area: c5; }
.game-grid > :nth-child(7) { grid-area: c6; }
.game-grid > :nth-child(8) { grid-area: c7; }

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-soft);
  aspect-ratio: 16 / 9;
  border: 0;
  box-shadow: none;
  isolation: isolate;
  transform: translateY(12px);
  opacity: 0;
  animation: rise 680ms ease forwards;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(130deg, rgba(49, 217, 255, 0.65), rgba(255, 139, 77, 0.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 220ms ease;
}

.card:hover::before,
.card:focus-visible::before {
  opacity: 1;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px) scale(1.01);
  transition: transform 220ms ease;
}

.card-static {
  cursor: default;
}

.studio-tile {
  aspect-ratio: auto;
  display: flex;
  align-items: stretch;
  padding: 1rem;
  background: #0b1624;
}

.studio-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  opacity: 1;
  padding: 0;
  -webkit-mask: none;
  mask: none;
  z-index: 1;
}

.studio-tile::after {
  content: "";
  position: absolute;
  inset: -10%;
  background: url("assets/工作室icon.jpg") center/cover no-repeat;
  filter: blur(22px) saturate(1.1);
  transform: scale(1.12);
  opacity: 0.8;
  z-index: 0;
}

.studio-tile:hover,
.studio-tile:focus-visible {
  transform: translateY(0);
}

.studio-tile-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 1rem;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.studio-tile-avatar {
  width: 122px;
  height: 122px;
  border-radius: 18px;
  background: rgba(7, 18, 31, 0.85) url("assets/工作室icon.jpg") center/cover no-repeat;
  border: 1px solid rgba(49, 217, 255, 0.5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.studio-tile-name {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.04em;
}

.studio-tile-intro {
  margin: 0;
  color: #ffffff;
  line-height: 1.7;
}

.studio-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 220ms ease, max-height 220ms ease, transform 220ms ease;
}

.studio-btn {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(8, 16, 27, 0.48);
  color: #f8fbff;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
}

.studio-btn:hover,
.studio-btn:focus-visible {
  border-color: rgba(49, 217, 255, 0.75);
  color: var(--accent);
}

.contact-email {
  margin: 0.1rem 0 0;
  color: #e9f3ff;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 220ms ease, max-height 220ms ease;
}

.contact-email.is-visible {
  opacity: 1;
  max-height: 2rem;
}

.studio-tile:hover .studio-actions,
.studio-tile:focus-within .studio-actions {
  opacity: 1;
  max-height: 3rem;
  pointer-events: auto;
  transform: translateY(0);
}

.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  inset: 0;
  background: transparent;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 9, 17, 0) 0%, rgba(3, 9, 17, 0) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  text-align: right;
  padding: 1rem;
  gap: 0.55rem;
  transition: background 220ms ease;
}

.name {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.75);
  transform: translateY(8px);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: transform 220ms ease, opacity 220ms ease, max-height 220ms ease;
}

.intro {
  margin: 0;
  color: #d9e7f7;
  line-height: 1.52;
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  max-height: 0;
  max-width: 30ch;
  transition: opacity 220ms ease, transform 220ms ease, max-height 220ms ease;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  max-height: 0;
  overflow: hidden;
  transition: opacity 220ms ease, transform 220ms ease, max-height 220ms ease;
}

.card:hover .overlay,
.card:focus-visible .overlay {
  background: linear-gradient(to top, rgba(3, 9, 17, 0.82) 6%, rgba(3, 9, 17, 0.1) 70%);
}

.card:hover .name,
.card:focus-visible .name {
  transform: translateY(-8px);
  opacity: 1;
  max-height: 3rem;
}

.card:hover .intro,
.card:focus-visible .intro,
.card:hover .cta,
.card:focus-visible .cta {
  opacity: 1;
  transform: translateY(0);
  max-height: 5rem;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.1rem 0 2rem;
  color: #8ea3b8;
  font-size: 0.88rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glowFloatA {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.34;
  }
  50% {
    transform: translate3d(190px, 110px, 0) scale(1.42);
    opacity: 0.62;
  }
}

@keyframes glowFloatB {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.34;
  }
  50% {
    transform: translate3d(-200px, -120px, 0) scale(1.38);
    opacity: 0.64;
  }
}

@media (max-width: 980px) {
  .game-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .game-grid > :nth-child(n) {
    grid-area: auto;
  }

  .studio-tile {
    aspect-ratio: 16 / 9;
  }

  .studio-tile-inner {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
}

@media (max-width: 1024px) and (orientation: portrait) {
  .studio-tile {
    aspect-ratio: auto;
    min-height: 340px;
  }

  .studio-tile-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.95rem;
    padding: 1.1rem;
  }

  .studio-tile-avatar {
    width: 148px;
    height: 148px;
  }

  .studio-tile-name {
    font-size: 1.85rem;
  }

  .studio-tile-intro {
    font-size: 1.06rem;
    line-height: 1.62;
  }
}

@media (max-width: 680px) {
  .games-section,
  .site-footer {
    width: min(1180px, calc(100% - 1.3rem));
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .card {
    aspect-ratio: 16 / 9;
  }

  .studio-tile-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1.15rem;
  }

  .studio-tile {
    aspect-ratio: auto;
    min-height: 360px;
  }

  .studio-tile-avatar {
    width: 152px;
    height: 152px;
  }

  .studio-tile-name {
    font-size: 2rem;
  }

  .studio-tile-intro {
    font-size: 1.12rem;
    line-height: 1.65;
  }
}
