:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) */
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-btn-color: #EA7C07;
  --dark-text-color: #000000;
  --header-top-bg: var(--primary-color);
  --main-nav-bg: #1a8cc7; /* A darker shade of primary for distinction */
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding-top: var(--header-offset); /* Important for fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll for body */
  line-height: 1.6;
  color: #333;
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Header Top */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--header-top-bg);
  color: var(--secondary-color);
  width: 100%;
}

.header-container {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

/* Logo */
.logo {
  color: var(--secondary-color);
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  display: block; /* Ensure logo is always visible */
  flex-shrink: 0;
  white-space: nowrap;
}

/* If logo is an image */
.logo img {
  display: block;
  max-height: 60px;
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn {
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  white-space: nowrap; /* Prevent buttons from wrapping on desktop */
  text-align: center;
  box-sizing: border-box;
  cursor: pointer;
  line-height: 1;
}

.btn-register {
  background-color: var(--login-btn-color); /* #EA7C07 */
  color: var(--secondary-color);
  border: 1px solid var(--login-btn-color);
}

.btn-register:hover {
  background-color: #d16e06;
  border-color: #d16e06;
}

.btn-login {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-login:hover {
  background-color: #e0f2ff;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background-color: var(--main-nav-bg);
  width: 100%;
}

.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop default: row */
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  gap: 15px; /* Spacing between nav links */
}

.nav-link {
  color: var(--secondary-color);
  text-decoration: none;
  padding: 8px 12px;
  font-weight: 500;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  font-size: 15px;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Hamburger Menu (desktop hidden) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1001;
  flex-shrink: 0;
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--secondary-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* Mobile Navigation Buttons (desktop hidden) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
}

/* Overlay for mobile menu */
.overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  cursor: pointer;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Footer */
.site-footer {
  background-color: #333333; /* Dark background for footer */
  color: #cccccc;
  padding: 40px 20px 20px;
  font-size: 14px;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto 30px;
}

.footer-col h3 {
  color: var(--secondary-color);
  font-size: 16px;
  margin-bottom: 15px;
  font-weight: bold;
}

.footer-col p {
  line-height: 1.6;
  margin-top: 10px;
}

.footer-col .footer-logo {
  color: var(--secondary-color);
  font-size: 22px;
  font-weight: bold;
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 8px;
}

.footer-nav a {
  color: #cccccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444444;
  color: #999999;
  margin-top: 30px;
}

.footer-bottom p {
  margin: 0;
}

/* --- Mobile Styles --- */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: 60px (header-top) + 48px (mobile-nav-buttons) */
  }

  /* Header Top */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0 15px;
    justify-content: space-between; /* Keep space-between for hamburger and logo */
    position: relative; /* For absolute positioning of logo if needed */
  }

  /* Logo for Mobile - Method 1: Flexbox + !important */
  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important; /* Center the logo */
    align-items: center !important;
    position: static !important; /* Reset any absolute positioning */
    transform: none !important; /* Reset any transform */
    padding: 0 10px; /* Add some padding to prevent logo from touching hamburger/buttons */
    max-width: calc(100% - 100px); /* Restrict logo width to prevent overlap with hamburger/buttons */
  }

  .logo img {
    max-height: 56px !important; /* Adjusted for mobile header height */
  }

  /* Hamburger Menu (mobile visible) */
  .hamburger-menu {
    display: flex;
    order: -1; /* Place it at the beginning */
  }

  /* Desktop Navigation Buttons (mobile hidden) */
  .desktop-nav-buttons {
    display: none;
  }

  /* Mobile Navigation Buttons (mobile visible, below header-top, above main-nav) */
  .mobile-nav-buttons {
    display: flex !important; /* Always visible */
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--main-nav-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Ensure two buttons fit with gap */
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation (mobile hidden by default, slides out) */
  .main-nav {
    display: none; /* Hidden by default for mobile */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 75%;
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--main-nav-bg);
    overflow-y: auto;
    transition: transform 0.3s ease;
    transform: translateX(-100%); /* Slide out of view initially */
    z-index: 1000; /* Ensure it's above content */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
  }

  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide into view */
  }

  .nav-container {
    flex-direction: column;
    padding: 20px 0;
    width: 100%;
    max-width: none; /* No max-width for mobile container */
    gap: 0; /* Remove gap for vertical links */
    align-items: flex-start; /* Align links to the left */
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  /* Footer */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    text-align: center;
  }

  .footer-col h3 {
    margin-top: 25px;
  }

  .footer-col .footer-logo {
    margin: 0 auto 15px;
  }

  .footer-nav {
    margin-bottom: 20px;
  }

  /* Mobile overflow prevention */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}

/* No scroll for body when menu is open */
body.no-scroll {
  overflow: hidden;
}

/* Payment Methods 图标容器样式 */
.payment-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 5px;
}

.payment-icons img,
.payment-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}

/* Game Providers 图标容器样式 */
.game-providers-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.game-providers-icons img,
.game-provider-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}

/* Social Media 图标容器样式 */
.social-media-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.social-media-icons img,
.social-media-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
