:root {
  --primary-color: #26A9E0; /* 淡蓝色 */
  --secondary-color: #FFFFFF; /* 白色 */
  --login-button-color: #EA7C07; /* 登录按钮橙色 */
  --text-color: #333333; /* 深灰色文本 */
  --header-offset: 150px; /* 桌面端：header-top (80px) + main-nav (70px) */
}

@media (max-width: 768px) {
  :root {
    --header-offset: 140px; /* 移动端：header-top (80px) + mobile-nav-buttons (60px) */
  }
}

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

/* Shared Container Styles */
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 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: var(--secondary-color); /* Default background for header */
}

.header-top {
  background-color: var(--secondary-color); /* White background for top bar */
  min-height: 60px; /* Ensure minimum height */
  padding: 10px 0; /* Vertical padding */
  display: flex;
  align-items: center;
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%; /* Ensure container takes full width of header-top */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color); /* Primary color for logo text */
  text-decoration: none;
  padding: 5px 0; /* Add some padding for clickable area */
  white-space: nowrap; /* Prevent logo text from wrapping on desktop */
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1001; /* Above logo on mobile */
}

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

/* Hamburger active state (X icon) */
.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(-11px) rotate(-45deg);
}

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

.mobile-nav-buttons {
  display: none; /* Hidden on desktop, shown on mobile via media query */
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box; /* Include padding in width calculation */
  text-align: center;
  color: var(--secondary-color); /* White text for buttons */
  background-color: var(--primary-color); /* Default button color */
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-register {
  background-color: var(--primary-color); /* Primary color for register */
}

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

.main-nav {
  background-color: var(--primary-color); /* Primary blue background for main nav */
  width: 100%;
  display: flex; /* Desktop default: flex row */
  justify-content: center;
  align-items: center;
  min-height: 50px; /* Ensure minimum height */
  padding: 10px 0; /* Vertical padding */
}

.main-nav .nav-container {
  display: flex;
  flex-direction: row; /* Desktop default: row */
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping on smaller desktop screens */
  gap: 20px; /* Space between nav links */
}

.nav-link {
  color: var(--secondary-color); /* White text for nav links */
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent nav links from wrapping on desktop */
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* 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: 998;
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Footer Styles */
.site-footer {
  background-color: #333333; /* Dark background for footer */
  color: var(--secondary-color);
  padding: 40px 0;
  font-size: 14px;
}

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

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color); /* Primary color for footer logo */
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

.footer-col h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--primary-color); /* Primary color for footer headings */
}

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

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

.footer-col ul li a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-col ul li a:hover {
  color: var(--primary-color);
}

.footer-info p {
  margin: 0;
  line-height: 1.8;
}

/* Responsive Styles */
@media (max-width: 768px) {
  /* Header Offset for mobile */
  body {
    padding-top: var(--header-offset);
  }

  /* Header Top */
  .header-top .header-container {
    padding: 0 15px; /* Smaller padding on mobile */
    justify-content: space-between; /* Hamburger left, Logo center */
    position: relative;
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    order: 0; /* Place to the left */
  }

  .logo {
    order: 1; /* Center the logo */
    position: absolute; /* Absolute positioning for better centering */
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Account for hamburger width + padding */
    text-align: center; /* Ensure text itself is centered within its absolute container */
    font-size: 24px; /* Smaller font size for mobile logo */
    white-space: normal; /* Allow text to wrap if it's too long */
    word-break: break-word; /* Ensure long words break */
  }

  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons on mobile */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for mobile buttons */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: #F5F5F5; /* Light background for mobile buttons section */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }

  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    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 (Mobile Menu) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Start below header-top and mobile buttons */
    left: 0;
    width: 75%; /* Slide-in menu width */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    overflow-y: auto; /* Scrollable if content overflows */
    background-color: var(--primary-color);
    flex-direction: column; /* Vertical menu */
    align-items: flex-start; /* Align links to the left */
    transform: translateX(-100%); /* Start off-screen to the left */
    transition: transform 0.3s ease;
    z-index: 999; /* Below hamburger, above overlay */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
  }

  .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: 20px 15px; /* Padding for mobile menu items */
    gap: 15px; /* Space between vertical links */
    width: 100%; /* Ensure container takes full width of main-nav */
    max-width: none; /* No max-width on mobile container */
  }

  .nav-link {
    width: 100%; /* Full width links */
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); /* Separator */
  }
  .nav-link:last-child {
      border-bottom: none;
  }

  /* Footer */
  .site-footer .footer-container {
    flex-direction: column;
    text-align: center;
    padding: 0 15px;
  }

  .footer-col {
    min-width: unset; /* Remove min-width on mobile */
    width: 100%;
  }

  .footer-col ul {
    margin-bottom: 20px;
  }

  .footer-logo {
    margin-bottom: 10px;
  }

  /* Mobile content overflow protection */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: 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;
  }
}
