:root {
  color-scheme: light;
  --bg: #f4f6ff;
  --bg-soft: #eef1ff;
  --text: #0f172a;
  --muted: #5b647a;
  --primary: #4f46e5;
  --primary-strong: #3b35c4;
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.45);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --gradient: linear-gradient(135deg, rgba(79, 70, 229, 0.9), rgba(14, 165, 233, 0.85));
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --bg-soft: #10172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-strong: #4338ca;
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(148, 163, 184, 0.25);
  --shadow: 0 18px 50px rgba(2, 6, 23, 0.45);
  --gradient: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(14, 165, 233, 0.7));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.18), transparent 55%),
              radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.2), transparent 45%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 16px;
  width: 100%;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}

ul {
  padding-left: 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

body[data-theme="dark"] .site-header {
  background: rgba(11, 17, 32, 0.6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo span {
  background: linear-gradient(
    110deg,
    var(--text) 30%,
    rgba(255, 255, 255, 0.4) 45%,
    var(--text) 60%
  );
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: shine 3s linear infinite;
}

body[data-theme="dark"] .logo span {
  background: linear-gradient(
    110deg,
    var(--text) 30%,
    rgba(255, 255, 255, 0.6) 45%,
    var(--text) 60%
  );
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: shine 8s linear infinite;
}

.logo-img {
  height: 48px;
  width: auto;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo:hover .logo-img {
  transform: scale(1.1) rotate(5deg);
}

@keyframes shine {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 15px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(79, 70, 229, 0.15);
  color: var(--primary);
  transform: translateY(-1px);
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  align-items: center;
}

.hero-content h1 {
  font-size: 44px;
  margin: 18px 0;
  line-height: 1.2;
}

.hero-content p {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--gradient);
  color: white;
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 28px;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  margin-top: 24px;
}

.hero-media {
  position: relative;
  display: grid;
  gap: 24px;
}

.hero-card {
  overflow: hidden;
  border-radius: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.5s ease;
}

.hero-card:hover {
  transform: translateY(-8px);
}

.hero-card.secondary {
  position: absolute;
  right: -10%;
  bottom: -10%;
  width: 75%;
  transform: rotate(-2deg);
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-title {
  margin-bottom: 36px;
}

.section-title h2 {
  margin: 0 0 12px;
  font-size: 32px;
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-card .icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 16px;
}

.feature-card h3 {
  margin: 0;
  font-size: 18px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
}

.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--text);
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 15px;
}

.glass-btn.primary {
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.glass-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.glass-btn.small {
  padding: 8px 16px;
  font-size: 13px;
}

.glass-btn.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.animated-btn {
  position: relative;
  animation: pulse-glow 2s infinite;
  white-space: nowrap;
}

.animated-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  animation: tooltip-fade 0.3s forwards;
  z-index: 100;
}

.animated-btn[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent rgba(0, 0, 0, 0.8) transparent;
  opacity: 0;
  animation: tooltip-fade 0.3s forwards;
  z-index: 100;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.6);
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    transform: scale(1);
  }
}

@keyframes tooltip-fade {
  from { opacity: 0; transform: translate(-50%, -5px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 40px;
}

.download-info h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.download-info p {
  margin: 0 0 20px;
  color: var(--muted);
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 180px;
}

.footer {
  margin-top: 80px;
  padding: 60px 24px 30px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
}

body[data-theme="dark"] .footer {
  background: rgba(11, 17, 32, 0.4);
}

.footer-content {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 40px;
}

.footer h4 {
  margin: 0 0 12px;
  font-size: 18px;
}

.footer p {
  margin: 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 30px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

body[data-theme="dark"] .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.image-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.image-preview.open {
  opacity: 1;
  pointer-events: auto;
}

.image-preview__image {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  cursor: zoom-out;
}

.image-preview.open .image-preview__image {
  transform: scale(1);
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
}

.game-card-img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 0;
  width: 80px;
  /* height: 80px; Remove fixed height */
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.game-card-img-wrapper img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.game-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* 防止文本溢出撑开容器 */
}

.game-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-intro {
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 12px;
  line-height: 1.5;
  height: 42px;
}

.game-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.game-type-badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  font-weight: 500;
}

.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 16px;
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 100px;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 36px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-card.secondary {
    display: none;
  }

  .nav {
    flex-wrap: wrap;
    gap: 16px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  
  .download-panel {
    flex-direction: column;
    text-align: center;
  }
  
  .download-actions {
    width: 100%;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }
  
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
