@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent-gold: #fbbf24;
  --header-height: 64px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #f8fafc;
  background-color: #020617;
  overflow-x: hidden;
}

/* 顶部通知条 - 科技感重塑 */
.notification-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 11000;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, #fbbf24, #f59e0b, #fbbf24, transparent) 1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  height: 44px;
  /* 固定高度以便计算偏移 */
}

/* 全局偏移逻辑：确保 Banner 显示时内容下移 */
body.has-notification .game-header {
  top: 44px;
}

body.has-notification .sidebar-drawer {
  top: calc(var(--header-height) + 12px + 44px);
}

body.has-notification .game-content {
  margin-top: calc(var(--header-height) + 44px);
}

/* 增加平滑过渡容器 */
.game-header,
.sidebar-drawer,
.game-content {
  transition: all 0.3s ease;
}

@keyframes bannerPulse {

  0%,
  100% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 10px rgba(245, 158, 11, 0.1);
  }

  50% {
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5), 0 0 25px rgba(245, 158, 11, 0.25);
  }
}

.notification-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  position: relative;
}

/* 装饰性扫描线效果 */
.notification-content::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.05), transparent);
  animation: scanline 6s infinite linear;
}

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

  100% {
    left: 200%;
  }
}

.notification-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 18px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  flex-shrink: 0;
}

.notification-text {
  flex: 1;
  text-align: center;
  color: #f8fafc;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  /* 基础状态：居中不换行 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

/* 滚动状态样式 - 无缝循环 */
.notification-text.is-scrolling {
  text-align: left;
  text-overflow: clip;
  display: flex !important;
  justify-content: flex-start;
  align-items: center;
}

.notification-text .marquee-inner {
  display: flex;
  white-space: nowrap;
  animation: marquee-seamless 15s linear infinite;
  will-change: transform;
}

.notification-text .marquee-inner span {
  display: inline-block;
  padding-right: 80px;
  /* 两个副本之间的间距 */
  flex-shrink: 0;
}

@keyframes marquee-seamless {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }

  /* 移动两个相同副本总宽度的一半，实现无缝衔接 */
}

.notification-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

.notification-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  transform: rotate(90deg);
}

/* 顶部安全状态脉冲 - 已删除 */

/* 顶部安全状态脉冲 */
.header-secure-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  margin-left: 12px;
}

.secure-pulse {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}



/* 侧边栏侧滑菜单 - 高级感设计 */
.sidebar-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10001;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(251, 191, 36, 0.1);
}

.sidebar-drawer.open {
  transform: translateX(280px);
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 1px;
}

.sidebar-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
}

.sidebar-content {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-item {
  width: 100%;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #94a3b8;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  text-align: left;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.sidebar-item.active {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-left-color: #fbbf24;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 菜单切换按钮 */
.menu-toggle-btn {
  display: none;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 20px;
}

.menu-toggle-btn:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: #fbbf24;
  color: #fbbf24;
}


/* 登录页面样式 */
.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;
}

/* 线路优化按钮样式 */
.optimization-sidebar {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
}

.opt-btn {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.opt-btn::before {
  content: '⚡';
  font-size: 16px;
}

.opt-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
  transform: translateX(-5px);
  box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.2);
}

.opt-btn:active {
  transform: scale(0.95) translateX(-5px);
}

@media (max-width: 768px) {
  .optimization-sidebar {
    top: 16px;
    right: 16px;
    gap: 8px;
  }

  .opt-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
}

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

.game-header {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(251, 191, 36, 0.1);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.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;
  flex-wrap: wrap;
  /* 允许换行，解决移动端被遮挡问题 */
  gap: 8px;
  margin-bottom: 24px;
  background: rgba(30, 41, 59, 0.3);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab {
  flex: 1;
  min-width: 100px;
  /* 确保最小宽度，防止挤压 */
  padding: 12px 16px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

/* 桌面端 Tab 动画增强 */
.tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #fbbf24;
  transition: all 0.4s ease;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.tab.active::after {
  width: 60%;
}

.tab:hover:not(.active) {
  background: rgba(251, 191, 36, 0.05);
  color: #f8fafc;
}

.tab.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.05));
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.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: 24px;
}

/* 响应式调整 */
@media (max-width: 1024px) {
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
  }
}



.game-card {
  background: rgba(30, 41, 59, 0.4);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), transparent, rgba(251, 191, 36, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
}

.game-card:hover::before {
  opacity: 1;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

.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: 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;
  }
}

/* ============================================================
   DEFINITIVE EXTREME macOS GLASS MOBILE DESIGN
   (Placed at end to ensure total priority)
   ============================================================ */
