:root {
  color-scheme: light;
  --page: #f8f9fc;
  --nav: #ffffff;
  --card: #ffffff;
  --card-name: #fafbfc;
  --text: #1a1d29;
  --muted: #6b7280;
  --cyan: #3b82f6;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --danger: #ef4444;
  --border: #e5e7eb;
  --content-media-width: 70px;
  --content-media-height: 70px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #f8f9fc;
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}
body.game-open { overflow: hidden; }
button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }

.particle-field { display: none; }

.navbar {
  min-height: 63px;
  background: var(--nav);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  width: 100%;
  max-width: 1400px;
  min-height: 62px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
.simulator-logo {
  color: #1a1d29;
  font-size: 21px;
  font-weight: 800;
}

.simulator-container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 24px 80px; }
.content-band:empty { display: none; }
.content-band { padding-top: 16px; }
.content-band-footer { padding-top: 34px; }
.content-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.content-card {
  min-width: 0;
  min-height: calc(var(--content-media-height) + 20px);
  padding: 10px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-top: 2px solid #f6ca4d;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  color: inherit;
  text-decoration: none;
}
.content-card-link { cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.content-card-link:hover { transform: translateY(-2px); border-color: #f6ca4d; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08); }
.content-card-link:focus-visible { outline: 2px solid #f6ca4d; outline-offset: 3px; }
.content-card-media {
  width: min(var(--content-media-width), 42vw);
  height: min(var(--content-media-height), 42vw);
  flex: 0 0 min(var(--content-media-width), 42vw);
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f3f4f6;
}
.content-card-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.content-card-media.fallback { color: #9ca3af; font: 800 13px/1 Consolas, monospace; }
.content-card-media.fallback img { display: none; }
.content-card-copy { min-width: 0; flex: 1 1 auto; }
.content-card-copy strong {
  display: block;
  overflow: hidden;
  color: #1a1d29;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content-card-copy span {
  margin-top: 6px;
  display: -webkit-box;
  overflow: hidden;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.sim-game-search { width: 100%; padding: 12px 0 4px; display: flex; gap: 10px; }
.sim-game-search-box {
  width: 100%;
  height: 45px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sim-game-search-box:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.sim-game-search-icon { width: 20px; flex: 0 0 20px; font-size: 14px; text-align: center; }
.sim-game-search-input {
  min-width: 0;
  width: 100%;
  height: 43px;
  padding: 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1a1d29;
  font-size: 14px;
}
.sim-game-search-input::-webkit-search-cancel-button { display: none; }
.sim-game-search-input::placeholder { color: #9ca3af; }
.sim-game-search-clear {
  width: 28px;
  height: 28px;
  padding: 0;
  display: none;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 21px;
  line-height: 26px;
  cursor: pointer;
}
.sim-game-search-clear.show { display: block; }
.sim-game-search-clear:hover { background: #e5e7eb; color: #1a1d29; }
.sim-search-hint { display: none; padding: 4px 2px 0; color: var(--muted); font-size: 12px; }
.sim-search-hint.show { display: block; }

.sim-tabs { padding: 13px 0 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.sim-tab {
  min-height: 42px;
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: #ffffff;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.sim-tab:hover { transform: translateY(-2px); border-color: #3b82f6; }
.sim-tab.active {
  border-color: transparent;
  background: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  color: #fff;
}

.category-section { width: 100%; }
.category-header { min-height: 32px; margin-bottom: 35px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.category-header h1 { margin: 0; color: #1a1d29; font-size: 24px; font-weight: 700; line-height: 32px; }
.category-badge {
  padding: 5px 11px;
  border: 1px solid #ddd6fe;
  border-radius: 15px;
  background: #f5f3ff;
  color: #7c3aed;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}
.catalog-state { min-height: 240px; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.catalog-state.empty { border: 1px dashed var(--border); border-radius: 12px; }
.catalog-state.error, .game-iframe-loading.error { color: var(--danger); }
.loading-dots { margin-left: 6px; display: inline-flex; align-items: center; gap: 4px; }
.loading-dots span { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: dot-pulse 1.1s ease-in-out infinite; }
.loading-dots span:nth-child(2) { animation-delay: .16s; }
.loading-dots span:nth-child(3) { animation-delay: .32s; }
@keyframes dot-pulse { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.pg-game-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px; }
.pg-game-item {
  min-width: 0;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: #1a1d29;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pg-game-item:hover { transform: translateY(-5px); border-color: #3b82f6; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); }
.pg-game-item:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.pg-game-image { width: 100%; aspect-ratio: 1 / 1; display: block; object-fit: cover; background: #f3f4f6; }
.cover-placeholder { place-items: center; color: #9ca3af; font-size: 12px; }
.pg-game-image.cover-placeholder { display: grid; }
.pg-game-name {
  height: 37px;
  padding: 10px 8px;
  overflow: hidden;
  background: var(--card-name);
  color: #1a1d29;
  font-size: 12px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-top: 1px solid var(--border);
}

.site-footer { padding: 18px 24px 28px; color: #9ca3af; font-size: 12px; text-align: center; }
.back-to-top {
  width: 44px;
  height: 44px;
  padding: 0;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: #3b82f6;
  font-size: 21px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

.game-iframe-container {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: #ffffff;
}
.game-iframe-container.active { display: block; }
.game-iframe-panel { width: 100%; height: 100%; display: grid; grid-template-rows: 58px minmax(0, 1fr); }
.game-iframe-header {
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 2fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.game-iframe-header strong { min-width: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; color: #1a1d29; }
.game-header-content {
  min-width: 0;
  overflow: hidden;
  color: #3b82f6;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.game-header-content:hover { color: #2563eb; text-decoration: underline; }
.game-iframe-close {
  min-width: 92px;
  padding: 8px 16px;
  border: 1px solid #fecaca;
  border-radius: 18px;
  background: #fef2f2;
  color: #ef4444;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  justify-self: end;
  transition: background .2s ease, color .2s ease;
}
.game-iframe-close:hover { background: var(--danger); color: #fff; }
.game-iframe-wrapper { min-height: 0; position: relative; }
.game-iframe-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.game-iframe { width: 100%; height: 100%; display: none; border: 0; background: #ffffff; }

@media (max-width: 1100px) { .pg-game-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 900px) { .content-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .pg-game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .navbar-inner { padding-left: 16px; padding-right: 16px; }
  .simulator-container { padding-left: 16px; padding-right: 16px; padding-bottom: 58px; }
  .simulator-logo { font-size: 19px; }
  .content-list { grid-template-columns: 1fr; }
  .sim-tabs { padding-bottom: 24px; }
  .sim-tab { width: 100%; }
  .category-header { margin-bottom: 22px; }
  .category-header h1 { font-size: 19px; line-height: 27px; }
  .pg-game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
  .pg-game-name { height: 34px; padding: 8px 5px; font-size: 11px; }
  .back-to-top { right: 16px; bottom: 16px; }
  .game-iframe-panel { grid-template-rows: 54px minmax(0, 1fr); }
  .game-iframe-header { padding: 0 12px; grid-template-columns: minmax(0, .8fr) minmax(90px, 1.5fr) auto; gap: 8px; }
  .game-iframe-header strong, .game-header-content { font-size: 12px; }
  .game-iframe-close { min-width: 82px; padding: 7px 12px; }
}

@media (max-width: 380px) {
  .content-card { padding: 8px; gap: 9px; }
  .content-card-copy strong { font-size: 14px; }
  .content-card-copy span { margin-top: 4px; font-size: 11px; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 隐藏分类标题 */
.category-section h1 { display: none !important; }
