/* General Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #FFFFFF; /* Custom color for Background */
    padding-top: var(--header-offset); /* Important for fixed header */
}

a {
    text-decoration: none;
    color: #26A9E0; /* Primary color */
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Header Variables & Fixed Positioning */
:root {
    --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px (buffer) */
    --primary-color: #26A9E0;
    --secondary-color: #FFFFFF;
    --login-button-color: #EA7C07;
    --text-color: #000000;
}

.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); /* Fallback, actual sections have specific colors */
}

/* Header Top Section (Desktop Default) */
.header-top {
    box-sizing: border-box;
    min-height: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #1C7BB4; /* Darker blue for header-top */
    width: 100%;
}

.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 30px; /* Adjusted padding */
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--secondary-color); /* White text for logo on dark background */
    display: flex; /* For potential image logo alignment */
    align-items: center;
    text-decoration: none;
}

/* Logo Image Styling (if any) */
.logo img {
    display: block;
    max-height: 60px; /* Desktop max height */
    height: auto;
    width: auto;
    max-width: 280px;
    object-fit: contain;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Mobile Navigation Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
    box-sizing: border-box;
    display: none; /* Hidden on desktop */
    min-height: 48px; /* Placeholder height, actual height will be content-based */
    background-color: var(--secondary-color); /* White background for mobile buttons */
    width: 100%;
    padding: 0 15px; /* Mobile padding */
}

/* Main Navigation Section (Desktop Default) */
.main-nav {
    box-sizing: border-box;
    min-height: 52px;
    height: 52px;
    display: flex; /* Displayed on desktop */
    align-items: center;
    overflow: hidden;
    background-color: var(--primary-color); /* Primary light blue 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;
    gap: 25px; /* Spacing between nav links */
}

.nav-link {
    color: var(--secondary-color); /* White text for nav links */
    font-weight: bold;
    padding: 5px 0;
    white-space: nowrap; /* Prevent wrapping */
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #e0f2f7; /* Lighter shade on hover */
    text-decoration: none;
}

/* Hamburger Menu (hidden by default on desktop) */
.hamburger-menu {
    display: none; /* Hidden on desktop */
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1001; /* Above other header elements */
    margin-left: 20px; /* Space from right edge of desktop-nav-buttons */
}

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

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

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

/* Overlay for 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;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* Buttons General Styling */
.btn {
    padding: 10px 18px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-decoration: none; /* Remove underline for buttons */
}

.btn-register {
    background-color: var(--login-button-color); /* Custom color for Login */\    color: var(--secondary-color);
    border: none;
}

.btn-register:hover {
    background-color: #d16e06; /* Slightly darker on hover */
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-login {
    background-color: var(--secondary-color);
    color: var(--text-color); /* Black text for login button */
    border: 1px solid #ccc;
}

.btn-login:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Footer Styles */
.site-footer {
    background-color: #333; /* Dark background for footer */
    color: #f0f0f0; /* Light text color */
    padding-top: 40px;
    font-size: 14px;
}

.footer-top-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    padding-bottom: 40px;
    border-bottom: 1px solid #444;
}

.footer-col h3 {
    color: var(--primary-color); /* Primary color for footer headings */
    font-size: 16px;
    margin-bottom: 15px;
}

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

.footer-col .footer-description {
    line-height: 1.8;
    color: #ccc;
    word-wrap: break-word; /* Ensure description wraps */
    overflow-wrap: break-word;
}

.footer-nav {
    margin-top: 10px;
}

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

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

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

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 30px;
    text-align: center;
    color: #aaa;
}

.footer-bottom p {
    margin: 0;
}

/* Footer slot anchors should not be hidden */
.footer-slot-anchor, .footer-slot-anchor-inner {
    display: block;
    width: 100%;
    min-height: 1px; /* Small height to ensure presence */
}

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

    body {
        overflow-x: hidden;
    }

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

    /* Header Top Mobile */
    .header-top {
        min-height: 60px !important;
        height: 60px !important;
        padding: 0 15px;
    }

    .header-container {
        width: 100%;
        max-width: none; /* Remove max-width for mobile container */
        padding: 0; /* Remove padding here, handled by header-top */
        position: relative; /* For absolute positioning of logo if needed */
        justify-content: space-between; /* To place hamburger left, logo centered, desktop buttons hidden */
    }
    
    .hamburger-menu {
        display: block; /* Show hamburger on mobile */
        order: -1; /* Place hamburger first */
        margin-right: auto; /* Push logo to center */
        z-index: 1001; /* Ensure it's clickable */
        margin-left: 0; /* Reset desktop margin */
    }

    .logo {
        flex: 1 !important; /* Allow logo to take available space */
        display: flex !important;
        justify-content: center !important; /* Center logo */
        align-items: center !important;
        max-width: calc(100% - 100px); /* Adjust max-width to not overlap hamburger/buttons */
        position: absolute; /* Absolute positioning for true center */
        left: 50%;
        transform: translateX(-50%);
    }

    .logo img {
        max-height: 56px !important; /* Mobile max height */
    }

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

    /* Mobile Navigation Buttons */
    .mobile-nav-buttons {
        display: flex !important; /* Show mobile buttons */
        min-height: 48px;
        align-items: center;
        justify-content: center; /* Center buttons */
        background-color: var(--secondary-color); /* White background */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0 15px; /* Mobile padding */
        overflow: hidden; /* Prevent overflow */
        gap: 10px; /* Space between buttons */
        flex-wrap: nowrap; /* Prevent wrapping */
    }

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

    /* Main Navigation Mobile (Hamburger Menu Content) */
    .main-nav {
        display: none; /* Hidden by default */
        position: fixed;
        top: var(--header-offset); /* Position below header */
        left: 0;
        width: 280px; /* Width of the mobile menu */
        height: calc(100% - var(--header-offset));
        flex-direction: column;
        background-color: #333; /* Dark background for mobile menu */
        transform: translateX(-100%); /* Off-screen by default */
        transition: transform 0.3s ease;
        padding: 20px 0;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
        overflow-y: auto; /* Allow scrolling for long menus */
        z-index: 1000; /* Same as header, overlay is 999 */
    }

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

    .main-nav .nav-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 20px;
        gap: 15px;
        height: auto; /* Allow height to adjust to content */
        max-width: none; /* Remove max-width */
    }

    .main-nav .nav-link {
        color: var(--secondary-color);
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid #444;
    }
    
    .main-nav .nav-link:last-child {
        border-bottom: none;
    }

    /* Footer Mobile */
    .site-footer {
        padding-top: 30px;
    }

    .footer-top-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        padding: 0 15px;
        gap: 25px;
    }

    .footer-col {
        text-align: center; /* Center content in footer columns */
    }

    .footer-col h3 {
        margin-bottom: 10px;
    }

    .footer-col .footer-logo {
        margin-bottom: 10px;
    }

    .footer-nav {
        margin-top: 5px;
    }

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

    .footer-bottom {
        padding: 15px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
