:root {
  --bg-0: #0a0d14;
  --bg-1: #0f1320;
  --neon-1: #00e0ff;
  --neon-2: #ff00aa;
  --neon-3: #87ff65;
  --text: #e8f0ff;
  --muted: #8aa0c6;
  --nav-h: 66px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% 10%, #101629 0%, var(--bg-0) 40%, var(--bg-1) 100%);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background-color: var(--bg-1); border-radius: 8px; width: 90%; max-width: 500px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); overflow: hidden; border: 1px solid rgba(0,224,255,0.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.modal-header h3 { margin: 0; color: var(--text); font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: background-color 0.2s; }
.modal-close:hover { background-color: rgba(255,255,255,0.1); color: var(--neon-1); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--text); font-weight: 500; }
.form-group input { width: 100%; padding: 8px 12px; border: 1px solid rgba(255,255,255,0.2); border-radius: 4px; font-size: 14px; transition: border-color 0.2s; background-color: rgba(255,255,255,0.05); color: var(--text); }
.form-group input:focus { outline: none; border-color: var(--neon-1); box-shadow: 0 0 0 2px rgba(0,224,255,0.2); }
.form-group input:disabled { background-color: rgba(255,255,255,0.03); color: var(--muted); }
.error-message { color: #ff4d4f; font-size: 12px; margin-top: 4px; min-height: 16px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.btn-primary { background-color: var(--neon-1); color: var(--bg-0); border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s; }
.btn-primary:hover { background-color: #40a9ff; box-shadow: 0 0 8px rgba(0,224,255,0.4); }
.btn-cancel { background-color: transparent; color: var(--muted); border: 1px solid rgba(255,255,255,0.2); padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.btn-cancel:hover { border-color: var(--neon-1); color: var(--neon-1); }

.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; background-image: radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.25) 0, transparent 50%), radial-gradient(1.5px 1.5px at 70% 80%, rgba(255,255,255,.12) 0, transparent 50%), radial-gradient(1.8px 1.8px at 40% 60%, rgba(255,255,255,.18) 0, transparent 50%), radial-gradient(2px 2px at 85% 25%, rgba(255,255,255,.2) 0, transparent 50); animation: twinkle 8s linear infinite; }
@keyframes twinkle { 0% { transform: translateY(0); opacity: .9; } 50% { transform: translateY(-10px); opacity: .7; } 100% { transform: translateY(0); opacity: .9; } }
header { position: relative; z-index: 2; padding: 32px 20px 12px; text-align: center; }
.title { margin: 0; font-size: clamp(24px, 5vw, 48px); letter-spacing: .03em; text-shadow: 0 0 10px rgba(0,224,255,.25), 0 0 25px rgba(255,0,170,.2); }
.subtitle { margin: 8px 0 0; color: var(--muted); font-size: clamp(12px, 2.2vw, 16px); }
.grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; padding: 20px; max-width: 1200px; margin: 0 auto 32px; }
.card { --glow: rgba(0,224,255,.55); --glow-2: rgba(255,0,170,.45); position: relative; display: flex; flex-direction: column; border-radius: 16px; color: var(--text); background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0) 60%), radial-gradient(120% 100% at 0% 0%, rgba(0,224,255,.08), transparent 60%), radial-gradient(120% 100% at 100% 100%, rgba(255,0,170,.08), transparent 60%), linear-gradient(180deg, #0f1526, #0a0f1d); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04); overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card::before { content: ""; position: absolute; inset: -1px; border-radius: 16px; padding: 1px; background: linear-gradient(135deg, var(--neon-1), transparent 30%), linear-gradient(315deg, var(--neon-2), transparent 30%), linear-gradient(90deg, transparent, rgba(255,255,255,.06)); -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000); mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; opacity: .35; transition: opacity .25s ease; }
.card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.15); box-shadow: 0 16px 36px rgba(0,0,0,.5), 0 0 24px var(--glow-2); }
.card:hover::before { opacity: .65; }
.card-preview { position: relative; height: 50%; min-height: 140px; background-image: linear-gradient(135deg, rgba(0,224,255,.12), rgba(255,0,170,.12)); background-size: cover; background-position: center; background-repeat: no-repeat; }
.hot-tag { position: absolute; top: 8px; left: 8px; background: linear-gradient(135deg, #ff4d4f, #ff7a45); color: white; font-size: 12px; font-weight: bold; padding: 4px 8px; border-radius: 4px; z-index: 10; transform: rotate(-5deg); box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.new-tag { position: absolute; top: 8px; left: 8px; background: linear-gradient(135deg, #2ed573, #1e90ff); color: white; font-size: 12px; font-weight: bold; padding: 4px 8px; border-radius: 4px; z-index: 10; transform: rotate(-5deg); box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.card-preview::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.3) 60%, rgba(0,0,0,0) 100%); pointer-events: none; }
.badge { width: 44px; height: 44px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; letter-spacing: .02em; color: #051018; font-size: clamp(12px, 2.2vw, 16px); background: linear-gradient(135deg, #6bdcff, #f8a6ff); filter: saturate(120%) brightness(110%); box-shadow: inset 0 0 24px rgba(255,255,255,.25), 0 4px 12px rgba(0,0,0,.35); }
.badge-01 { background: linear-gradient(135deg, #00e0ff, #7a00ff); }
.badge-02 { background: linear-gradient(135deg, #ff8a00, #ff0040); }
.badge-03 { background: linear-gradient(135deg, #8dff1a, #00c897); }
.badge-04 { background: linear-gradient(135deg, #ffd400, #ff2aa1); }
.badge-05 { background: linear-gradient(135deg, #2a7cff, #ff4fb3); }
.name { font-size: 16px; font-weight: 700; letter-spacing: .02em; text-shadow: 0 0 8px rgba(0,224,255,.2); }
.hint { color: var(--muted); font-size: 12px; }
.card-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 18px; }
.play-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; color: #ffffff; font-weight: 700; letter-spacing: .02em; font-size: 13px; background: linear-gradient(135deg, var(--neon-1), var(--neon-2)); box-shadow: 0 8px 20px rgba(0,224,255,.3), 0 6px 18px rgba(255,0,170,.25); transition: transform .15s ease, box-shadow .2s ease; text-decoration: none; }
.play-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,224,255,.35), 0 10px 24px rgba(255,0,170,.3); text-decoration: none; }
footer { position: relative; z-index: 2; text-align: center; color: var(--muted); padding: 10px 20px 24px; }
@media (max-width: 480px) { .badge { width: 38px; height: 38px; } .name { font-size: 16px; } .card-info { padding: 12px 14px; } }
.auth-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; visibility: hidden; opacity: 0; transition: visibility 0s, opacity 0.3s ease; }
.auth-modal-overlay.active { visibility: visible; opacity: 1; }
.auth-modal { background: linear-gradient(180deg, #0f1526, #0a0f1d); border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04); width: 100%; max-width: 400px; max-height: 90vh; overflow-y: auto; transform: scale(0.9); transition: transform 0.3s ease; }
.auth-modal-overlay.active .auth-modal { transform: scale(1); }
.auth-modal-header { padding: 20px 24px 16px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.08); }
.auth-modal-title { font-size: 24px; font-weight: 700; background: linear-gradient(135deg, var(--neon-1), var(--neon-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 8px; }
.auth-modal-subtitle { color: var(--muted); font-size: 14px; }
.auth-tabs { display: flex; padding: 16px 24px 0; }
.auth-tab { flex: 1; padding: 10px 0; text-align: center; font-weight: 600; color: var(--muted); cursor: pointer; position: relative; transition: color 0.2s ease; }
.auth-tab.active { color: var(--text); }
.auth-tab.active::after { content: ''; position: absolute; bottom: 0; left: 10%; right: 10%; height: 3px; background: linear-gradient(135deg, var(--neon-1), var(--neon-2)); border-radius: 3px; }
.auth-form-container { padding: 20px 24px 24px; }
.auth-form { display: none; }
.auth-form.active { display: block; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; color: var(--text); font-weight: 600; font-size: 14px; }
.form-input { width: 100%; height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: var(--text); font-size: 16px; transition: border-color 0.2s ease, background-color 0.2s ease; }
.form-input:focus { outline: none; border-color: var(--neon-1); background: rgba(255,255,255,0.06); box-shadow: 0 0 0 3px rgba(0,224,255,0.1); }
.form-input::placeholder { color: var(--muted); }
.form-error { color: #ff4444; font-size: 12px; margin-top: 4px; min-height: 16px; }
.auth-btn { width: 100%; height: 48px; border-radius: 12px; border: none; font-size: 16px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--neon-1), var(--neon-2)); box-shadow: 0 8px 20px rgba(0,224,255,0.3), 0 6px 18px rgba(255,0,170,0.25); cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease; margin-top: 8px; }
.auth-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,224,255,0.35), 0 10px 24px rgba(255,0,170,0.3); }
.auth-btn:active:not(:disabled) { transform: translateY(0); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.close-btn { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,0.1); color: var(--text); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s ease; }
.close-btn:hover { background: rgba(255,255,255,0.15); }
.user-info { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,0.06); cursor: pointer; }

/* 个人信息页面的用户显示区域样式 */
.profile-user-info {
  margin-bottom: 16px;
  justify-content: center;
}
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--neon-1), var(--neon-2)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; }
.user-name { color: var(--text); font-weight: 600; font-size: 14px; }
.logout-btn { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: color 0.2s ease, background-color 0.2s ease; }
.logout-btn:hover { color: #ff4444; background: rgba(255,68,68,0.1); }
.view { display: none; }

/* 搜索框样式 */
.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto 20px;
  padding: 0 20px;
  z-index: 2;
}

#game-search {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 16px;
  transition: all 0.2s ease;
  /* 确保有足够的触摸区域 */
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  /* 提升移动端输入体验 */
  -webkit-appearance: none;
  appearance: none;
}

/* 移动设备响应式调整 */
@media (max-width: 768px) {
  .search-container {
    padding: 0 16px;
    margin-bottom: 16px;
  }
  
  #game-search {
    font-size: 16px; /* 防止iOS缩放 */
    padding: 14px 40px 14px 16px; /* 增加内边距，提高触摸体验 */
    border-radius: 28px;
  }
}

#game-search:focus {
  outline: none;
  border-color: var(--neon-1);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(0,224,255,0.1);
}

#game-search::placeholder {
  color: var(--muted);
}

.search-icon {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 16px;
}
.view.active { display: block; }
body.game-active header { display: none; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-around; gap: 10px; flex-wrap: nowrap; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0) 35%), #0a0f1d; border-top: 1px solid rgba(255,255,255,.12); box-shadow: 0 -8px 24px rgba(0,0,0,.4); z-index: 10; backdrop-filter: blur(10px); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 8px 12px; padding-bottom: env(safe-area-inset-bottom); }
.nav-item { flex: 1; max-width: 240px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; cursor: pointer; user-select: none; color: var(--text); font-weight: 700; background: linear-gradient(135deg, rgba(0,224,255,.08), rgba(255,0,170,.08)); border: 1px solid rgba(255,255,255,.12); transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease; }
.nav-item:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.35); }
.nav-item:active { transform: translateY(0); box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.nav-item.active { background: linear-gradient(135deg, var(--neon-1), var(--neon-2)); color: #fff; box-shadow: 0 12px 26px rgba(0,224,255,.3), 0 10px 24px rgba(255,0,170,.25); border-color: transparent; }
.chat-wrap { position: relative; z-index: 2; padding: 16px 16px 60px; max-width: 1000px; margin: 0 auto; min-height: calc(var(--vvh, 100dvh) - var(--nav-h) - 24px); display: flex; }
.chat-card { border-radius: 16px; background: linear-gradient(180deg, #0f1526, #0a0f1d); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04); overflow: hidden; display: flex; flex-direction: column; flex: 1 1 auto; height: calc(100vh - var(--nav-h) - 152px); }
.chat-header { padding: 14px 16px; font-weight: 700; letter-spacing: .02em; background: linear-gradient(135deg, rgba(0,224,255,.12), rgba(255,0,170,.12)); border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.messages { flex: 1 1 auto; height: calc(100vh - var(--nav-h) - 360px); overflow-y: auto; overflow-x: hidden; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.messages::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 3px; }
.messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 3px; }
.messages::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.5); }
.msg { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); animation: slideInUp 0.3s ease-out; }
@keyframes slideInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg .content { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.chat-input { display: grid; grid-template-columns: 160px 1fr auto; gap: 10px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.chat-input input { height: 44px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: var(--text); padding: 8px 10px; font-size: 16px; transition: all 0.2s ease; }
.chat-input input:focus { border-color: var(--neon-1); box-shadow: 0 0 0 2px rgba(0,224,255,0.2); background: rgba(255,255,255,0.06); }
.chat-input button { height: 44px; border-radius: 10px; border: 0; padding: 0 16px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--neon-1), var(--neon-2)); box-shadow: 0 8px 20px rgba(0,224,255,.3), 0 6px 18px rgba(255,0,170,.25); cursor: pointer; touch-action: manipulation; transition: all 0.2s ease; }
.chat-input button:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(0,224,255,.4), 0 8px 20px rgba(255,0,170,.3); }
.chat-input button:active { transform: translateY(0); }
.chat-hint { padding: 8px 16px; color: var(--muted); font-size: 12px; border-top: 1px solid rgba(255,255,255,.08); }

