:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --text-color: #000000;
  --header-top-bg: var(--secondary-color);
  --main-nav-bg: var(--primary-color);
  --footer-bg: #1A7BAB;
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #FFFFFF;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

body.no-scroll {
  overflow: hidden;
}

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

a:hover {
  text-decoration: underline;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none; /* Remove underline for buttons */
}

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

.btn-register:hover {
  background-color: #1E8BB5; /* Darker primary */
  border-color: #1E8BB5;
  color: var(--secondary-color);
  text-decoration: none;
}

.btn-login {
  background-color: var(--login-button-color);
  color: var(--secondary-color);
  border: 2px solid var(--login-button-color);
  box-shadow: 0 4px 8px rgba(234, 124, 7, 0.3);
}

.btn-login:hover {
  background-color: #C56806; /* Darker login orange */
  border-color: #C56806;
  color: var(--secondary-color);
  box-shadow: 0 6px 12px rgba(234, 124, 7, 0.4);
  text-decoration: none;
}

/* Header Styles */
.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(--header-top-bg); /* Default background for the entire header */
}

.header-top {
  background-color: var(--header-top-bg);
  padding: 10px 0;
  min-height: 60px; /* Desktop header-top height */
  display: flex;
  align-items: center;
}

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

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  white-space: nowrap;
  display: block; /* Ensure logo is always visible */
}

.desktop-nav-buttons {
  display: flex;
  gap: 10px;
  margin-left: auto; /* Push buttons to the right */
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001; /* Above other elements */
}

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

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

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

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

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

.main-nav {
  background-color: var(--main-nav-bg);
  padding: 0;
  min-height: 50px; /* Desktop main-nav height */
  display: flex; /* Desktop default: visible, horizontal */
  align-items: center;
  justify-content: center;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  flex-wrap: wrap; /* Allow wrapping on smaller desktop screens */
}

.nav-link {
  color: var(--secondary-color);
  padding: 15px 20px;
  display: block;
  font-weight: bold;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

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

/* Mobile Styles */
@media (max-width: 768px) {
  .header-top {
    min-height: 50px; /* Mobile header-top height */
    padding: 5px 0;
  }
  .header-container {
    width: 100%;
    max-width: none; /* Important: no max-width on mobile */
    padding: 0 15px;
    justify-content: space-between;
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu */
    order: 1;
  }

  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important; /* Use flex to center its content */
    justify-content: center !important; /* Center the logo text/image */
    align-items: center !important;
    order: 2;
    font-size: 24px;
    padding: 0 10px;
  }

  .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; /* Smaller padding */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--header-top-bg); /* Same as header-top for continuity */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* Slight shadow below buttons */
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    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; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header + buttons */
    left: 0;
    width: 70%; /* Slide-out menu width */
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    background-color: var(--main-nav-bg);
    flex-direction: column; /* Vertical menu */
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease-in-out;
    overflow-y: auto; /* Enable scrolling for long menus */
    align-items: flex-start; /* Align menu items to the left */
    justify-content: flex-start;
  }

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

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

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

  .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;
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
  }

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

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

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

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  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(--secondary-color);
  margin-bottom: 15px;
  display: block;
}

.footer-text, .copyright {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-nav h3,
.footer-col h3 {
  color: var(--secondary-color);
  margin-bottom: 15px;
  font-size: 18px;
}

.footer-nav ul {
  list-style: none;
}

.footer-nav ul li a {
  color: rgba(255, 255, 255, 0.7);
  padding: 5px 0;
  display: block;
  transition: color 0.3s ease;
}

.footer-nav ul li a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.footer-col p {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-col .footer-link {
  color: rgba(255, 255, 255, 0.7);
}

.footer-col .footer-link:hover {
  color: var(--secondary-color);
}

@media (max-width: 768px) {
  .site-footer {
    padding: 30px 15px;
  }
  .footer-container {
    flex-direction: column;
    gap: 20px;
  }
  .footer-col {
    min-width: 100%;
    text-align: center;
  }
  .footer-logo {
    text-align: center;
  }
  .footer-text, .copyright {
    text-align: center;
  }
  .footer-nav h3,
  .footer-col h3 {
    text-align: center;
  }
  .footer-nav ul {
    text-align: center;
  }
  .footer-nav ul li a {
    display: inline-block; /* Allow items to be inline for better mobile spacing if list is short */
    padding: 5px 10px;
  }
}

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