:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --header-top-bg: #00502a; /* Darker variant of primary for header-top */
  --main-nav-bg: var(--primary-color); /* Primary color for main-nav */
  --btn-register-bg: #C30808;
  --btn-download-bg: #C30808;
  --btn-text-color: #FFFF00;
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

/* Base styles */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark);
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

/* Site Header - Fixed Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background-color: var(--secondary-color); /* Fallback, specific sections have their own bg */
}

/* Header Top Section (Desktop: Logo Left, Buttons Right) */
.header-top {
  background-color: var(--header-top-bg);
  color: var(--text-color-light);
  padding: 10px 0; 
  min-height: 40px;
  display: flex; 
  align-items: center; 
}

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

/* Logo Styling */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--btn-text-color); 
  text-decoration: none;
  white-space: nowrap; 
  display: block; 
  line-height: 1;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex; 
  gap: 10px;
  align-items: center;
}

/* Mobile Navigation Buttons - hidden on desktop */
.mobile-nav-buttons {
  display: none; /* Hidden by default, shown on mobile */
  background-color: var(--primary-color); /* Background for mobile buttons */
  padding: 10px 15px; 
  min-height: 30px; 
  align-items: center;
}

/* Buttons common style */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-register, .btn-download {
  background-color: var(--btn-register-bg);
  color: var(--btn-text-color);
}

.btn-register:hover, .btn-download:hover {
  background-color: #a30707; /* Darker red on hover */
  transform: translateY(-2px);
}

/* Main Navigation (Desktop: Menu centered) */
.main-nav {
  background-color: var(--main-nav-bg);
  width: 100%;
  display: flex; /* Desktop default: flex row */
  flex-direction: row;
  justify-content: center; /* Center menu items */
  position: static; /* Desktop default: static */
  padding: 10px 0; 
  min-height: 30px; 
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap; 
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  width: 100%;
}

.nav-link {
  color: var(--text-color-light);
  text-decoration: none;
  padding: 8px 15px;
  margin: 0 5px;
  font-size: 16px;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease, border-radius 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--btn-text-color); /* Yellow on hover/active */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

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

.hamburger-menu .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--btn-text-color); /* Yellow bars */
  margin: 5px 0;
  transition: all 0.3s ease-in-out;
}

/* Hamburger animation */
.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.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;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Footer Styling */
.site-footer {
  background-color: var(--primary-color);
  color: var(--text-color-light);
  padding: 40px 20px 20px;
  font-size: 15px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

.footer-column {
  flex: 1;
  min-width: 250px;
  max-width: 30%; 
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--btn-text-color); 
  margin-top: 0;
  margin-bottom: 15px;
}

.site-footer h4 {
  color: var(--btn-text-color); 
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 15px;
}

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

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

.site-footer a:hover {
  color: var(--btn-text-color);
}

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

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

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

/* --- Mobile Specific Styles --- */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

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

  .site-header {
    min-height: unset; /* Let content define height */
  }

  .header-top {
    padding: 10px 0;
  }

  .header-container {
    padding: 0 15px; 
    justify-content: space-between; 
    position: relative; 
  }

  /* Hamburger Menu */
  .hamburger-menu {
    display: block; 
    order: 0; 
  }

  /* Mobile Logo Centering (Text Logo) */
  .logo {
    font-size: 24px;
    order: 1; 
    flex-grow: 1; 
    text-align: center; 
    position: absolute !important; 
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
    height: 40px; /* Ensure consistent height for centering */
  }

  /* Ensure desktop buttons are hidden */
  .desktop-nav-buttons {
    display: none;
  }

  /* Mobile Navigation Buttons - always visible below header-top */
  .mobile-nav-buttons {
    display: flex !important; /* Override default hidden state */
    width: 100%; max-width: 100%; 
    box-sizing: border-box;
    padding: 10px 15px; 
    overflow: hidden; 
    gap: 10px;
    flex-wrap: nowrap; 
    justify-content: center; 
    background-color: var(--primary-color); 
  }

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

  /* Main Navigation - Mobile (hidden by default, fixed, column layout) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header (header-top + mobile-nav-buttons) */
    left: 0;
    width: 280px; 
    height: calc(100% - var(--header-offset)); 
    background-color: var(--main-nav-bg); 
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); 
    transition: transform 0.3s ease-in-out;
    overflow-y: auto; 
    z-index: 1000; 
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start; 
    padding: 0 15px; 
    max-width: none; 
    width: 100%; 
  }

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 5px;
    text-align: left;
    font-size: 15px;
  }

  .footer-container {
    flex-direction: column;
    gap: 20px;
  }

  .footer-column {
    max-width: 100%;
    min-width: unset;
  }
}
/* 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;
  }
}