@media (max-width: 600px) { .chat-input { grid-template-columns: 120px 1fr auto; } }
@media (max-width: 440px) { .chat-input { grid-template-columns: 1fr auto; grid-template-rows: auto auto; } #chat-username { grid-column: 1 / span 2; } }
#profile-view { padding: 20px; overflow-y: auto; height: calc(100vh - var(--nav-h) - 20px); }
.edit-profile-btn { margin-top: 10px; padding: 6px 16px; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; background: rgba(255,255,255,.06); color: var(--text); font-size: 14px; cursor: pointer; transition: all 0.3s ease; }
.edit-profile-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }
.profile-header { display: flex; align-items: center; padding: 20px; background: rgba(255,255,255,0.05); border-radius: 16px; margin-bottom: 24px; }
.profile-info { flex: 1; }

/* 游戏历史记录样式 */
.history-section {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.history-title {
  margin: 0;
  font-size: 18px;
  color: var(--text);
  font-weight: 600;
}

.clear-history-btn {
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-history-btn:hover {
  color: #ff4d4f;
  border-color: rgba(255,77,79,0.3);
  background: rgba(255,77,79,0.1);
}

.history-container {
  min-height: 100px;
}

.empty-history {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* 历史记录项样式优化 */
.history-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  transition: all 0.2s ease;
  gap: 12px;
}

.history-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  transform: translateX(4px);
}

.history-game-info {
  flex: 1;
  min-width: 0;
}

/* 游戏预览图样式 */
.history-game-preview {
  width: 60px;
  height: 60px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  background-color: rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.history-game-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-game-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.history-game-category {
  background: rgba(0,224,255,0.1);
  color: var(--neon-1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}

.history-play-btn {
  padding: 8px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  border: none;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.history-play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,224,255,0.3);
}

/* 响应式调整 */
@media (max-width: 480px) {
  .history-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .clear-history-btn {
    align-self: flex-end;
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .history-item {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 16px;
  }
  
  .history-game-preview {
    width: 70px;
    height: 70px;
  }
  
  .history-game-info {
    flex: 1;
  }
  
  .history-game-name {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 6px;
  }
  
  .history-game-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .history-play-btn {
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* 个人信息右侧登录注册按钮样式 */
.profile-auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 16px;
}

.profile-auth-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 80px;
}

.profile-auth-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.profile-auth-btn:active {
  transform: translateY(0);
}

.user-avatar-large {
  width: 80px; height: 80px; border-radius: 50%; 
  background: linear-gradient(135deg, #4b80ff, #6c8cff); 
  display: flex; align-items: center; justify-content: center; 
  font-size: 28px; font-weight: 700; margin-right: 20px; color: white; 
}
.profile-name { font-size: 24px; font-weight: 600; margin: 0 0 8px 0; color: white; }
.profile-stats { font-size: 16px; color: rgba(255,255,255,0.7); margin: 0; }
.profile-menu { display: flex; background: rgba(255,255,255,0.05); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.menu-item { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; }
.menu-item:hover { background-color: rgba(255,255,255,0.05); }
.menu-item.active { background-color: rgba(75,128,255,0.2); }
.menu-icon { font-size: 18px; margin-right: 8px; }
.menu-text { color: white; font-size: 16px; }
.profile-content { min-height: 200px; }
.clear-cache-btn {
  margin-top: 20px;
  padding: 10px 20px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  text-align: center;
}
.clear-cache-btn:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.3);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.history-actions .text-btn:hover { background-color: rgba(75,128,255,0.1); }
.history-list { display: flex; flex-direction: column; gap: 12px; }
  
  .empty-state { text-align: center; padding: 40px 20px; color: #999; font-size: 14px; }
.history-item { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 16px; transition: transform 0.2s, box-shadow 0.2s; display: flex; align-items: center; }
.history-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); background: rgba(255,255,255,0.08); }
.history-item .game-preview { width: 60px; height: 60px; background-size: cover; background-position: center; border-radius: 8px; margin-right: 16px; background-color: rgba(255,255,255,0.1); flex-shrink: 0; }
.history-item .game-info { flex: 1; }
.history-item .game-title { font-size: 16px; font-weight: 500; margin-bottom: 4px; color: white; }

/* 动态星空背景 */
.stars {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.25) 0, transparent 50%),
    radial-gradient(1.5px 1.5px at 70% 80%, rgba(255,255,255,.12) 0, transparent 50%),
    radial-gradient(1.8px 1.8px at 40% 60%, rgba(255,255,255,.18) 0, transparent 50%),
    radial-gradient(2px 2px at 85% 25%, rgba(255,255,255,.2) 0, transparent 50%);
  animation: twinkle 8s linear infinite;
}
@keyframes twinkle {
  0% { transform: translateY(0); opacity: .9; }
  50% { transform: translateY(-10px); opacity: .7; }
  100% { transform: translateY(0); opacity: .9; }
}

/* 游戏网格布局样式 */
.grid {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px; padding: 20px; max-width: 1200px; margin: 0 auto 32px;
}

/* 增强的游戏卡片样式 */
.card {
  --glow: rgba(0,224,255,.55);
  --glow-2: rgba(255,0,170,.45);
  position: relative;
  display: flex; flex-direction: column;
  border-radius: 16px; color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0) 60%),
    radial-gradient(120% 100% at 0% 0%, rgba(0,224,255,.08), transparent 60%),
    radial-gradient(120% 100% at 100% 100%, rgba(255,0,170,.08), transparent 60%),
    linear-gradient(180deg, #0f1526, #0a0f1d);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card::before {
  content: "";
  position: absolute; inset: -1px; border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, var(--neon-1), transparent 30%),
              linear-gradient(315deg, var(--neon-2), transparent 30%),
              linear-gradient(90deg, transparent, rgba(255,255,255,.06));
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  opacity: .35; transition: opacity .25s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.15);
  box-shadow: 0 16px 36px rgba(0,0,0,.5), 0 0 24px var(--glow-2);
}
.card:hover::before { opacity: .65; }

