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

:root {
  --bg: #0f1220;
  --bg-card: #1a1f35;
  --bg-card-hover: #232a4a;
  --text: #eef1ff;
  --text-dim: #9aa3c7;
  --accent: #6c8cff;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  background: rgba(15, 18, 32, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header .search-box {
  flex: 1;
  display: flex;
  justify-content: center;
}

.lang-toggle {
  position: absolute;
  right: 24px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.lang-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

.tpl-back {
  position: absolute;
  left: 24px;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.tpl-back:hover {
  color: var(--accent);
}

@media (max-width: 480px) {
  .tpl-back {
    position: static;
    margin-right: 10px;
  }
}

.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 8px;
  text-align: center;
}

.hero-title {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(120deg, #6c8cff, #c06cf7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
}

.hero-desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dim);
}

@media (max-width: 480px) {
  .hero {
    padding: 28px 16px 4px;
  }

  .hero-title {
    font-size: 24px;
  }
}

.search-box input {
  width: 240px;
  max-width: 60vw;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
}

main {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}

@media (max-width: 480px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  main {
    padding: 16px;
  }
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.game-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.game-icon {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  object-fit: cover;
  background: #262c4d;
}

.game-icon-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.game-name {
  font-size: 14px;
  text-align: center;
  color: var(--text);
  line-height: 1.35;
  word-break: break-all;
}

.empty-tip {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 0;
  font-size: 15px;
}

/* 全屏播放器 */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #000;
}

.player-overlay[hidden] {
  display: none;
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: #141828;
  color: var(--text);
  flex: 0 0 auto;
}

.back-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.back-btn:hover {
  filter: brightness(1.1);
}

.player-title {
  flex: 1;
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.open-external {
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
}

.open-external:hover {
  color: var(--text);
}

.game-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #000;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.breadcrumb[hidden] {
  display: none;
}

.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .sep {
  opacity: 0.5;
}

.breadcrumb .current {
  color: var(--text);
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin: 6px 0 18px;
}

#view .section-title:not(:first-child) {
  margin-top: 32px;
}

/* 一级：分类网格 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

@media (max-width: 480px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.cat-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.cat-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: #262c4d;
  flex: 0 0 auto;
}

.cat-meta {
  min-width: 0;
}

.cat-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.cat-count {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* 三级：游戏详情页 */
.detail {
  max-width: 860px;
  margin: 0 auto;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 28px;
}

.detail-icon {
  width: 112px;
  height: 112px;
  border-radius: 22px;
  object-fit: cover;
  background: #262c4d;
  flex: 0 0 auto;
}

.detail-head-info {
  flex: 1;
  min-width: 180px;
}

.detail-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 10px;
}

.detail-cat-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 12px;
  text-decoration: none;
  background: rgba(108, 140, 255, 0.15);
  color: var(--accent);
}

.detail-cat-tag:hover {
  background: rgba(108, 140, 255, 0.28);
}

.play-btn {
  padding: 13px 36px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(120deg, #6c8cff, #c06cf7);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(108, 140, 255, 0.35);
  transition: filter 0.15s, transform 0.15s;
}

.play-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .play-btn {
    width: 100%;
  }
}

.detail-section {
  margin-bottom: 28px;
}

.detail-section h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

.detail-desc {
  color: var(--text-dim);
  line-height: 1.9;
  font-size: 14px;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
}

.info-table td {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.info-table tr:first-child td {
  border-top: none;
}

.info-table td.k {
  width: 110px;
  color: var(--text-dim);
  white-space: nowrap;
}

.info-table a {
  color: var(--accent);
  text-decoration: none;
}
