:root {
  --primary-color: #26A9E0; /* 淡蓝色 */
  --secondary-color: #FFFFFF; /* 白色 */
  --login-button-color: #EA7C07; /* 登录按钮橙色 */
  --text-color: #333333; /* 深灰色文本 */
  --header-top-bg: #1e88b9; /* 顶部区域深蓝色 */
  --main-nav-bg: var(--primary-color); /* 导航区域主蓝色 */
  --footer-bg: #333333; /* 页脚背景深灰色 */
  --footer-text-color: #e0e0e0; /* 页脚文本浅色 */
  --header-offset: 110px; /* 桌面端：header-top(60px) + main-nav(50px) */
}
@media (max-width: 768px) {
  :root {
    --header-offset: 95px; /* 移动端：header-top(50px) + mobile-nav-buttons(45px) */
  }
}

/* Base Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* 应用页头偏移 */
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--secondary-color);
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}
a {
  text-decoration: none;
  color: var(--primary-color);
}
a:hover {
  text-decoration: underline;
}

/* Container for desktop */
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px; /* 桌面端内边距 */
}

/* 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, actual colors set on sub-elements */
}

.header-top {
  background-color: var(--header-top-bg);
  color: var(--secondary-color);
  min-height: 60px; /* Desktop height for top bar */
  display: flex;
  align-items: center;
}
.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px; /* Ensure content spacing */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure visibility */
  line-height: 1;
}
.logo:hover {
  color: var(--login-button-color); /* Hover effect */
  text-decoration: none;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 10px;
}
.btn {
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: inline-flex; /* For better text alignment */
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  color: var(--secondary-color); /* Default button text color */
  line-height: 1;
}
.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}
.btn-primary {
  background-color: var(--login-button-color);
}
.btn-primary:hover {
  background-color: #d16b00; /* Darker orange */
}
.btn-secondary {
  background-color: var(--primary-color);
}
.btn-secondary:hover {
  background-color: #1a78a7; /* Darker blue */
}

/* Main Navigation */
.main-nav {
  background-color: var(--main-nav-bg);
  min-height: 50px; /* Desktop height for nav bar */
  display: flex; /* Desktop default: visible */
  flex-direction: row; /* Desktop default: horizontal */
  justify-content: center;
  align-items: center;
}
.main-nav .nav-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 10px 20px;
  flex-wrap: wrap; /* Allow wrapping on larger screens if too many links */
  gap: 15px;
}
.nav-link {
  color: var(--secondary-color);
  font-weight: bold;
  padding: 5px 10px;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
  border-radius: 3px;
}
.nav-link:hover, .nav-link.active {
  color: var(--login-button-color);
  background-color: rgba(255,255,255,0.1);
  text-decoration: none;
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001; /* Above logo on mobile */
  margin-right: auto; /* Push logo to center on mobile */
}
.hamburger-menu .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color);
  margin: 5px 0;
  transition: all 0.3s ease;
}
.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 Menu Overlay (Hidden on Desktop) */
.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;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

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

/* Footer Styles */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text-color);
  padding: 40px 0 20px;
  font-size: 14px;
}
.site-footer a {
  color: var(--primary-color);
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}
.site-footer h3 {
  color: var(--secondary-color);
  font-size: 18px;
  margin-bottom: 20px;
}
.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}
.footer-col {
  flex: 1;
  min-width: 250px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  margin-top: 30px;
  text-align: center;
}
.footer-bottom p {
  margin: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
  /* Mobile Header Top */
  .header-top {
    min-height: 50px; /* Mobile height for top bar */
  }
  .header-top .header-container {
    padding: 10px 15px; /* Smaller padding for mobile */
    min-height: 50px; /* Ensure height for logo/hamburger */
    position: relative; /* For potential absolute positioning if needed */
  }
  .header-top .header-container .logo {
    flex: 1 !important; /* Allow flex to center */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px; /* Smaller logo text */
    position: static; /* Reset absolute positioning if any */
    transform: none; /* Reset transform */
    max-width: calc(100% - 80px); /* Leave space for hamburger */
  }

  /* Hamburger Menu visible on Mobile */
  .hamburger-menu {
    display: block;
    position: relative; /* Keep it in flow, but z-index above logo if overlap */
    order: -1; /* Place it first */
  }

  /* Hide Desktop Buttons on Mobile */
  .desktop-nav-buttons {
    display: none;
  }

  /* Show Mobile Buttons on Mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Force display */
    width: 100%;
    max-width: 100%; /* Ensure it doesn't overflow */
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for the container */
    overflow: hidden; /* Prevent content overflow */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
    background-color: var(--header-top-bg); /* Match header-top background */
    min-height: 45px; /* Mobile height for buttons area */
    justify-content: center; /* Center buttons if less than 2 */
    align-items: center;
  }
  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space equally */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Ensure long words break */
    overflow-wrap: break-word;
  }

  /* Mobile Main Navigation */
  .main-nav {
    display: none; /* Hidden by default, controlled by JS */
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header + mobile buttons */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
    background-color: var(--main-nav-bg);
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    z-index: 9999; /* Above overlay */
    overflow-y: auto; /* Allow scrolling for long menus */
  }
  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide into view */
  }
  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0; /* Remove container padding for full sidebar width */
    width: 100%;
    gap: 0; /* Remove gap for vertical links */
  }
  .main-nav .nav-link {
    width: 100%;
    padding: 12px 0;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    border-radius: 0;
  }
  .main-nav .nav-link:last-child {
    border-bottom: none;
  }

  /* Footer Mobile */
  .footer-container {
    flex-direction: column;
    gap: 20px;
  }
  .footer-col {
    min-width: unset; /* Remove min-width for mobile */
    width: 100%;
    text-align: center;
  }
  .footer-col ul {
    text-align: center;
  }
  .footer-col ul li {
    display: inline-block; /* Inline list items for better spacing */
    margin: 0 10px 10px;
  }
  
  /* Prevent body scroll when menu is open */
  body.no-scroll {
    overflow: hidden;
  }

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

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