/* 卡片预览区域 */
.card-preview {
  position: relative;
  height: 50%; min-height: 140px;
  background-image: linear-gradient(135deg, rgba(0,224,255,.12), rgba(255,0,170,.12));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 热门和新游戏标签样式 */
.hot-tag, .new-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 10;
  transform: rotate(-5deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hot-tag {
  background: linear-gradient(135deg, #ff4d4f, #ff7a45);
  color: white;
}

.new-tag {
  background: linear-gradient(135deg, #2ed573, #1e90ff);
  color: white;
}

/* 下拉刷新样式 */
.pull-refresh {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  z-index: 100;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.pull-refresh.show { transform: translateY(0); }
.pr-icon {
  width: 20px;
  height: 20px;
  border: 2px solid var(--neon-1);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.pr-icon.spin { animation: spin 1s linear infinite; }

/* 分类栏样式 */
.category-bar {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.category-bar::-webkit-scrollbar {
  display: none;
}
.cat-btn {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.cat-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}
.cat-btn.active {
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0,224,255,0.3);
}

/* Header样式 */
header {
  position: relative; z-index: 2;
  padding: 32px 20px 12px;
  text-align: center;
}
.title {
  margin: 0;
  font-size: clamp(24px, 5vw, 48px);
  letter-spacing: .03em;
  text-shadow: 0 0 10px rgba(0,224,255,.25), 0 0 25px rgba(255,0,170,.2);
}
.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(12px, 2.2vw, 16px);
}

/* Footer样式 */
footer {
  position: relative; z-index: 2; text-align: center; color: var(--muted); padding: 10px 20px 24px;
}

/* 用户信息样式 */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 管理功能按钮样式 */
.management-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.management-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.management-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.management-btn:hover::before {
  left: 100%;
}

.management-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 16px rgba(0, 224, 255, 0.2);
}

.management-btn .btn-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.management-btn .btn-text {
  font-weight: 500;
  letter-spacing: 0.02em;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
}
.user-name {
  font-size: 14px;
  color: var(--text);
}
.auth-btn {
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,224,255,0.3);
}

/* 增强的游戏卡片内容样式 */
.card-content {
  padding: 16px;
  flex: 1;
}
.card-title {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
  text-shadow: 0 0 8px rgba(0,224,255,.2);
  color: var(--text);
}
.card-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 12px 0;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 徽章样式 */
.badge {
  width: 44px; height: 44px; flex: none;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; letter-spacing: .02em; color: #051018;
  font-size: clamp(14px, 2.6vw, 18px);
  background: linear-gradient(135deg, #6bdcff, #f8a6ff);
  filter: saturate(120%) brightness(110%);
  box-shadow: inset 0 0 24px rgba(255,255,255,.25), 0 4px 12px rgba(0,0,0,.35);
}
.badge-01 { background: linear-gradient(135deg, #00e0ff, #7a00ff); }
.badge-02 { background: linear-gradient(135deg, #ff8a00, #ff0040); }
.badge-03 { background: linear-gradient(135deg, #8dff1a, #00c897); }
.badge-04 { background: linear-gradient(135deg, #ffd400, #ff2aa1); }
.badge-05 { background: linear-gradient(135deg, #2a7cff, #ff4fb3); }

/* 增强的播放按钮样式 */
.play-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px;
  color: #ffffff; font-weight: 700; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  box-shadow: 0 8px 20px rgba(0,224,255,.3), 0 6px 18px rgba(255,0,170,.25);
  transition: transform .15s ease, box-shadow .2s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,224,255,.35), 0 10px 24px rgba(255,0,170,.3);
  text-decoration: none;
  opacity: 0.9;
}
.play-btn:active {
  opacity: 0.8;
}

/* 增强的认证模态框样式 */
.auth-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.auth-modal {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 32px 64px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08) inset;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.auth-modal-overlay.active .auth-modal {
  transform: scale(1);
}
.auth-modal-header {
  padding: 20px 24px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-modal-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.auth-modal-subtitle {
  color: var(--muted);
  font-size: 14px;
}
.auth-tabs {
  display: flex;
  padding: 16px 24px 0;
}
.auth-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}
.auth-tab.active {
  color: var(--text);
}
.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  border-radius: 3px;
}
.auth-form-container {
  padding: 20px 24px 24px;
}
.auth-form {
  display: none;
}
.auth-form.active {
  display: block;
}
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}
.form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 16px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--neon-1);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.1);
}
.form-input::placeholder {
  color: var(--muted);
}
.form-error {
  color: #ff4444;
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

/* 增强的底部导航栏样式 */
.bottom-nav {
  position: fixed; 
  left: 0; 
  right: 0; 
  bottom: 0;
  display: flex; 
  align-items: center; 
  justify-content: space-around; 
  gap: 10px; 
  flex-wrap: nowrap;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0) 35%), #0a0f1d;
  border-top: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 -8px 24px rgba(0,0,0,.4);
  z-index: 10;
  backdrop-filter: blur(10px);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 8px 12px;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; 
  max-width: 240px; 
  height: 44px;
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px;
  border-radius: 14px; 
  cursor: pointer; 
  user-select: none;
  color: var(--text); 
  font-weight: 700;
  background: linear-gradient(135deg, rgba(0,224,255,.08), rgba(255,0,170,.08));
  border: 1px solid rgba(255,255,255,.12);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
}
.nav-item:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 10px 22px rgba(0,0,0,.35); 
}
.nav-item:active { 
  transform: translateY(0); 
  box-shadow: 0 6px 16px rgba(0,0,0,.3); 
}
.nav-item.active { 
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2)); 
  color: #fff; 
  box-shadow: 0 12px 26px rgba(0,224,255,.3), 0 10px 24px rgba(255,0,170,.25); 
  border-color: transparent; 
}

/* 增强的聊天室样式 */
.chat-wrap { 
  position: relative; 
  z-index: 2; 
  padding: 16px; 
  max-width: 1000px; 
  margin: 0 auto; 
  min-height: calc(var(--vvh, 100dvh) - var(--nav-h) - 24px); 
  display: flex; 
}
.chat-card {
  border-radius: 16px; 
  background: linear-gradient(180deg, #0f1526, #0a0f1d);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04);
  overflow: hidden;
  display: flex; 
  flex-direction: column; 
  flex: 1 1 auto; 
  min-height: inherit;
}
.chat-header { 
  padding: 14px 16px; 
  font-weight: 700; 
  letter-spacing: .02em; 
  background: linear-gradient(135deg, rgba(0,224,255,.12), rgba(255,0,170,.12)); 
  border-bottom: 1px solid rgba(255,255,255,.08); 
}
.messages { 
  flex: 1 1 auto; 
  min-height: 120px; 
  overflow: auto; 
  padding: 12px 16px; 
  display: flex; 
  flex-direction: column; 
  gap: 10px; 
}
.msg { 
  padding: 10px 12px; 
  border-radius: 12px; 
  background: rgba(255,255,255,.04); 
  border: 1px solid rgba(255,255,255,.08); 
}
.msg .meta { 
  font-size: 12px; 
  color: var(--muted); 
  margin-bottom: 4px; 
}
.msg .content { 
  font-size: 14px; 
  white-space: pre-wrap; 
  word-break: break-word; 
}
.chat-input { 
  display: grid; 
  grid-template-columns: 160px 1fr auto; 
  gap: 10px; 
  padding: 12px 16px; 
  border-top: 1px solid rgba(255,255,255,.08); 
  flex: none; 
  padding-bottom: calc(12px + env(safe-area-inset-bottom)); 
}
.chat-input input { 
  height: 44px; 
  border-radius: 10px; 
  border: 1px solid rgba(255,255,255,.12); 
  background: rgba(255,255,255,.04); 
  color: var(--text); 
  padding: 8px 10px; 
  font-size: 16px; 
}
.chat-input button { 
  height: 44px; 
  border-radius: 10px; 
  border: 0; 
  padding: 0 16px; 
  font-weight: 700; 
  color: #fff; 
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2)); 
  box-shadow: 0 8px 20px rgba(0,224,255,.3), 0 6px 18px rgba(255,0,170,.25); 
  cursor: pointer; 
  touch-action: manipulation; 
}
.chat-hint { 
  padding: 8px 16px 16px; 
  color: var(--muted); 
  font-size: 12px; 
}

/* 个人中心页面增强样式 */
#profile-view {
  padding: 20px;
  overflow-y: auto;
  height: calc(100vh - var(--nav-h) - 20px);
}
.edit-profile-btn {
  margin-top: 10px;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.edit-profile-btn:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.3);
}
.profile-header {
  display: flex;
  align-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  margin-bottom: 24px;
}
.user-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4b80ff, #6c8cff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-right: 20px;
  color: white;
}
.profile-info {
  flex: 1;
}
.profile-name {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: white;
}
.profile-stats {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}
.profile-menu {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}
.menu-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.menu-item.active {
  background-color: rgba(75, 128, 255, 0.2);
}
.menu-icon {
  font-size: 18px;
  margin-right: 8px;
}
.menu-text {
  color: white;
  font-size: 16px;
}
.profile-content {
  min-height: 200px;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* 增强的历史记录列表样式 */
.history-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.history-actions .text-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.2s;
}
.history-actions .text-btn:hover {
  background-color: rgba(75, 128, 255, 0.1);
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
}
.history-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.08);
}
.history-item .game-preview {
  width: 60px;
  height: 60px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  margin-right: 16px;
  background-color: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.history-item .game-info {
  flex: 1;
}
.history-item .game-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
  color: white;
}
.history-item .game-time {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}
.history-item .continue-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #4b80ff, #6c8cff);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.history-item .continue-btn:hover {
  background: linear-gradient(135deg, #3a6cdd, #5b7ae0);
}

