/* 
 * 主样式文件 - 苹果风格游戏导航网站
 * 采用苹果设计语言，包括简洁的布局、圆角元素和精致的阴影效果
 */

:root {
  /* 苹果风格颜色变量 */
  --apple-white: #ffffff;
  --apple-light-gray: #f5f5f7;
  --apple-medium-gray: #86868b;
  --apple-dark-gray: #1d1d1f;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-shadow: rgba(0, 0, 0, 0.1);
  
  /* 字体 */
  --apple-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  
  /* 边距和尺寸 */
  --spacing-small: 8px;
  --spacing-medium: 16px;
  --spacing-large: 24px;
  --spacing-xlarge: 48px;
  --border-radius: 12px;
}

/* 深色模式变量 */
@media (prefers-color-scheme: dark) {
  :root {
    --apple-white: #1d1d1f;
    --apple-light-gray: #2d2d2f;
    --apple-medium-gray: #86868b;
    --apple-dark-gray: #f5f5f7;
    --apple-shadow: rgba(0, 0, 0, 0.3);
  }
}

/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--apple-font);
  background-color: var(--apple-white);
  color: var(--apple-dark-gray);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 容器 */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-medium);
}

/* 导航栏 */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-medium) 0;
  position: sticky;
  top: 0;
  background-color: var(--apple-white);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s ease;
}

.navbar-logo {
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--apple-dark-gray);
}

.navbar-search {
  display: flex;
  align-items: center;
  background-color: var(--apple-light-gray);
  border-radius: 8px;
  padding: 8px 16px;
  width: 300px;
}

.navbar-search input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: var(--apple-dark-gray);
  width: 100%;
}

.navbar-controls {
  display: flex;
  gap: var(--spacing-medium);
  align-items: center;
}

.language-selector, .theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-small);
  font-size: 0.9rem;
  color: var(--apple-medium-gray);
}

/* 语言选择器样式 */
.language-selector {
  position: relative;
}

.current-language {
  display: flex;
  align-items: center;
  gap: 5px;
}

.current-language::after {
  content: "▼";
  font-size: 8px;
  display: inline-block;
  margin-left: 4px;
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 120px;
  background-color: var(--apple-white);
  border-radius: var(--border-radius);
  box-shadow: 0 5px 20px var(--apple-shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.language-selector.active .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.language-option:hover {
  background-color: var(--apple-light-gray);
}

/* 页面标题 */
.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin: var(--spacing-large) 0 var(--spacing-medium);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background-color: var(--apple-blue);
  border-radius: 3px;
}

/* 游戏网格 */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-xlarge);
  margin: var(--spacing-large) 0;
}

.game-card {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 12px var(--apple-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px var(--apple-shadow);
}

.game-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center;
  background-color: var(--apple-light-gray);
  transition: transform 0.3s ease;
}

.game-card:hover .game-image {
  transform: scale(1.05);
}

.game-info {
  padding: var(--spacing-medium);
  background-color: var(--apple-light-gray);
  transition: background-color 0.3s ease;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.game-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-small);
}

.game-description {
  font-size: 0.9rem;
  color: var(--apple-medium-gray);
  margin-bottom: var(--spacing-medium);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* 游戏弹窗 */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.game-modal.active {
  opacity: 1;
  visibility: visible;
}

.game-modal-content {
  background-color: var(--apple-white);
  width: 95%;
  max-width: 1200px;
  height: 90%;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s ease;
}

.game-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: white;
  font-size: 1.4rem;
  z-index: 1100;
  transition: all 0.2s ease;
}

.game-modal-close:hover {
  background-color: var(--apple-blue);
  transform: scale(1.1);
}

.game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: var(--apple-white);
  border-radius: var(--border-radius);
  display: block;
  position: relative;
  z-index: 10;
}

.iframe-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.iframe-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 11;
  pointer-events: auto;
}

.game-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--apple-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 5;
  border-radius: var(--border-radius);
  transition: opacity 0.5s ease;
}

.game-loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--apple-light-gray);
  border-top: 5px solid var(--apple-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.game-loading-text {
  font-size: 1.2rem;
  color: var(--apple-medium-gray);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 页脚 */
.footer {
  background-color: var(--apple-light-gray);
  padding: var(--spacing-large) 0;
  margin-top: var(--spacing-xlarge);
  text-align: center;
  transition: background-color 0.3s ease;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-large);
  margin-bottom: var(--spacing-medium);
  flex-wrap: wrap;
}

.footer-link {
  color: var(--apple-medium-gray);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--apple-blue);
}

.footer-copyright {
  color: var(--apple-medium-gray);
  font-size: 0.8rem;
}

/* 暗黑模式样式 */
body.dark-theme {
  --apple-white: #1d1d1f;
  --apple-light-gray: #2d2d2f;
  --apple-medium-gray: #86868b;
  --apple-dark-gray: #f5f5f7;
  --apple-shadow: rgba(0, 0, 0, 0.3);
}

/* 深色模式切换动画 */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar, .featured-game-info, .game-info, .footer, .language-dropdown,
.game-modal-content {
  transition: background-color 0.3s ease;
}

/* 点击阻止层 */
.click-blocking-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 900;
  background-color: transparent;
} 