@media (max-width: 768px) {

  /* 基础容器 */
  .game-container {
    display: block !important;
    background: radial-gradient(circle at top right, #1e293b, #020617) !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    /* 生态级平滑滚动 */
  }

  body {
    overscroll-behavior-y: none !important;
    /* 防止下拉刷新导致的滚动跳变 */
  }

  /* 极致玻璃 Header (Fixed Positioning) */
  .game-header {
    position: fixed !important;
    top: 0 !important;
    transition: top 0.3s ease !important;
    left: 0 !important;
    width: 100% !important;
    height: var(--header-height) !important;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(40px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 16px !important;
    z-index: 1200 !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3) !important;
  }

  .user-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 1 !important;
    margin-right: 16px !important;
    overflow: hidden !important;
    justify-content: flex-start !important;
  }

  .username {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    white-space: normal !important;
    line-height: 1.1 !important;
    word-break: break-all !important;
    max-width: 100px !important;
    display: block !important;
  }

  .balance {
    background: rgba(16, 185, 129, 0.1) !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
    color: #10b981 !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }

  .header-buttons {
    display: flex !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
    align-items: center !important;
  }

  .header-buttons .btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
  }

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

  .btn-refresh:hover,
  .btn-refresh:active {
    background: rgba(59, 130, 246, 0.25) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
  }

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

  .btn-logout:hover,
  .btn-logout:active {
    background: rgba(239, 68, 68, 0.25) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
  }

  /* 静态 macOS 导航轨 (Always-On Rail) */
  .sidebar-drawer {
    position: fixed !important;
    left: 10px !important;
    top: calc(var(--header-height) + 12px) !important;
    bottom: 12px !important;
    width: 82px !important;
    /* 精简固定的导航轨宽度 */
    background: var(--glass-bg) !important;
    backdrop-filter: blur(40px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 22px !important;
    z-index: 1100 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    transition: top 0.3s ease !important;
    overscroll-behavior: contain !important;
  }

  /* 当有通知时，向下偏移 (已移至全局) */

  .sidebar-content {
    padding: 12px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
  }

  .sidebar-item {
    width: calc(100% - 12px) !important;
    height: auto !important;
    min-height: 76px !important;
    display: flex !important;
    flex-direction: column !important;
    /* 图标文字上下堆叠 */
    align-items: center !important;
    justify-content: center !important;
    border-radius: 16px !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
    border: none !important;
    position: relative !important;
    padding: 8px 4px !important;
    gap: 4px !important;
  }

  .sidebar-item.active {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.15), transparent) !important;
    border: 1px solid rgba(251, 191, 36, 0.2) !important;
    box-shadow: inset 0 0 20px rgba(251, 191, 36, 0.05) !important;
  }

  .sidebar-item.active::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 15%;
    height: 70%;
    width: 5px;
    background: var(--accent-gold);
    border-radius: 0 6px 6px 0;
    box-shadow: 0 0 20px var(--accent-gold), 0 0 40px var(--accent-gold);
    animation: neon-pulse 2s infinite ease-in-out;
  }

  @keyframes neon-pulse {

    0%,
    100% {
      opacity: 0.8;
      box-shadow: 0 0 15px var(--accent-gold);
    }

    50% {
      opacity: 1;
      box-shadow: 0 0 30px var(--accent-gold), 0 0 50px var(--accent-gold);
    }
  }

  /* Logo 容器 - 精致尺寸 */
  .sidebar-icon-wrapper {
    width: 40px !important;
    height: 40px !important;
    background: #ffffff !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2) !important;
  }

  .sidebar-icon-img {
    width: 32px !important;
    height: 32px !important;
    object-fit: contain !important;
  }

  .sidebar-icon-text {
    color: #111827;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1;
  }

  .sidebar-text {
    font-size: 10px !important;
    /* 字体缩小以适应纵向布局 */
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.8) !important;
    white-space: nowrap !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-align: center !important;
    width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .sidebar-item.active .sidebar-text {
    color: var(--accent-gold) !important;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3) !important;
  }

  /* 游戏内容区适配 (Correct Offset for 82px Sidebar) */
  .game-content {
    margin-top: var(--header-height) !important;
    padding-left: 104px !important;
    /* 82px width + 10px left + 12px padding */
    padding-right: 12px !important;
    padding-top: 16px !important;
    padding-bottom: 100px !important;
    /* 增加底部安全区，防止被工具栏遮挡 */
    transition: margin-top 0.3s ease !important;
  }

  /* 已移至全局 */

  .sidebar-overlay.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
  }

  /* 隐藏桌面端特有或多余组件 */
  .menu-toggle-btn,
  .game-tabs,
  .sidebar-header {
    display: none !important;
  }
}
