:root {
  --primary-color: #26A9E0; /* Light Blue */
  --secondary-color: #FFFFFF; /* White */
  --accent-color: #EA7C07; /* Orange for login/register */
  --text-color: #333333; /* Dark grey for general text */
  --header-top-bg: #1A8BBF; /* Darker blue for header top */
  --main-nav-bg: #26A9E0; /* Primary color for main nav */
  --footer-bg: #333333; /* Dark grey for footer */
  --footer-text-color: #CCCCCC; /* Light grey for footer text */

  --header-offset: 120px; /* Desktop: header-top (65px) + main-nav (55px) */
}

@media (max-width: 768px) {
  :root {
    --header-offset: 120px; /* Mobile: header-top (65px) + mobile-nav-buttons (55px) */
  }
}

/* Base styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  padding-top: var(--header-offset); /* Apply header offset */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

a {
  text-decoration: none;
  color: var(--primary-color);
}

a:hover {
  text-decoration: underline;
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  text-decoration: none; /* Remove underline */
  cursor: pointer;
  border: none;
  line-height: 1.2; /* Adjust line height for button text */
}

.btn-login {
  background-color: var(--accent-color); /* Orange */
  color: var(--secondary-color);
}

.btn-login:hover {
  background-color: #D46F06; /* Slightly darker orange */
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-register {
  background-color: var(--primary-color); /* Light Blue */
  color: var(--secondary-color);
}

.btn-register:hover {
  background-color: #1F8CBF; /* Slightly darker blue */
  transform: translateY(-2px);
  text-decoration: none;
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background-color: var(--secondary-color); /* Default background, will be overridden by sub-sections */
}

/* Header Top Section (Desktop First) */
.header-top {
  background-color: var(--header-top-bg); /* Darker blue */
  color: var(--secondary-color);
  padding: 10px 0;
  min-height: 65px; /* Fixed height for header-top */
  display: flex;
  align-items: center;
}

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

.site-header .logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure visibility */
}

.site-header .logo:hover {
  color: var(--secondary-color); /* No underline */
  text-decoration: none;
}

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

/* Main Navigation Section (Desktop First) */
.main-nav {
  background-color: var(--main-nav-bg); /* Primary color */
  padding: 5px 0;
  min-height: 55px; /* Fixed height for main-nav */
  display: flex; /* Desktop: visible, horizontal */
  align-items: center;
}

.main-nav .nav-container {
  display: flex;
  justify-content: center; /* Center nav links */
  align-items: center;
  width: 100%;
  flex-wrap: wrap; /* Allow wrapping if many links */
}

.nav-link {
  color: var(--secondary-color);
  font-weight: bold;
  padding: 10px 15px;
  transition: background-color 0.3s ease;
  border-radius: 4px;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

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

/* Hamburger Menu (Hidden by default on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001; /* Above logo on mobile */
}

.hamburger-menu .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

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

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

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

/* Mobile Menu Overlay */
.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;
}

/* Footer Styles */
.site-footer {
  background-color: var(--footer-bg); /* Dark grey */
  color: var(--footer-text-color);
  padding: 40px 0 20px;
  font-size: 14px;
}

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

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

.site-footer .footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 15px;
}

.site-footer .footer-logo:hover {
  color: var(--secondary-color);
  text-decoration: none;
}

.site-footer .footer-description {
  margin-top: 10px;
  line-height: 1.8;
}

.site-footer .footer-heading {
  font-size: 18px;
  color: var(--secondary-color);
  margin-bottom: 20px;
  position: relative;
}

.site-footer .footer-heading::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
  margin-top: 8px;
}

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

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

.site-footer .footer-nav a {
  color: var(--footer-text-color);
  transition: color 0.3s ease;
}

.site-footer .footer-nav a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

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

.site-footer .copyright {
  margin: 0;
  color: var(--footer-text-color);
}

/* Responsive styles */
@media (max-width: 768px) {
  /* Prevent content overflow */
  .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-top {
    min-height: 65px; /* Ensure consistent height */
    padding: 0 15px; /* Smaller padding for mobile */
  }

  .header-top .header-container {
    padding-left: 0; /* Handled by header-top padding */
    padding-right: 0; /* Handled by header-top padding */
    width: 100%;
    max-width: none; /* Important: no max-width on mobile containers */
    justify-content: space-between; /* Hamburger left, Logo center, space right */
    position: relative; /* For logo centering */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 1; /* Left side */
  }

  .site-header .logo {
    order: 2; /* Center */
    flex: 1; /* Take available space */
    text-align: center; /* Center text logo */
    font-size: 24px; /* Smaller font size */
    padding: 0 10px; /* Add some padding to prevent overlap with hamburger */
  }
  
  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for the container */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--header-top-bg); /* Same as header-top for consistency */
    min-height: 55px; /* Fixed height for mobile buttons */
  }

  .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; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Ensure text breaks */
    overflow-wrap: break-word; /* Ensure text breaks */
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below header and mobile buttons */
    left: 0;
    width: 280px; /* Adjust as needed */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--main-nav-bg);
    flex-direction: column; /* Vertical menu */
    align-items: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Scroll if content is long */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0; /* Remove container padding for full width links */
    width: 100%;
    max-width: none; /* Important: no max-width on mobile containers */
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px; /* Adjust padding for vertical links */
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
  }

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

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

  /* Footer responsive */
  .site-footer .footer-container {
    flex-direction: column;
    gap: 20px;
  }

  .site-footer .footer-col {
    min-width: unset;
    flex: unset;
  }

  .site-footer .footer-heading {
    text-align: left;
  }
  .site-footer .footer-heading::after {
    margin-left: 0;
  }
  .site-footer .footer-bottom {
    margin-top: 30px;
  }
}
/* 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;
  }
}