/* 响应式设计优化 */
@media (max-width: 600px) {
  .chat-input { grid-template-columns: 120px 1fr auto; }
}
@media (max-width: 440px) {
  .chat-input { 
    grid-template-columns: 1fr auto; 
    grid-template-rows: auto auto; 
  }
  #chat-username { grid-column: 1 / span 2; }
}

/* 视图切换样式 */
.view { 
  display: none; 
}
.view.active { 
  display: block; 
}

/* 进入游戏时隐藏header */
body.game-active header { 
  display: none; 
}

/* 游戏历史头部样式 */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.history-header h2, .history-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}
.text-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.text-btn:hover {
  color: var(--neon-1);
  background-color: rgba(0,224,255,0.1);
}
.history-item .game-time { font-size: 14px; color: rgba(255,255,255,0.7); }
.history-item .continue-btn { padding: 8px 16px; background: linear-gradient(135deg, #4b80ff, #6c8cff); border: none; border-radius: 6px; color: white; font-size: 14px; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.history-item .continue-btn:hover { background: linear-gradient(135deg, #3a6cdd, #5b7ae0); }
#profile-history-grid, #history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 16px; min-height: 200px; }
#profile-history-grid .card, #history-grid .card { --glow: rgba(0,224,255,.55); --glow-2: rgba(255,0,170,.45); position: relative; display: flex; flex-direction: column; border-radius: 16px; color: var(--text); background: var(--bg-1); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04); overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
#profile-history-grid .card::before, #history-grid .card::before { content: ""; position: absolute; inset: -1px; border-radius: 16px; padding: 1px; background: linear-gradient(135deg, var(--neon-1), transparent 30%), linear-gradient(315deg, var(--neon-2), transparent 30%), linear-gradient(90deg, transparent, rgba(255,255,255,.06)); -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000); mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; opacity: .35; transition: opacity .25s ease; }
#profile-history-grid .card:hover, #history-grid .card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.15); box-shadow: 0 16px 36px rgba(0,0,0,.5), 0 0 24px var(--glow-2); }
#profile-history-grid .card:hover::before, #history-grid .card:hover::before { opacity: .65; }
#profile-history-grid .card-preview, #history-grid .card-preview { height: 160px; background-size: cover; background-position: center; }
#profile-history-grid .card-content, #history-grid .card-content { padding: 16px; }
#profile-history-grid .card-title, #history-grid .card-title { margin: 0 0 8px 0; font-size: 18px; font-weight: 600; color: var(--text); }
#profile-history-grid .card-hint, #history-grid .card-hint { margin: 0 0 12px 0; font-size: 14px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2; overflow: hidden; }
#profile-history-grid .card-footer, #history-grid .card-footer { display: flex; justify-content: space-between; align-items: center; }
#profile-history-grid .card-time, #history-grid .card-time { font-size: 12px; color: rgba(138,160,198,0.7); }
#profile-history-grid .play-btn, #history-grid .play-btn { padding: 6px 16px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; border-radius: 20px; font-size: 14px; cursor: pointer; transition: opacity 0.2s ease; }

/* 第二块样式 */
#home-view { overscroll-behavior-y: contain; }
.pull-refresh { position: fixed; top: 0; left: 0; right: 0; height: 0; display: flex; align-items: center; justify-content: center; gap: 8px; z-index: 20; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)); color: var(--text); overflow: hidden; backdrop-filter: blur(6px); }
.pull-refresh .pr-icon { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: transparent; }
.pull-refresh .pr-icon.spin { animation: prspin .8s linear infinite; }
@keyframes prspin { to { transform: rotate(360deg); } }
#home-view .history-actions { display:flex; justify-content:flex-end; padding: 0 16px; }
#home-view .history-actions .text-btn { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: 14px; padding: 10px 0; }
.text-btn:hover { color: var(--text); }
.nav-item::before { content: ""; display:inline-block; margin-right:6px; font-size: 16px; }
.nav-item[data-view="home"]::before { content: "🏠"; }
.nav-item[data-view="chat"]::before { content: "💬"; }
.nav-item[data-view="profile"]::before { content: "👤"; }
#nav-refresh::before { content: "↻"; }
.tag { display:inline-block; padding:2px 8px; border-radius:12px; background: rgba(255,255,255,0.08); color:#ddd; font-size:12px; border:1px solid rgba(255,255,255,0.12); }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton .card { pointer-events:none; }
.skeleton .card-preview { background: linear-gradient(90deg, rgba(255,255,255,0.06) 0, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton .name, .skeleton .hint { background: linear-gradient(90deg, rgba(255,255,255,0.06) 0, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 100%); color: transparent; border-radius: 6px; min-height: 14px; }

/* 第三块样式 */
.category-bar { display:flex; gap:8px; flex-wrap:wrap; margin: 12px 16px; overflow-x:auto; -webkit-overflow-scrolling: touch; }
.category-bar .cat-btn { padding:6px 10px; border-radius: 16px; background: rgba(255,255,255,0.08); color:#ddd; font-size: 14px; cursor:pointer; border: 1px solid rgba(255,255,255,0.12); }
.category-bar .cat-btn.active { background: #4cd2b5; color: #000; border-color: #4cd2b5; }
#home-view .grid .card.hidden { display: none !important; }
@media (max-width: 600px) { .category-bar { margin: 8px 12px; } .category-bar .cat-btn { font-size: 13px; } }

/* 游戏界面样式 - 参照旧版本完全照搬 */

/* 游戏容器样式 - 完全照搬旧版本样式 */
#game-view #game-container {
  display: flex;
  justify-content: center;
}

/* 游戏框架样式 - 完全照搬旧版本最大宽度420px */
#game-view #game-frame {
  max-width: 420px;
  height: calc(var(--vvh, 100dvh) - var(--nav-h) - env(safe-area-inset-bottom));
}

#game-view.active {
  min-height: calc(var(--vvh, 100dvh) - var(--nav-h) - env(safe-area-inset-bottom));
}

/* 底部导航栏始终显示，不再根据屏幕宽度隐藏 */
/* 注释掉之前的隐藏规则 */
/* @media screen and (orientation: landscape) and (min-width: 769px) {
  body.game-active .bottom-nav {
    transform: translateY(calc(100% + env(safe-area-inset-bottom)));
    transition: transform 0.3s ease;
  }
} */

/* 游戏加载状态样式 */
.game-loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--text);
}

