:root {
    --primary-color: #007bff;
    --secondary-color: #ffc107;
    --text-color: #333;
    --light-text-color: #f8f9fa;
    --dark-bg-color: #0056b3; /* Darker primary for header-top */
    --light-bg-color: #e0f2ff; /* Lighter primary for main-nav */
    --header-offset: 110px;
}

@media (max-width: 768px) {
    :root {
        --header-offset: 105px;
    }
}

body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Prevent horizontal scroll on body */
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-height: auto;
    background-color: transparent; /* Handled by header-top and main-nav */
}

.header-top {
    background-color: var(--dark-bg-color);
    padding: 10px 0;
    color: var(--light-text-color);
}

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

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--secondary-color);
    text-decoration: none;
    white-space: nowrap;
    padding-right: 15px;
}

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
}

.btn-register {
    background: linear-gradient(to right, #ffc107, #ffa000);
    color: #333;
    border: none;
}

.btn-register:hover {
    background: linear-gradient(to right, #ffa000, #ffc107);
    transform: translateY(-2px);
}

.btn-login {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border: 1px solid var(--primary-color);
}

.btn-login:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px);
}

.hamburger-menu {
    display: none; /* Hidden on desktop */
    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(--light-text-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);
}

.main-nav {
    background-color: var(--light-bg-color);
    padding: 10px 0;
    display: flex; /* Desktop default */
    flex-direction: row; /* Desktop default */
    justify-content: center;
    align-items: center;
    position: static; /* Desktop default */
    width: 100%;
}

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

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 15px;
    font-weight: 500;
    transition: color 0.3s ease, background-color 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: 4px;
}

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

.mobile-menu-overlay {
    display: none;
}

/* Footer Styles */
.site-footer {
    background-color: #343a40;
    color: #f8f9fa;
    padding: 40px 20px;
    font-size: 14px;
    line-height: 1.8;
}

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

.footer-section {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

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

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

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

.footer-nav li a {
    color: #adb5bd;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.footer-nav li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid #495057;
    color: #adb5bd;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .header-container {
        width: 100%;
        max-width: none;
        padding: 0 15px;
        justify-content: space-between; /* Ensures hamburger and logo are spaced */
    }

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

    .logo {
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding-right: 0; /* Remove extra padding */
    }

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

    .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;
        justify-content: center;
        background-color: var(--dark-bg-color); /* Match header-top */
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    .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;
    }

    .hamburger-menu {
        display: block;
        order: -1; /* Place hamburger first */
        margin-left: -10px; /* Adjust for padding */
    }

    .main-nav {
        display: none; /* Hidden by default on mobile */
        flex-direction: column;
        position: fixed;
        top: var(--header-offset); /* Start below the fixed header + mobile buttons */
        left: 0;
        width: 280px;
        height: calc(100vh - var(--header-offset));
        background-color: var(--dark-bg-color);
        transform: translateX(-100%); /* Slide out of view */
        transition: transform 0.3s ease-out;
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        padding-top: 20px;
        overflow-y: auto;
        align-items: flex-start;
    }

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

    .nav-link {
        color: var(--light-text-color);
        padding: 12px 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--secondary-color);
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none; /* Hidden by default */
        transition: opacity 0.3s ease;
        opacity: 0;
    }

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

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-section {
        max-width: 100%;
        min-width: unset;
    }

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

/* Color Contrast & General Styles */
.btn-register, .btn-login {
    -webkit-appearance: none; /* Remove default button styles for consistency */
    -moz-appearance: none;
    appearance: none;
    border: none;
    cursor: pointer;
}

.btn-register:active, .btn-login:active {
    transform: translateY(0);
}

/* Ensure text contrast for buttons */
.btn-register { color: #333; } /* Dark text on bright yellow/gold */
.btn-login { color: #fff; } /* White text on blue */

/* Ensure logo contrast */
.logo { color: var(--secondary-color); } /* Bright yellow on dark blue header-top */

/* Ensure nav-link contrast */
.main-nav .nav-link { color: var(--text-color); } /* Dark text on light blue main-nav */
@media (max-width: 768px) {
    .main-nav .nav-link { color: var(--light-text-color); } /* Light text on dark blue mobile menu */
}

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