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

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

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

a:hover {
    text-decoration: underline;
}

/* --- Header Styles --- */
.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, specific sections will override */
}

.header-top {
    box-sizing: border-box;
    min-height: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #1A8ECB; /* Darker shade of primary for header-top */
    width: 100%;
    padding: 0 20px; /* Base padding for smaller desktops */
}

.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; /* Handled by flex children margin/gap and media queries */
}

.hamburger-menu {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    padding: 5px;
    z-index: 1001; /* Above header */
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-color-light);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block; /* Ensure it's not inline for flex properties */
    padding: 0; /* Handled by flex container */
}

.logo img {
    display: block;
    max-height: 60px;
    height: auto;
    width: auto;
    max-width: 280px;
    object-fit: contain;
}

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    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 */
}

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

.btn-register:hover {
    background-color: #1a8ecb; /* Slightly darker primary */
    transform: translateY(-1px);
}

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

.btn-login:hover {
    background-color: #d16b06; /* Slightly darker login color */
    transform: translateY(-1px);
}

.mobile-nav-buttons {
    box-sizing: border-box;
    display: none; /* Hidden by default on desktop */
    min-height: 48px;
}

.main-nav {
    box-sizing: border-box;
    min-height: 52px;
    height: 52px;
    display: flex; /* Desktop: visible, row */
    align-items: center;
    overflow: hidden;
    background-color: var(--secondary-color); /* White for main nav */
    width: 100%;
    border-top: 1px solid rgba(0,0,0,0.05); /* Subtle separator */
}

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

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}

.main-nav ul li a {
    display: block;
    padding: 10px 0;
    color: var(--text-color-dark);
    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    color: var(--primary-color);
    text-decoration: none;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 998; /* Below mobile nav, above content */
    display: none; /* Hidden by default */
}

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

/* --- Footer Styles --- */
.site-footer {
    background-color: #222222; /* Dark background for footer */
    color: #CCCCCC;
    padding: 40px 20px 20px;
    font-size: 14px;
    line-height: 1.8;
}

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

.site-footer a:hover {
    text-decoration: underline;
}

.footer-top-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto 30px;
}

.footer-col h3 {
    color: var(--text-color-light);
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

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

.footer-description {
    margin-bottom: 15px;
    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 li a {
    color: #CCCCCC;
    transition: color 0.3s ease;
}

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

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

/* Dynamic slot anchors - ensure they are visible and not hidden */
.footer-slot-anchor-inner {
    min-height: 1px; /* Ensure it takes up space even if empty */
    width: 100%;
}

.footer-mid-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
}

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

    body {
        padding-top: var(--header-offset);
        overflow-x: hidden;
    }
    .page-content img {
      max-width: 100% !important;
      height: auto !important;
      display: block;
    }
    .page-content {
      overflow-x: hidden;
      max-width: 100%;
    }
    body {
      overflow-x: hidden;
    }

    /* Header adjustments */
    .site-header {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .header-top {
        min-height: 60px !important;
        height: 60px !important;
        padding: 0 15px; /* Smaller padding for mobile */
    }

    .header-container {
        width: 100%;
        max-width: none; /* No max-width on mobile */
        padding: 0; /* Let children handle spacing */
        position: relative; /* For absolute logo centering */
    }

    .hamburger-menu {
        display: flex; /* Show hamburger on mobile */
        position: absolute;
        left: 15px; /* Align to left edge */
        top: 50%;
        transform: translateY(-50%);
        width: 25px; /* Adjust size for mobile */
        height: 20px;
    }
    .hamburger-menu span {
        background-color: var(--text-color-light); /* Ensure visibility */
    }

    /* Mobile Logo Centering (Method 2 - Absolute Positioning for robust 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 and potential right element */
        font-size: 24px; /* Adjust font size for mobile */
    }
    .logo img {
        max-height: 56px !important; /* Adjust for mobile header height */
        max-width: 100%; /* Ensure image fits */
    }


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

    .mobile-nav-buttons {
        display: flex !important; /* Show mobile buttons */
        min-height: 48px;
        align-items: center;
        justify-content: center; /* Center buttons if less than 2 */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 8px 15px;
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap; /* Keep buttons on one line */
        background-color: var(--secondary-color); /* Match main nav background */
        border-top: 1px solid rgba(0,0,0,0.05);
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px); /* Max width for 2 buttons with 10px gap */
        box-sizing: border-box;
        padding: 8px 12px; /* Smaller padding for mobile buttons */
        font-size: 13px; /* Smaller font for mobile buttons */
        white-space: normal; /* Allow text wrap */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .main-nav {
        display: none; /* Hidden by default on mobile */
        position: fixed; /* Fixed position for slide-in menu */
        top: var(--header-offset); /* Position below fixed header and mobile buttons */
        left: 0;
        width: 80%; /* Menu width */
        max-width: 300px; /* Max width for menu */
        height: calc(100% - var(--header-offset)); /* Fill remaining height */
        background-color: var(--text-color-light); /* White background for menu */
        flex-direction: column; /* Stack menu items vertically */
        transform: translateX(-100%); /* Start off-screen */
        transition: transform 0.3s ease;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
        z-index: 999; /* Above overlay, below hamburger */
        overflow-y: auto; /* Enable scrolling for long menus */
    }

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

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

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0; /* Remove gap for vertical list */
    }

    .main-nav ul li {
        width: 100%;
    }

    .main-nav ul li a {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        font-size: 16px;
    }
    .main-nav ul li:last-child a {
        border-bottom: none;
    }

    /* Footer adjustments */
    .footer-top-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        text-align: center;
    }
    .footer-col {
        margin-bottom: 20px;
    }
    .footer-col h3 {
        text-align: center;
    }
    .footer-nav {
        text-align: center;
    }
    .footer-nav li a {
        padding: 5px 0;
    }
    .footer-mid-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