.game-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top: 3px solid var(--neon-1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.game-loading-text {
  font-size: 16px;
  color: var(--muted);
}

/* 游戏控制栏样式 - 统一手机端样式 */
.game-controls {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 1000;
}

.game-control-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.game-control-btn:hover {
  background: rgba(0,0,0,0.8);
  border-color: var(--neon-1);
  box-shadow: 0 0 16px rgba(0,224,255,0.3);
}

/* 横屏时控制栏位置调整 */
@media screen and (orientation: landscape) {
  .game-controls {
    top: 10px;
    right: 10px;
  }
}

/* 竖屏时控制栏紧凑排列 */
@media screen and (orientation: portrait) {
  .game-controls {
    flex-direction: column;
    right: 5px;
  }
}

/* 游戏全屏状态样式 */
body.game-fullscreen {
  overflow: hidden;
}

body.game-fullscreen #game-view.active #game-frame {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0;
  z-index: 9999;
}

/* 游戏界面安全区域适配 */
@supports (padding: max(0px)) {
  #game-view.active {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  
  #game-view.active #game-container {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}

/* 竖屏游戏手机端优化样式 */
.mobile-optimized {
  /* 隐藏浏览器界面元素 */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;

  /* 优化视窗高度 */
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);

  /* 隐藏滚动条 */
  overflow: hidden;
}

