:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;
  --header-top-bg: #2c3e50; /* Dark blue-grey for header-top */
  --main-nav-bg: var(--primary-color); /* Primary color for main-nav */

  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

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

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

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border: none;
  font-size: 14px;
  line-height: 1;
}

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

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

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* --- Header Styles (Desktop First) --- */
.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, actual colors defined per section */
  min-height: var(--header-offset); /* Ensure min-height adapts */
  display: flex; /* For overall header structure */
  flex-direction: column;
}

.header-top {
  background-color: var(--header-top-bg);
  color: var(--text-color-light);
  min-height: 60px; /* Desktop height */
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.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-decoration: none;
  padding: 5px 0; /* Add vertical padding for clickable area */
  white-space: nowrap;
  display: block; /* Ensure it's not inline-flex on desktop */
}

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

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

.main-nav {
  background-color: var(--main-nav-bg);
  min-height: 50px; /* Desktop height */
  display: flex; /* Desktop default: flex */
  align-items: center;
  box-sizing: border-box;
}

.main-nav .nav-container {
  display: flex;
  flex-direction: row; /* Desktop default: row */
  justify-content: center; /* Center menu items */
  width: 100%;
  gap: 25px; /* Spacing between nav links */
}

.main-nav .nav-link {
  color: var(--text-color-light);
  text-decoration: none;
  padding: 10px 0;
  font-weight: bold;
  transition: color 0.3s ease, border-bottom 0.3s ease;
  white-space: nowrap;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
  color: #f0f0f0; /* Slightly lighter on hover */
  border-bottom: 2px solid var(--secondary-color);
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
}

.mobile-menu-overlay {
  display: none; /* Hidden by default */
}


/* --- Footer Styles --- */
.site-footer {
  background-color: var(--header-top-bg); /* Use dark blue-grey for footer too */
  color: var(--text-color-light);
  padding: 40px 0 20px 0;
}

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

.footer-section {
  flex: 1;
  min-width: 250px;
  max-width: 30%; /* For desktop layout */
}

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

.site-footer .footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

.site-footer p {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.8;
}

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

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

.site-footer ul li a {
  color: var(--text-color-light);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.site-footer ul li a:hover {
  opacity: 1;
}

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

/* --- Mobile 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-container, .nav-container, .footer-container {
    width: 100%;
    max-width: none; /* Important for mobile */
    padding-left: 15px;
    padding-right: 15px;
  }

  .site-header {
    min-height: auto; /* Reset min-height for mobile, let content define */
  }

  .header-top {
    min-height: 70px; /* Mobile height for header-top */
    padding: 10px 0;
  }

  .header-top .header-container {
    justify-content: space-between; /* Hamburger left, Logo center */
    position: relative;
  }

  /* Mobile Logo Centering for text logo (Method 1: Flexbox + !important) */
  .site-header .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px; /* Adjust font size for mobile */
    color: var(--secondary-color); /* Ensure visibility */
    padding: 0;
  }
  /* If logo was an image, the following CSS would be applied for centering:
  .site-header .logo img {
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 40px;
  }
  */

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

  /* Mobile Nav Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Vertical padding + horizontal padding from container */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--header-top-bg); /* Match header-top background */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtle shadow below buttons */
  }
  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
  }

  /* Hamburger Menu */
  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative; /* To position correctly in flex */
    z-index: 1001; /* Above logo and buttons */
    margin-right: auto; /* Push logo to center */
    order: -1; /* Place it at the start of flex container */
  }

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

  .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 Navigation Menu */
  .main-nav {
    display: none; /* Hidden by default */
    flex-direction: column; /* Vertical layout */
    position: fixed;
    top: var(--header-offset); /* Start below fixed header parts */
    left: 0;
    width: 80%; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--main-nav-bg);
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    overflow-y: auto; /* Scroll if content is too long */
    z-index: 999; /* Below hamburger, above overlay */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start; /* Align links to left */
    padding: 20px 15px;
    gap: 0; /* No gap for vertical links */
  }

  .main-nav .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 16px;
    color: var(--text-color-light);
  }
  .main-nav .nav-link:last-child {
      border-bottom: none;
  }

  /* 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; /* Below menu, above content */
  }
  .mobile-menu-overlay.active {
    display: block;
  }

  /* Footer Mobile */
  .footer-container {
    flex-direction: column;
    gap: 20px;
  }
  .footer-section {
    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;
  }
}
