:root {
    --primary-color: #FFD700;
    --secondary-color: #1A202C;
    --text-light: #FFFFFF;
    --text-dark: #1A202C;
    --header-top-height-desktop: 60px;
    --main-nav-height-desktop: 50px;
    --mobile-top-bar-height: 60px;
    --mobile-btn-bar-height: 50px;
    --header-offset: calc(var(--header-top-height-desktop) + var(--main-nav-height-desktop)); /* Desktop: 60px + 50px = 110px */
}

@media (max-width: 768px) {
    :root {
        --header-offset: calc(var(--mobile-top-bar-height) + var(--mobile-btn-bar-height)); /* Mobile: 60px + 50px = 110px */
    }
}

html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Arial', sans-serif; line-height: 1.6; color: var(--text-dark); background-color: #f4f4f4; }
body.no-scroll { overflow: hidden; }

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    background-color: transparent; /* Base color, will be overridden by sections */
}

.header-top {
    background-color: var(--secondary-color); /* Dark background for top bar */
    color: var(--text-light);
    padding: 10px 0; /* Adjust to match calculated height */
    min-height: var(--header-top-height-desktop);
    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 30px;
    box-sizing: border-box;
}

.logo {
    font-size: 2.2em;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    order: 1;
    flex-shrink: 0;
}

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    white-space: nowrap;
    color: var(--text-dark); /* Default dark text for buttons */
    background-color: var(--primary-color); /* Primary color for buttons */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: darken(var(--primary-color), 10%); /* Slightly darker on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.btn-register {
    background-color: #FF6347; /* A bright, contrasting red-orange for register */
    color: var(--text-light);
}

.btn-register:hover {
    background-color: #E64A2F;
}

.btn-login {
    background-color: #4CAF50; /* A bright green for login */
    color: var(--text-light);
}

.btn-login:hover {
    background-color: #3C8D40;
}

.mobile-nav-buttons {
    display: none; /* Hidden on desktop */
    background-color: var(--secondary-color); /* Match header-top background */
    padding: 10px 15px;
    min-height: var(--mobile-btn-bar-height);
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.main-nav {
    background-color: var(--primary-color); /* Primary color background for nav */
    padding: 5px 0;
    min-height: var(--main-nav-height-desktop);
    display: flex; /* Desktop: default flex for horizontal nav */
    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;
    box-sizing: border-box;
}

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

.nav-link:hover, .nav-link.active {
    background-color: rgba(0,0,0,0.1);
    border-radius: 4px;
    color: var(--text-dark);
}

.hamburger-menu {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1001; /* Above logo on mobile */
    order: 0; /* Place to the left */
    margin-right: 15px;
}

.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-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 {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
}

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

/* Footer */
.site-footer {
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 40px 0 20px;
    font-size: 0.9em;
}

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

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

.footer-logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 15px;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2em;
}

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

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

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .site-header {
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    .header-container {
        padding: 0 15px;
        width: 100%;
        max-width: none; /* Ensure it takes full width on mobile */
        min-height: var(--mobile-top-bar-height);
        justify-content: space-between;
    }

    .hamburger-menu {
        display: block;
    }

    .logo {
        flex: 1 !important; /* Allow logo to take available space */
        display: flex !important;
        justify-content: center !important; /* Center logo horizontally */
        align-items: center !important;
        font-size: 1.8em;
        margin: 0;
        padding: 0;
    }

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

    .mobile-nav-buttons {
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
        width: 100%; max-width: 100%;
        box-sizing: border-box;
        padding: 10px 15px; /* Reduced padding for mobile */
        overflow: hidden;
    }

    .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; /* Smaller padding */
        font-size: 13px; /* Smaller font size */
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: center;
    }

    .main-nav {
        display: none; /* Hidden by default on mobile */
        flex-direction: column;
        position: fixed;
        top: calc(var(--mobile-top-bar-height) + var(--mobile-btn-bar-height)); /* Position below header and buttons */
        left: 0;
        width: 70%;
        height: calc(100% - var(--mobile-top-bar-height) - var(--mobile-btn-bar-height)); /* Full height below header */
        background-color: var(--secondary-color); /* Dark background for mobile menu */
        transform: translateX(-100%); /* Slide out from left */
        transition: transform 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        z-index: 999;
        padding: 20px 0;
        box-sizing: border-box;
    }

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

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 15px;
        width: 100%;
        max-width: none; /* Ensure it takes full width on mobile */
    }

    .nav-link {
        width: 100%;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        color: var(--text-light); /* Light text for dark mobile menu */
    }

    .nav-link:last-child { border-bottom: none; }
    .nav-link:hover, .nav-link.active { background-color: rgba(255,255,255,0.1); color: var(--primary-color); }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 15px;
        gap: 20px;
    }

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

    /* Mobile content overflow protection */
    .page-content img {
      max-width: 100% !important;
      height: auto !important;
      display: block;
    }
    .page-content {
      overflow-x: hidden;
      max-width: 100%;
    }
    body {
      overflow-x: 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;
  }
}