.mobile-optimized #game-view.active {
  padding: 0 !important;
  margin: 0 !important;
  height: calc(var(--vh, 1vh) * 100 - var(--nav-h) - env(safe-area-inset-bottom));
  overflow: hidden;
}

.mobile-optimized #game-view.active #game-container {
  padding: 0 !important;
  margin: 0 !important;
  height: calc(var(--vh, 1vh) * 100 - var(--nav-h) - env(safe-area-inset-bottom));
  overflow: hidden;
}

.mobile-optimized #game-view.active #game-frame {
  width: 100vw !important;
  height: calc(var(--vh, 1vh) * 100 - var(--nav-h) - env(safe-area-inset-bottom)) !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
}

/* 底部导航栏始终显示，不再在移动设备上隐藏 */
/* 注释掉之前的隐藏规则 */
/* .mobile-optimized .bottom-nav {
  transform: translateY(calc(100% + env(safe-area-inset-bottom)));
  transition: transform 0.3s ease;
} */

/* 确保游戏控制按钮仍然可见 */
.mobile-optimized .game-controls {
  z-index: 10001;
  opacity: 0.8;
}

.mobile-optimized .game-controls:hover {
  opacity: 1;
}

/* 防止页面被意外缩放 */
.mobile-optimized * {
  touch-action: manipulation;
}

/* 安全区域适配 */
@supports (padding: max(0px)) {
  .mobile-optimized #game-view.active {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-top: max(0px, env(safe-area-inset-top));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* 注册冷却状态样式 */
.auth-btn.cooldown {
  background: linear-gradient(135deg, #666, #888);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 0.7;
  cursor: not-allowed;
  position: relative;
  overflow: hidden;
}

.auth-btn.cooldown:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.auth-btn.cooldown::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: cooldown-shimmer 2s infinite;
}

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

.auth-btn.cooldown-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cooldown-icon {
  font-size: 14px;
  animation: cooldown-pulse 1s infinite;
}

@keyframes cooldown-pulse {
  0% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.7; transform: scale(1); }
}

/* 移动端响应式调整 */
@media (max-width: 480px) {
  .auth-btn.cooldown-text {
    font-size: 14px;
  }
  
  .cooldown-icon {
    font-size: 12px;
  }
}


/* 在现有CSS文件中添加点击量 */

.game-stats {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
}

.click-count {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 10px;
}

