:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --surface-card: #fbfcfe;
  --text: #353940;
  --muted: #9aa1ad;
  --line: #eceff4;
  --shadow: 0 18px 46px rgba(31, 42, 68, 0.08);
  --shadow-soft: 0 10px 26px rgba(31, 42, 68, 0.06);
  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 22px;
  --page-width: 1180px;
  --chip-1: #ffefad;
  --chip-2: #d9efff;
  --chip-3: #e9ddff;
  --chip-4: #ffdfe8;
  --chip-5: #ddf8df;
  --green: #08a943;
  --green-dark: #05923a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.sr-only {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

img {
  display: block;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 26px 20px 64px;
}

.toolbar {
  margin-bottom: 26px;
}

.toolbar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 14px;
  align-items: center;
}

.search {
  position: relative;
}

.search input {
  width: 100%;
  height: 68px;
  padding: 0 24px 0 58px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
}

.search input::placeholder {
  color: #b5bbc5;
  font-weight: 700;
}

.search::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 2px solid #b8bec7;
  border-radius: 50%;
  transform: translateY(-60%);
}

.search::after {
  content: "";
  position: absolute;
  left: 40px;
  top: 50%;
  width: 9px;
  height: 2px;
  border-radius: 2px;
  background: #b8bec7;
  transform: translateY(7px) rotate(45deg);
}

.toolbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.toolbar-grid-icon {
  display: grid;
  grid-template-columns: repeat(2, 12px);
  gap: 6px;
}

.toolbar-grid-icon span {
  width: 12px;
  height: 12px;
  border: 2px solid #9aa1ad;
  border-radius: 4px;
}

.section {
  margin-bottom: 38px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.section-more,
.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.game-card-image {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card-image img,
.game-card-icon img,
.detail-icon img,
.detail-related-card img {
  height: 100%;
  object-fit: cover;
  background: var(--surface-soft);
}

.game-card-image:hover,
.game-card-icon:hover,
.detail-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(31, 42, 68, 0.12);
}

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: #666d79;
  font-size: 28px;
  cursor: pointer;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: #4d5563;
  font-size: 28px;
  line-height: 1;
}

.page-title {
  margin: 0;
  font-size: 54px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.category-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.category-card {
  display: block;
  overflow: hidden;
  border-radius: 34px;
  background: linear-gradient(180deg, #ffffff, #fafbff);
  box-shadow: var(--shadow);
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(31, 42, 68, 0.12);
}

.category-card-cover {
  aspect-ratio: 1 / 1;
  border-radius: 30px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--surface-soft);
}

.category-card-title {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.category-card-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 22px;
}

.game-card-text {
  display: block;
}

.game-card-icon {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 34px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  margin-bottom: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card-name {
  margin: 0;
  text-align: center;
  font-size: 22px;
  line-height: 1.16;
  font-weight: 800;
  color: #454951;
  word-break: break-word;
}

.detail-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 72px;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  min-height: 340px;
  background: #f5f7fb;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-image);
  background-position: center;
  background-size: cover;
  filter: blur(20px) saturate(1.1);
  transform: scale(1.08);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.16));
}

.detail-hero-inner {
  position: relative;
  z-index: 1;
}

.detail-hero-top {
  display: flex;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 14px;
}

.detail-icon {
  width: 128px;
  height: 128px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 8px solid #ffffff;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
}

.detail-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}

.detail-title-badge {
  border-radius: 24px;
  padding: 16px 20px;
  background: rgba(70, 74, 80, 0.45);
  backdrop-filter: blur(6px);
}

.detail-title {
  margin: 0;
  color: #ffffff;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

.play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  border-radius: 28px;
  background: var(--green);
  color: #ffffff;
  font-size: 42px;
  font-weight: 900;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08);
}

.detail-play-button {
  min-height: 72px;
  font-size: 34px;
}

.play-button:hover {
  background: var(--green-dark);
}

.detail-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 18px;
  color: #ffffff;
}

.stars {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 900;
}

