:root {
    --primary-color: #26A9E0;
    --secondary-color: #FFFFFF;
    --login-color: #EA7C07;
    --text-color: #333333;
    --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px (buffer) */
}

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); /* Background: #FFFFFF */
    overflow-x: hidden; /* Added for overall mobile content protection */
}

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

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: var(--secondary-color); /* Default background, individual sections will override */
}

.header-top {
    box-sizing: border-box;
    min-height: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #005689; /* Darker blue for header-top, contrasting with main-nav */
    width: 100%;
    color: var(--secondary-color);
}

.header-container {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    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-transform: uppercase;
    display: block;
    line-height: 1; /* Ensure text logo aligns well */
}
.logo img {
    display: block;
    max-height: 60px; /* Desktop max-height */
    height: auto;
    width: auto;
    max-width: 280px;
    object-fit: contain;
}

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

.mobile-nav-buttons {
    box-sizing: border-box;
    display: none; /* Hidden by default on desktop */
    min-height: 48px; /* Fixed height for mobile button row */
    background-color: #1E88B2; /* Slightly different blue for mobile button row */
    padding: 0 20px;
}

.main-nav {
    box-sizing: border-box;
    min-height: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: var(--primary-color); /* Primary color for main-nav */
    width: 100%;
}

.nav-container {
    box-sizing: border-box;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.nav-link {
    color: var(--secondary-color);
    padding: 0 15px;
    font-weight: bold;
    font-size: 15px;
    line-height: 52px; /* Match main-nav height */
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

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

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

.btn-login {
    background-color: var(--login-color); /* #EA7C07 */
}

.btn-login:hover {
    background-color: #CC6A06;
    transform: translateY(-1px);
}

.btn-register {
    background-color: var(--primary-color); /* #26A9E0 */
}

.btn-register:hover {
    background-color: #1E88B2;
    transform: translateY(-1px);
}

.hamburger-menu {
    display: none; /* Hidden by default on desktop */
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 1001; /* Above header-top content */
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu span:nth-child(3) { bottom: 0; }

.hamburger-menu.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

.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: #000000; /* Use #000000 for footer background */
    color: #CCCCCC;
    padding: 40px 20px 20px;
    font-size: 14px;
    line-height: 1.8;
}

.footer-top-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column; /* Default to column for mobile first, then grid for desktop */
    gap: 30px;
}

.footer-cols-wrapper {
    display: grid;
    grid-template-columns: 1fr; /* Default single column for mobile */
    gap: 30px;
}

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

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

.footer-description {
    margin-bottom: 15px;
    color: #AAAAAA;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.footer-nav li {
    margin-bottom: 8px;
}

.footer-nav a {
    color: #CCCCCC;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    max-width: 1200px;
    margin: 30px auto 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    color: #AAAAAA;
}

.footer-bottom p {
    margin: 0;
}

/* Dynamic slot anchors */
.footer-slot-anchor-inner {
    min-height: 1px; /* Ensure visibility for system injection */
}


/* Responsive Styles */
@media (max-width: 768px) {
    :root {
        --header-offset: 110px; /* 60px (header-top) + 48px (mobile-nav-buttons) + 2px (buffer) */
    }

    .site-header {
        box-sizing: border-box;
    }

    .header-top {
        min-height: 60px !important;
        height: 60px !important;
        padding: 0 15px; /* Smaller padding for mobile */
        justify-content: space-between; /* Ensure space between hamburger and logo */
    }

    .header-container {
        width: 100%;
        max-width: none; /* No max-width on mobile */
        padding: 0; /* Handled by header-top padding */
        position: relative; /* For absolute logo centering */
    }

    .logo {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        max-width: calc(100% - 100px); /* Leave space for hamburger */
        font-size: 24px;
    }
    .logo img {
        max-height: 56px !important; /* Mobile max-height */
        max-width: 100%;
        height: auto;
    }

    .hamburger-menu {
        display: block; /* Show hamburger on mobile */
        margin-left: 0; /* Reset margin */
        order: -1; /* Place it at the beginning */
        width: 28px;
        height: 22px;
    }

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

    .mobile-nav-buttons {
        display: flex !important; /* Show mobile buttons */
        min-height: 48px;
        height: auto; /* Allow content to dictate height */
        align-items: center;
        justify-content: center; /* Center buttons if only one */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 8px 15px;
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px); /* Max width for two buttons with gap */
        box-sizing: border-box;
        padding: 8px 12px;
        font-size: 13px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .main-nav {
        display: none; /* Hidden by default for mobile menu */
        flex-direction: column;
        position: fixed;
        top: var(--header-offset); /* Below the header and mobile buttons */
        left: 0;
        width: 80%; /* Sidebar width */
        height: calc(100% - var(--header-offset)); /* Full height below header */
        background-color: var(--primary-color);
        transform: translateX(-100%); /* Slide out to the left */
        transition: transform 0.3s ease;
        z-index: 1000;
        overflow-y: auto; /* Enable scrolling for long menus */
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    }

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

    .nav-container {
        width: 100%;
        max-width: none; /* No max-width on mobile */
        flex-direction: column;
        align-items: flex-start; /* Align menu items to the left */
        padding: 20px 15px;
    }

    .nav-link {
        width: 100%;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        line-height: 1.2;
        font-size: 16px;
    }

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

    .overlay.active {
        display: block;
    }

    /* Footer Responsive */
    .footer-top-grid {
        padding: 0 15px;
    }

    .footer-cols-wrapper {
        grid-template-columns: 1fr; /* Stack columns on mobile */
    }

    .footer-bottom {
        padding: 20px 15px 0;
    }

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

/* High contrast for text on various backgrounds */
.header-top .logo, .header-top .btn, .header-top .hamburger-menu span {
    color: var(--secondary-color); /* White text on dark blue */
}
.main-nav .nav-link {
    color: var(--secondary-color); /* White text on primary blue */
}
.btn-login {
    color: var(--secondary-color); /* White text on orange */
}
.btn-register {
    color: var(--secondary-color); /* White text on primary blue */
}
.site-footer {
    color: #CCCCCC; /* Light grey text on black */
}
.footer-col h3 {
    color: var(--secondary-color); /* White text on black */
}
.footer-nav a {
    color: #CCCCCC; /* Light grey text on black */
}
.footer-bottom p {
    color: #AAAAAA; /* Grey text on black */
}
.body.no-scroll {
    overflow: hidden;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
/* 内容保护（系统追加，请勿删除） */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