/* 热门游戏样式增强
.hot-tag, .new-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 2;
}

.new-tag {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
}
 */
/* 卡片悬停效果 */
.card:hover .click-count {
  background: rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease;
}

/* 游戏视图强制全屏样式 */
#game-view {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #000 !important;
  z-index: 1000 !important;
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

#game-view.active {
  display: block !important;
}

#game-container {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  background: #000 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#game-frame {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  background: #000 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

/* 横竖屏游戏统一全屏 */
.landscape-game #game-frame,
.portrait-game #game-frame {
  width: 100% !important;
  height: 100% !important;
}

/* 游戏激活状态 */
body.game-active {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 底部导航栏在游戏中的样式 */
.game-active .bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  z-index: 1001;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  transform: translateY(0);
  transition: transform 0.3s ease;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.game-active .bottom-nav.hidden {
  transform: translateY(100%);
}

/* 显示/隐藏导航栏按钮 */
.toggle-nav-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  z-index: 1002;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toggle-nav-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* 全屏模式隐藏导航元素 */
.game-fullscreen .bottom-nav,
.game-fullscreen .toggle-nav-btn {
  display: none !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .game-active .bottom-nav {
    padding: 10px 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  
  .toggle-nav-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
    bottom: 70px;
    right: 15px;
  }
}

/* 游戏加载状态 */
#game-frame.loading {
  opacity: 0;
}

#game-frame.loaded {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* 历史记录项样式优化 */
.history-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

/* 历史记录操作区域 */
.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* 删除按钮样式 */
.history-delete-btn {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  color: #ff4444;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.history-delete-btn:hover {
  background: rgba(255, 68, 68, 0.2);
  border-color: rgba(255, 68, 68, 0.5);
  transform: scale(1.1);
}

.history-delete-btn:active {
  transform: scale(0.95);
}

/* 再次游玩按钮样式 */
.history-play-btn {
  background: rgba(0, 224, 255, 0.1);
  border: 1px solid rgba(0, 224, 255, 0.3);
  color: #00e0ff;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  white-space: nowrap;
}

.history-play-btn:hover {
  background: rgba(0, 224, 255, 0.2);
  border-color: rgba(0, 224, 255, 0.5);
  transform: translateY(-1px);
}

/* 游戏信息区域调整 */
.history-game-info {
  flex: 1;
  margin: 0 12px;
  min-width: 0; /* 防止文本溢出 */
}

.history-game-name {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
  color: white;
}

