/* 全局样式重置和基础设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #ffffff;
}

/* 登录页面样式 */
.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: #94a3b8;
  text-align: center;
  margin-bottom: 32px;
  font-size: 1.1rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  color: #ffffff;
  font-size: 16px;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
  color: #94a3b8;
}

.password-container {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.checkbox {
  margin-right: 8px;
  accent-color: #667eea;
}

.checkbox-label {
  color: #94a3b8;
  font-size: 14px;
}

.login-button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 游戏页面样式 */
.game-container {
  min-height: 100vh;
  background: #0f172a;
  color: #ffffff;
}

.game-header {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.username {
  font-weight: 600;
  color: #e2e8f0;
}

.balance {
  background: linear-gradient(135deg, #1e293b, #334155);
  border: 1px solid #64748b;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #f1f5f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.5px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

/* 悬停效果 */
.balance:hover {
  background: linear-gradient(135deg, #334155, #475569);
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 余额数字高亮 */
.balance-amount {
  color: #10b981;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.header-buttons {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-refresh {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-refresh:hover {
  background: rgba(59, 130, 246, 0.2);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
}

.game-content {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.game-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  background: rgba(30, 41, 59, 0.5);
  padding: 4px;
  border-radius: 8px;
}

.tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab.active {
  background: linear-gradient(135deg, #ff4500, #ff6347); /* 橙红渐变 */
  color: white;
}

.tab:hover:not(.active) {
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.game-card {
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(148, 163, 184, 0.1);
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(255, 69, 0, 0.3); /* 橙红色阴影 */
  border-color: rgba(255, 69, 0, 0.5);
}

.game-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.game-info {
  padding: 16px;
}

.game-name {
  font-weight: 600;
  margin-bottom: 8px;
  color: #e2e8f0;
}

.game-description {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .login-card {
    padding: 24px;
    margin: 16px;
  }
  
  .login-title {
    font-size: 2rem;
  }
  
  .game-header {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  
  .user-info {
    flex-direction: column;
    gap: 8px;
  }
  
  .game-tabs {
    flex-direction: column;
  }
  
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
  
  .game-content {
    padding: 16px;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 成功提示样式 */
.success-message {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  margin-bottom: 16px;
  text-align: center;
}

/* 分类图标样式 */
.category-icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  padding: 40px;
  margin: 20px auto;
  max-width: 600px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #333;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: #ffd700;
}

.category-image {
  object-fit: cover;
  border-radius: 15px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.category-info {
  text-align: center;
}

.game-name {
  font-size: 1.5em;
  font-weight: bold;
  color: #ff6347;
  margin: 10px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.category-description {
  font-size: 1.2em;
  color: #ccc;
  margin: 0;
}
/* Toast 遮罩层 */
.toast-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-overlay.show {
  opacity: 1;
}

.toast-overlay.hide {
  opacity: 0;
}

/* Toast 容器 */
.toast-container {
  transform: scale(0.7) translateY(50px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-overlay.show .toast-container {
  transform: scale(1) translateY(0);
}

.toast-overlay.hide .toast-container {
  transform: scale(0.8) translateY(-30px);
}

/* Toast 消息主体 */
.toast-message {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 32px;
  border-radius: 16px;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  min-width: 400px;
  max-width: 600px;
  font-weight: 600;
  font-size: 18px;
  position: relative;
  overflow: hidden;
}

/* 添加发光效果 */
.toast-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* 成功提示 - 绿色主题 */
.toast-success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.3));
  color: #ffffff;
  border: 2px solid rgba(34, 197, 94, 0.5);
  box-shadow: 
    0 25px 50px rgba(34, 197, 94, 0.3),
    0 0 30px rgba(34, 197, 94, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 错误提示 - 红色主题 */
.toast-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.3));
  color: #ffffff;
  border: 2px solid rgba(239, 68, 68, 0.5);
  box-shadow: 
    0 25px 50px rgba(239, 68, 68, 0.3),
    0 0 30px rgba(239, 68, 68, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 加载提示 - 蓝色主题 */
.toast-loading {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.3));
  color: #ffffff;
  border: 2px solid rgba(59, 130, 246, 0.5);
  box-shadow: 
    0 25px 50px rgba(59, 130, 246, 0.3),
    0 0 30px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 图标样式 */
.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
  animation: iconPulse 2s infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.toast-success .toast-icon {
  background: rgba(34, 197, 94, 0.3);
  color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.toast-loading .toast-icon {
  background: rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.toast-text {
  flex: 1;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 加载动画 */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: currentColor;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .toast-message {
    min-width: 320px;
    max-width: 90vw;
    padding: 20px 24px;
    font-size: 16px;
  }
  
  .toast-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .loading-spinner {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .toast-message {
    min-width: 280px;
    padding: 18px 20px;
    font-size: 15px;
  }
  
  .toast-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
}


/* 确认对话框样式 */
.toast-confirm {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(100, 116, 139, 0.3));
  color: #ffffff;
  border: 2px solid rgba(148, 163, 184, 0.5);
  box-shadow: 
    0 25px 50px rgba(148, 163, 184, 0.3),
    0 0 30px rgba(148, 163, 184, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column; /* 文本和按钮区域上下排列 */
  gap: 20px;
  padding: 24px;
  text-align: center;
}

/* 确认对话框按钮容器 */
.toast-buttons {
  display: flex;
  flex-direction: row; /* 按钮之间左右排列 */
  gap: 12px;
  width: 100%;
  justify-content: center;
}

/* 确认对话框按钮样式 */
.toast-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  max-width: 120px;
}

/* 取消按钮 */
.toast-btn-cancel {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.toast-btn-cancel:hover {
  background: rgba(148, 163, 184, 0.3);
  border-color: rgba(148, 163, 184, 0.5);
  transform: translateY(-2px);
}

/* 确认按钮 */
.toast-btn-confirm {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.toast-btn-confirm:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .toast-buttons {
    gap: 10px;
  }
  
  .toast-btn {
    padding: 10px 20px;
    font-size: 15px;
    max-width: 100px;
  }
}