.stars-icons {
  color: #ff9f00;
  letter-spacing: 3px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.likes {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 900;
}

.detail-panels {
  display: grid;
  gap: 18px;
}

.detail-related {
  background: var(--surface);
  border-radius: 34px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.detail-related-title {
  margin: 0;
  text-align: center;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.detail-related-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.detail-related-card {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.empty {
  padding: 54px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
}

.hidden {
  display: none !important;
}

.play-body {
  --play-viewport-height: 100dvh;
  background: #0f1014;
  overflow: hidden;
}

.play-page {
  width: 100vw;
  height: var(--play-viewport-height);
  min-height: 100vh;
  min-height: 100dvh;
}

.play-frame-wrap {
  width: 100%;
  height: 100%;
  background: #0b0d12;
}

.play-frame {
  width: 100%;
  height: var(--play-viewport-height);
  min-height: 100vh;
  min-height: 100dvh;
  border: 0;
  background: #0b0d12;
}

.play-floating-back {
  position: fixed;
  left: 0;
  top: calc(env(safe-area-inset-top, 0px) + 24px);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(15, 20, 34, 0.24);
  color: #3c4453;
  font-size: 24px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.play-floating-back:active {
  cursor: grabbing;
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 30px;
  color: #8f96a3;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer-domain {
  word-break: break-all;
}

.doc-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.doc-card {
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.doc-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.doc-title {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.doc-content {
  color: #536071;
  font-size: 16px;
  line-height: 1.75;
}

.doc-content h2,
.doc-content h3,
.doc-content h4 {
  margin: 26px 0 10px;
  color: #313845;
  line-height: 1.3;
}

.doc-content h2 {
  font-size: 26px;
}

.doc-content h3 {
  font-size: 20px;
}

.doc-content h4 {
  font-size: 17px;
}

.doc-content p,
.doc-content ul,
.doc-content ol,
.doc-content table,
.doc-content blockquote {
  margin: 12px 0;
}

.doc-content ul,
.doc-content ol {
  padding-left: 22px;
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px #edf0f5;
}

.doc-content th,
.doc-content td {
  padding: 12px 14px;
  border: 1px solid #edf0f5;
  text-align: left;
  vertical-align: top;
}

.doc-content th {
  background: #f8f9fc;
  color: #313845;
}

.doc-content blockquote {
  padding: 12px 16px;
  border-left: 4px solid #dce3ee;
  background: #fafbfe;
  color: #677284;
  border-radius: 0 12px 12px 0;
}

@media (max-width: 860px) {
  .page,
  .detail-page {
    padding: 18px 16px 54px;
  }

  .section-title {
    font-size: 28px;
  }

  .page-title {
    font-size: 42px;
  }

  .game-grid,
  .category-grid,
  .category-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .detail-hero {
    min-height: 0;
    padding: 20px;
  }

  .detail-hero-top {
    gap: 14px;
  }

  .detail-title-badge {
    padding: 16px 18px;
  }

  .detail-title {
    font-size: 24px;
  }

  .play-button {
    min-height: 68px;
    font-size: 32px;
  }

  .detail-play-button {
    min-height: 60px;
    font-size: 28px;
  }

  .detail-related-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
  }

  .detail-related-card {
    border-radius: 16px;
  }
}

@media (max-width: 560px) {
  .search input {
    height: 58px;
  }

  .toolbar-row {
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 10px;
  }

  .toolbar-action {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .page-title {
    font-size: 32px;
  }

  .section-header {
    margin-bottom: 12px;
  }

  .section-title {
    font-size: 24px;
  }

  .game-card-icon {
    border-radius: 26px;
  }

  .game-card-name {
    font-size: 16px;
  }

  .detail-icon {
    width: 92px;
    height: 92px;
    border-width: 6px;
  }

  .detail-title {
    font-size: 20px;
  }

  .play-button {
    min-height: 58px;
    font-size: 26px;
  }

  .detail-play-button {
    min-height: 52px;
    font-size: 24px;
  }

  .stars,
  .likes {
    font-size: 18px;
  }

  .detail-related {
    padding: 18px;
  }

  .detail-related-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .detail-related-card {
    border-radius: 12px;
  }

  .category-card {
    padding: 14px;
    border-radius: 24px;
  }

  .category-card-title {
    font-size: 18px;
  }

  .category-card-meta {
    font-size: 13px;
  }

  .play-floating-back {
    left: 0;
    top: calc(env(safe-area-inset-top, 0px) + 20px);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 22px;
  }

  .site-footer {
    gap: 8px;
    padding: 16px 12px 24px;
    font-size: 13px;
  }

  .doc-page {
    padding: 18px 16px 28px;
  }

  .doc-card {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .doc-title {
    font-size: 28px;
  }

  .doc-content {
    font-size: 15px;
  }

  .doc-content h2 {
    font-size: 22px;
  }

  .doc-content h3 {
    font-size: 18px;
  }
}