.history-game-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.history-game-category {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 预览图样式 */
.history-game-preview {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .history-item {
    padding: 10px;
  }
  
  .history-actions {
    gap: 6px;
  }
  
  .history-delete-btn {
    width: 32px;
    height: 32px;
  }
  
  .history-play-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
  
  .history-game-preview {
    width: 50px;
    height: 50px;
  }
  
  .history-game-info {
    margin: 0 8px;
  }
}

/* 空状态样式 */
.empty-history {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.empty-history p {
  margin: 0;
  font-size: 16px;
}

/* 密码修改相关样式 */
.footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.footer-buttons {
  display: flex;
  gap: 10px;
}

/* 密码强度指示器 */
.password-strength {
  margin-top: 15px;
}

.strength-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.strength-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

/* 模态框样式优化 */
.modal-content {
  background: rgba(30, 30, 40, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 400px;
  width: 90%;
}

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

.modal-header h3 {
  margin: 0;
  color: white;
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: white;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 表单组样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: white;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #00e0ff;
  background: rgba(255, 255, 255, 0.15);
}

.error-message {
  color: #ff4444;
  font-size: 12px;
  margin-top: 5px;
  min-height: 18px;
}

/* 按钮样式 */
.btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #00e0ff, #0077ff);
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 224, 255, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}



/* 修复图片懒加载样式 */
.card-preview.lazy-loading {
  position: relative;
  background-color: #f8f9fa !important;
  background-image: 
    linear-gradient(135deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%),
    linear-gradient(135deg, rgba(0,224,255,.12), rgba(255,0,170,.12)) !important;
  background-size: 20px 20px, cover !important;
  animation: shimmer 1.5s infinite linear;
}

.card-preview.loaded {
  background-size: cover, cover !important;
  transition: all 0.5s ease;
}

/* 确保加载器正确显示 */
.image-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(248, 249, 250, 0.95);
  transition: opacity 0.3s ease;
  z-index: 2;
  border-radius: 8px;
}

/* 修复加载器动画 */
.loader-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e0e0e0;
  border-top: 3px solid var(--neon-1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 8px;
}

.loader-text {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

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

@keyframes shimmer {
  0% {
    background-position: -40px 0, center;
  }
  100% {
    background-position: 40px 0, center;
  }
}

/* 确保默认图片显示正确 */
.card-preview:not([data-bg]) {
  background-image: url('moren.png'), linear-gradient(135deg, rgba(0,224,255,.12), rgba(255,0,170,.12)) !important;
}

/* 修复卡片预览图的基础样式 */
.card-preview {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* 骨架屏动画 */
.skeleton-card {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-preview {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
  background-size: 200% 100% !important;
  animation: skeleton-shimmer 2s infinite;
}

.skeleton-text, .skeleton-text-small, .skeleton-btn {
  background: #f0f0f0 !important;
  color: transparent !important;
  position: relative;
  overflow: hidden;
}

.skeleton-text::after, .skeleton-text-small::after, .skeleton-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: skeleton-shine 1.5s infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

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

@keyframes skeleton-shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* 加载更多容器 - 放在页面底部 */
.load-more-container {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 加载更多按钮样式 */
.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  border: none;
  border-radius: 25px;
  color: white;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 224, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.load-more-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.load-more-btn:hover:not(:disabled)::before {
  left: 100%;
}

.load-more-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 224, 255, 0.4);
}

.load-more-btn:active {
  transform: translateY(0);
}

.load-more-btn.loading {
  background: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.load-more-btn.loading .btn-text {
  opacity: 0.7;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-count {
  font-size: 14px;
  opacity: 0.8;
  font-weight: normal;
}

/* 自动加载提示 */
.auto-load-hint {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
  opacity: 0.7;
}

/* 加载结束消息 */
.load-end-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #888;
  padding: 20px;
}

.end-icon {
  font-size: 32px;
  opacity: 0.7;
}

.end-text {
  font-size: 14px;
  text-align: center;
}

/* 空状态样式优化 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-state div:first-child {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.empty-state p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .load-more-btn {
    padding: 10px 24px;
    font-size: 14px;
  }
  
  .btn-count {
    font-size: 12px;
  }
  
  .load-more-container {
    padding: 30px 15px;
  }
  
  .auto-load-hint {
    font-size: 11px;
  }
}

/* 卡片悬停效果优化 */
.card:hover .card-preview {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

.card .card-preview {
  transition: transform 0.3s ease, background-image 0.5s ease;
}

/* 聊天室游戏绑定样式 */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(0,224,255,.1), rgba(255,0,170,.1));
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.current-game-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.game-tag {
  background: #4CAF50;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.game-name {
  color: #00e0ff;
  font-weight: 500;
}

.unbind-game-btn {
  background: rgba(255,255,255,.1);
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.unbind-game-btn:hover {
  background: rgba(255,255,255,.2);
}

.game-hint {
  color: rgba(255,255,255,.7);
  font-size: 12px;
}

/* 游戏消息样式 */
.msg.game-message {
  border-left: 3px solid #4CAF50;
  background: rgba(76, 175, 80, 0.05);
}

.game-meta {
  font-size: 11px;
  color: #4CAF50;
  margin-top: 2px;
  font-style: italic;
}

/* 游戏房间列表样式 */
.game-rooms-container {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  max-height: 120px;
  overflow-y: auto;
}

.game-rooms-title {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  margin-bottom: 8px;
}

.game-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  margin-bottom: 4px;
  background: rgba(255,255,255,.05);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.game-room-item:hover {
  background: rgba(255,255,255,.1);
}

.game-room-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-room-name {
  font-size: 13px;
  color: white;
}

.game-room-players {
  font-size: 11px;
  color: #00e0ff;
  background: rgba(0,224,255,.1);
  padding: 1px 6px;
  border-radius: 8px;
}

.no-rooms {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 8px;
}

/* 聊天室控制栏样式 */
.chat-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.chat-control-btn {
  background: rgba(255,255,255,.1);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.chat-control-btn:hover {
  background: rgba(255,255,255,.2);
}

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

.chat-stats {
  font-size: 12px;
  color: rgba(255,255,255,.7);
}

/* 登录提示样式 */
#chat-login-hint {
  color: #ff6b6b;
}

#chat-game-hint {
  color: #4CAF50;
}

/* 消息计数样式 */
.message-count {
  background: rgba(0,224,255,.2);
  color: #00e0ff;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 11px;
  margin-left: 8px;
}

/* 清屏确认弹窗 */
.clear-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.clear-confirm-content {
  background: #2a2a3a;
  padding: 20px;
  border-radius: 12px;
  max-width: 300px;
  width: 90%;
  text-align: center;
  border: 1px solid rgba(255,255,255,.1);
}

.clear-confirm-title {
  font-size: 16px;
  margin-bottom: 10px;
  color: white;
}

.clear-confirm-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.clear-confirm-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.clear-confirm-cancel {
  background: rgba(255,255,255,.1);
  color: white;
}

.clear-confirm-cancel:hover {
  background: rgba(255,255,255,.2);
}

.clear-confirm-ok {
  background: #ff4444;
  color: white;
}

.clear-confirm-ok:hover {
  background: #ff6666;
}

/* 清屏动画 */
@keyframes fadeInOut {
  0% { 
    opacity: 0; 
    transform: translate(-50%, -60%); 
  }
  20% { 
    opacity: 1; 
    transform: translate(-50%, -50%); 
  }
  80% { 
    opacity: 1; 
    transform: translate(-50%, -50%); 
  }
  100% { 
    opacity: 0; 
    transform: translate(-50%, -40%); 
  }
}

/* 消息进入动画 */
.msg {
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* 聊天室游戏房间导航条美化 */
.game-rooms-container {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  max-height: 200px;
  overflow-y: auto;
  background: rgba(255,255,255,.02);
}

.game-rooms-title {
  font-size: 14px;
  color: var(--neon-1);
  margin-bottom: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-rooms-title span {
  background: rgba(0,224,255,.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--neon-1);
}

/* 房间搜索框 */
.room-search-container {
  position: relative;
  margin-bottom: 12px;
}

.room-search-input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-size: 13px;
  transition: all 0.3s ease;
}

.room-search-input:focus {
  outline: none;
  border-color: var(--neon-1);
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 2px rgba(0,224,255,0.1);
}

.room-search-input::placeholder {
  color: rgba(255,255,255,.5);
}

.room-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.6);
  font-size: 14px;
}

/* 游戏房间列表美化 */
.game-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.game-room-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,224,255,.1), transparent);
  transition: left 0.5s ease;
}

.game-room-item:hover::before {
  left: 100%;
}

.game-room-item:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(0,224,255,.3);
  transform: translateX(4px);
}

.game-room-item.active {
  background: rgba(0,224,255,.15);
  border-color: var(--neon-1);
  box-shadow: 0 2px 8px rgba(0,224,255,.2);
}

.game-room-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.game-room-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  font-weight: bold;
  flex-shrink: 0;
}

.game-room-details {
  flex: 1;
  min-width: 0;
}

.game-room-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-room-path {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-room-players {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--neon-3);
  background: rgba(135,255,101,.1);
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.player-icon {
  font-size: 10px;
}

.no-rooms {
  text-align: center;
  padding: 20px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
}

.no-rooms .icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.7;
}

/* 房间列表滚动条美化 */
.game-rooms-container::-webkit-scrollbar {
  width: 4px;
}

.game-rooms-container::-webkit-scrollbar-track {
  background: rgba(255,255,255,.05);
  border-radius: 2px;
}

.game-rooms-container::-webkit-scrollbar-thumb {
  background: rgba(0,224,255,.3);
  border-radius: 2px;
}

.game-rooms-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0,224,255,.5);
}

/* 搜索无结果状态 */
.no-search-results {
  text-align: center;
  padding: 20px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
}

.no-search-results .icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.7;
}

/* 房间状态指示器 */
.room-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-3);
  animation: pulse 2s infinite;
}

.status-dot.hot {
  background: #ff4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}


/* 简约版滚动条美化 */
.history-container {
  min-height: 100px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--neon-1) rgba(255, 255, 255, 0.05);
}

.history-container::-webkit-scrollbar {
  width: 6px;
}

.history-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.history-container::-webkit-scrollbar-thumb {
  background: var(--neon-1);
  border-radius: 3px;
}

.history-container::-webkit-scrollbar-thumb:hover {
  background: var(--neon-2);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}


/* 个人中心滚动条美化 */
#profile-view::-webkit-scrollbar {
  width: 8px;
}

#profile-view::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

#profile-view::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  border-radius: 4px;
}

#profile-view::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #40a9ff, #ff2aa1);
}

