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

:root {
  --primary: #1a1a2e;
  --secondary: #16213e;
  --accent: #e94560;
  --text: #eaeaea;
  --card-bg: #0f3460;
  --success: #4ecca3;
  --warning: #ffc107;
}

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.hidden {
  display: none !important;
}

/* 登录/注册页面样式 */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: 
    radial-gradient(ellipse at top, #2a2a4e 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(233, 69, 96, 0.15) 0%, transparent 50%),
    linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.auth-box {
  background: rgba(15, 52, 96, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent), #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo p {
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(233, 69, 96, 0.2);
}

.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff6b6b);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(233, 69, 96, 0.4);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

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

.btn-success {
  background: linear-gradient(135deg, var(--success), #45b393);
  color: white;
}

.btn-success:hover {
  box-shadow: 0 10px 30px rgba(78, 204, 163, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #ffca28);
  color: #333;
}

.btn-warning:hover {
  box-shadow: 0 10px 30px rgba(255, 193, 7, 0.4);
}

.btn-vip {
  background: linear-gradient(135deg, #9c27b0, #ba68c8);
  color: white;
}

.btn-vip:hover {
  box-shadow: 0 10px 30px rgba(156, 39, 176, 0.4);
}

.access-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.access-badge.buyout {
  background: linear-gradient(135deg, #ffc107, #ffca28);
  color: #333;
}

.access-badge.vip {
  background: linear-gradient(135deg, #9c27b0, #ba68c8);
  color: white;
}

.access-badge.free {
  background: linear-gradient(135deg, #4ecca3, #45b393);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 10px 30px rgba(220, 53, 69, 0.4);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.6);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.message.error {
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid rgba(220, 53, 69, 0.5);
  color: #ff6b6b;
}

.message.success {
  background: rgba(78, 204, 163, 0.2);
  border: 1px solid rgba(78, 204, 163, 0.5);
  color: var(--success);
}

/* 导航栏样式 */
.navbar {
  background: rgba(15, 52, 96, 0.95);
  backdrop-filter: blur(10px);
  padding: 15px 30px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.navbar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
}

.diamond-icon {
  color: var(--warning);
  font-size: 1.2rem;
}

.diamond-count {
  font-weight: 700;
  color: var(--warning);
}

.nav-btn {
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-btn-profile {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.nav-btn-recharge {
  background: linear-gradient(135deg, var(--warning), #ffca28);
  color: #333;
}

.nav-btn-recharge:hover {
  box-shadow: 0 5px 20px rgba(255, 193, 7, 0.4);
}

.nav-btn-admin {
  background: linear-gradient(135deg, #9c27b0, #ba68c8);
  color: white;
}

.nav-btn-logout {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-btn-logout:hover {
  background: rgba(220, 53, 69, 0.3);
  border-color: rgba(220, 53, 69, 0.5);
}

/* 游戏列表样式 */
.games-section {
  padding: 30px 0;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 30px;
  background: linear-gradient(to bottom, var(--accent), #ff6b6b);
  border-radius: 2px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

@media (max-width: 1200px) {
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .navbar {
    padding: 12px 15px;
  }
  
  .navbar-user {
    width: 100%;
    justify-content: center;
  }
  
  .auth-box {
    padding: 30px 20px;
  }
}

.game-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(233, 69, 96, 0.3);
}

.game-poster {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  transition: transform 0.4s;
}

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

.game-poster-wrapper {
  overflow: hidden;
  position: relative;
}

.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
}

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

.view-details {
  background: var(--accent);
  color: white;
  padding: 10px 24px;
  border-radius: 25px;
  font-weight: 600;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.game-card:hover .view-details {
  transform: translateY(0);
}

.game-info {
  padding: 16px;
}

.game-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.game-likes {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
}

.game-price {
  font-weight: 700;
  color: var(--warning);
}

.game-price.free {
  color: var(--success);
}

/* 游戏详情模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideUp 0.4s;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
}

.modal-close:hover {
  background: var(--accent);
  transform: rotate(90deg);
}

/* 图片轮播 */
.game-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  height: 100%;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(5px);
}

.carousel-btn:hover {
  background: var(--accent);
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
  left: 15px;
}

.carousel-btn.next {
  right: 15px;
}

.carousel-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.carousel-dot.active {
  background: var(--accent);
  width: 30px;
  border-radius: 5px;
}

/* 游戏详情内容 */
.game-detail-content {
  padding: 30px;
}

.game-detail-header {
  display: flex;
  gap: 25px;
  margin-bottom: 25px;
}

@media (max-width: 768px) {
  .game-detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.game-detail-poster {
  width: 180px;
  height: 240px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-detail-info {
  flex: 1;
}

.game-detail-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.game-detail-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
}

.like-btn {
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(233, 69, 96, 0.1);
  border: 1px solid rgba(233, 69, 96, 0.3);
  transition: all 0.3s;
}

.like-btn:hover {
  background: rgba(233, 69, 96, 0.3);
  transform: scale(1.05);
}

.like-btn.liked {
  background: var(--accent);
  color: white;
}

.game-detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--warning);
  margin: 20px 0;
}

.game-detail-price.free {
  color: var(--success);
  font-size: 1.5rem;
}

.game-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.game-actions .btn {
  flex: 1;
  min-width: 150px;
}

.game-detail-desc {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.game-detail-desc h3 {
  margin-bottom: 15px;
  color: var(--accent);
}

.game-detail-desc p {
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
}

/* 个人信息页面 */
.profile-container {
  padding: 30px 0;
}

.profile-header {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff6b6b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
}

.profile-info h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.profile-info p {
  color: rgba(255, 255, 255, 0.6);
}

.profile-diamonds {
  margin-left: auto;
  text-align: center;
  padding: 20px 40px;
  background: rgba(255, 193, 7, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.profile-diamonds .count {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--warning);
}

.profile-diamonds label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.profile-section {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 25px;
}

.profile-section h3 {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}

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

.profile-game-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
}

.profile-game-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.1);
}

.profile-game-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.profile-game-card .info {
  padding: 12px;
}

.profile-game-card .name {
  font-weight: 600;
  margin-bottom: 5px;
}

.profile-game-card .price {
  color: var(--warning);
  font-size: 0.9rem;
}

.empty-list {
  text-align: center;
  padding: 40px;
  color: rgba(255, 255, 255, 0.4);
}

/* 充值页面 */
.recharge-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.recharge-box {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 100%;
  text-align: center;
}

.recharge-box h2 {
  margin-bottom: 30px;
  color: var(--accent);
}

.recharge-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.recharge-option {
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.recharge-option:hover {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.recharge-option.selected {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.2);
}

.recharge-option .diamonds {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--warning);
}

.recharge-option .amount {
  color: rgba(255, 255, 255, 0.6);
  margin-top: 5px;
}

.recharge-summary {
  margin: 25px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.recharge-summary .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.recharge-summary .total {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--warning);
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 管理后台 */
.admin-container {
  padding: 30px 0;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.admin-tab {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text);
  font-size: 1rem;
}

.admin-tab:hover {
  border-color: var(--accent);
}

.admin-tab.active {
  background: var(--accent);
  border-color: var(--accent);
}

.admin-panel {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 25px;
}

.admin-panel h3 {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table th {
  color: var(--accent);
  font-weight: 600;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

/* 表单样式 */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}

.form-row textarea {
  min-height: 100px;
  resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-form {
  padding: 25px;
  background: var(--secondary);
  border-radius: 0 0 20px 20px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #ff6b6b;
}

/* 加载动画 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--card-bg);
  padding: 15px 30px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--accent);
}
