:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-color: #EA7C07;
  --black-color: #000000;
  --text-dark: #333333;
  --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 {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Apply header offset to body */
  background-color: var(--secondary-color);
  color: var(--text-dark);
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

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

a:hover {
  text-decoration: underline;
}

/* Shared container styles */
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* 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(--secondary-color); /* Fallback, specific sections will override */
}

/* Header Top Section (Desktop) */
.header-top {
  background-color: var(--black-color); /* Dark background for top bar */
  color: var(--secondary-color);
  min-height: 60px; /* Estimated height for header-top */
  display: flex;
  align-items: center;
}

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

.site-header .logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color); /* Logo text color */
  text-transform: uppercase;
  padding: 10px 0;
  white-space: nowrap;
}

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

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

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-register {
  background-color: var(--primary-color);
}

.btn-register:hover {
  background-color: #208bc2; /* Darker primary */
}

.btn-login {
  background-color: var(--login-color);
}

.btn-login:hover {
  background-color: #c46a06; /* Darker login orange */
}

/* Main Navigation Section (Desktop) */
.main-nav {
  background-color: var(--primary-color); /* Primary color background for nav bar */
  min-height: 50px; /* Estimated height for main-nav */
  display: flex; /* Desktop default: flex */
  align-items: center;
}

.main-nav .nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

.nav-link {
  color: var(--secondary-color); /* White text for nav links */
  font-weight: bold;
  padding: 10px 15px;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}

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

/* Hamburger menu (hidden on desktop) */
.hamburger-menu {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 25px;
  position: relative;
  transform: rotate(0deg);
  transition: .5s ease-in-out;
  order: -1;
  margin-right: 15px;
}

.hamburger-menu span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--secondary-color);
  border-radius: 9px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.hamburger-menu span:nth-child(1) { top: 0px; }
.hamburger-menu span:nth-child(2) { top: 11px; }
.hamburger-menu span:nth-child(3) { top: 22px; }

.hamburger-menu.active span:nth-child(1) { top: 11px; transform: rotate(135deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; left: -60px; }
.hamburger-menu.active span:nth-child(3) { top: 11px; transform: rotate(-135deg); }

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

/* Mobile menu overlay (hidden by default) */
.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;
}

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

.site-footer h3 {
  color: var(--primary-color);
  font-size: 18px;
  margin-bottom: 20px;
}

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

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

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

.site-footer ul li a {
  color: var(--secondary-color);
  transition: color 0.3s ease;
}

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

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

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

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

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

/* Mobile styles */
@media (max-width: 768px) {
  /* Mobile header offset */
  :root {
    --header-offset: 110px;
  }

  /* 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 (Mobile) */
  .header-top {
    min-height: 60px;
    padding: 15px 0;
    box-sizing: border-box;
  }

  .header-top .header-container {
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: none;
    justify-content: space-between;
    position: relative; /* For precise logo centering */
  }

  .hamburger-menu {
    display: block;
    order: -1;
    z-index: 1001;
    margin-right: 0;
  }

  .site-header .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger */
    font-size: 20px;
    z-index: 1;
    color: var(--primary-color);
  }

  .site-header .logo img {
    max-height: 40px;
    width: auto;
  }

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

  /* Mobile Nav Buttons (Mobile) */
  .mobile-nav-buttons {
    display: flex !important;
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: #f0f0f0; /* Light background for mobile buttons section */
    min-height: 50px;
    align-items: center;
  }

  .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) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below the fixed header */
    left: 0;
    width: 280px;
    height: calc(100% - var(--header-offset));
    background-color: var(--primary-color);
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    z-index: 1000;
    overflow-y: auto;
  }

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

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

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

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

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

  /* Footer (Mobile) */
  .footer-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .footer-col {
    width: 100%;
    min-width: unset;
    text-align: center;
  }

  .footer-col h3 {
    margin-bottom: 10px;
  }
  .site-footer ul li {
    margin-bottom: 5px;
  }
  .site-footer ul li a {
    display: block;
  }
  .footer-bottom {
    padding-top: 20px;
    margin-top: 20px;
  }
}

/* Body no-scroll class for mobile menu */
body.no-scroll {
  overflow: 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;
  }
}
