:root {
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}
@media (max-width: 768px) {
  :root {
    --header-offset: 100px; /* Mobile: header-top (60px) + mobile-nav-buttons (40px) */
  }
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #333333;
  background-color: #FFFFFF;
  padding-top: var(--header-offset); /* Apply header offset to body */
  overflow-x: hidden;
}

/* Global container for desktop */
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Header styles */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background-color: #FFFFFF; /* Fallback, specific colors for sections below */
}

.header-top {
  background-color: #003366; /* Dark blue */
  color: #FFFFFF;
  padding: 15px 0;
  display: flex;
  align-items: center;
  min-height: 60px; /* Ensure sufficient height */
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  padding-left: 0; /* Handled by container padding */
  padding-right: 0;
}

.desktop-nav-buttons {
  display: flex;
  gap: 10px;
  padding-right: 0; /* Handled by container padding */
}

.mobile-nav-buttons {
  display: none; /* Hidden by default on desktop */
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}

.btn-login {
  background-color: #EA7C07; /* Orange */
  color: #FFFFFF;
}

.btn-login:hover {
  background-color: #CC6A00;
}

.btn-register {
  background-color: #26A9E0; /* Primary blue */
  color: #FFFFFF;
}

.btn-register:hover {
  background-color: #1A8EC7;
}

.main-nav {
  background-color: #26A9E0; /* Primary light blue */
  padding: 10px 0;
  display: flex; /* Desktop default: visible, horizontal */
  justify-content: center;
  align-items: center;
  min-height: 50px; /* Ensure sufficient height */
}

.main-nav .nav-container {
  display: flex;
  flex-direction: row; /* Desktop default: horizontal */
  justify-content: center;
  align-items: center;
  gap: 25px;
}

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: #F0F0F0;
  text-decoration: underline;
}

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001; /* Above logo on mobile */
  margin-right: 15px; /* Spacing from logo */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFFFFF;
  margin-bottom: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu span:last-child {
  margin-bottom: 0;
}

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

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

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

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
  cursor: pointer;
}

/* Footer styles */
.site-footer {
  background-color: #003366; /* Dark blue */
  color: #FFFFFF;
  padding: 40px 0;
  font-size: 14px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

.footer-section {
  flex: 1;
  min-width: 200px;
}

.footer-section h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #FFFFFF;
}

.footer-section p {
  line-height: 1.6;
}

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

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section ul li a {
  color: #F0F0F0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: #26A9E0;
}

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom p {
  margin: 0;
  color: #CCCCCC;
}

/* Mobile styles */
@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;
  }

  .header-container, .nav-container, .footer-container {
    width: 100%;
    max-width: none;
    padding-left: 15px;
    padding-right: 15px;
  }

  .header-top {
    padding: 10px 0;
    min-height: 50px; /* Adjust height for mobile */
  }

  .header-top .header-container {
    justify-content: space-between;
    position: relative;
  }

  .hamburger-menu {
    display: block;
    order: 1;
    margin-left: 0; /* Handled by container padding */
  }

  .logo {
    order: 2;
    flex: 1 !important; /* Force logo to take available space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 20px;
    max-width: calc(100% - 100px); /* Account for hamburger and potential right-side elements */
  }

  .desktop-nav-buttons {
    display: none;
  }

  .mobile-nav-buttons {
    display: flex !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    background-color: #F5F5F5; /* Light grey background for mobile buttons */
    border-bottom: 1px solid #EEEEEE;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    min-height: 40px;
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical layout for mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Adjust as needed */
    height: calc(100vh - var(--header-offset));
    overflow-y: auto;
    background-color: #FFFFFF;
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    z-index: 1000;
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 15px;
    gap: 15px;
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    color: #333333; /* Darker text for readability on white background */
    border-bottom: 1px solid #F0F0F0;
  }

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

  .nav-link:hover,
  .nav-link.active {
    color: #26A9E0;
    text-decoration: none;
  }

  .mobile-menu-overlay.active {
    display: block;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-section {
    width: 100%;
    max-width: 300px; /* Optional: limit width on very small screens */
  }

  .footer-section ul {
    padding-left: 0;
  }
}

/* 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;
  }
}
