/* General reset & base styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #1F2D3D; /* Text Main */
    background-color: #F4F7FB; /* Background */
    padding-top: var(--header-offset); /* Important for fixed header */
    overflow-x: hidden; /* Prevent horizontal scroll on body */
}
a {
    text-decoration: none;
    color: #2F6BFF; /* Primary color for links */
}
a:hover {
    text-decoration: underline;
}
ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Root variables for header offset */
:root {
    --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px + 2px buffer */
}

/* Site Header - Fixed & Floating */
.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: #F4F7FB; /* Consistent background for the whole header */
}

/* Header Top - Logo & Buttons */
.header-top {
    box-sizing: border-box;
    min-height: 68px; /* Desktop height */
    height: 68px; /* Desktop height */
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #2F6BFF; /* Primary color for header-top */
    width: 100%;
    color: #FFFFFF; /* Text color for header-top */
}

.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; /* Padding for content inside container */
}

.logo {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #FFFFFF; /* White for logo on primary background */
    text-decoration: none;
    white-space: nowrap;
}
.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;
}
.desktop-nav-buttons .btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    color: #FFFFFF;
    text-decoration: none;
    background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%); /* Button gradient */
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.3s ease, transform 0.2s ease;
}
.desktop-nav-buttons .btn:hover {
    background: linear-gradient(180deg, #6FA3FF 0%, #4A8BFF 100%); /* Lighter gradient on hover */
    transform: translateY(-1px);
    text-decoration: none;
}

/* Mobile Navigation Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
    box-sizing: border-box;
    display: none; /* Hidden on desktop */
    min-height: 48px; /* Mobile min height */
    width: 100%;
    background-color: #F4F7FB; /* Background for mobile button bar */
    border-bottom: 1px solid #D6E2FF; /* Border color */
}

/* Main Navigation (Desktop) */
.main-nav {
    box-sizing: border-box;
    min-height: 52px; /* Desktop height */
    height: 52px; /* Desktop height */
    display: flex; /* Desktop default: flex for horizontal menu */
    align-items: center;
    overflow: hidden;
    background-color: #FFFFFF; /* Card BG for main-nav */
    width: 100%;
    border-bottom: 1px solid #D6E2FF; /* Border color */
}

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

.nav-menu {
    display: flex;
    gap: 25px;
}

.nav-menu li a {
    color: #1F2D3D; /* Text Main */
    font-weight: bold;
    padding: 5px 0;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-menu li a:hover {
    color: #2F6BFF; /* Primary color on hover */
    text-decoration: none;
}

/* Hamburger Menu (hidden by default on desktop) */
.hamburger-menu {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1001; /* Above header */
    width: 44px; /* Ensure click area */
    height: 44px;
}
.hamburger-menu::before,
.hamburger-menu::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: #FFFFFF; /* White for hamburger on primary background */
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}
.hamburger-menu::before {
    top: calc(50% - 6px);
}
.hamburger-menu::after {
    top: calc(50% + 6px);
}
.hamburger-menu.active::before {
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}
.hamburger-menu.active::after {
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}
/* Middle line of hamburger */
.hamburger-menu span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #FFFFFF;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}
.hamburger-menu.active span {
    opacity: 0;
}


/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
.mobile-menu-overlay.active {
    display: block;
}

/* Mobile specific styles */
@media (max-width: 768px) {
    :root {
        --header-offset: 110px; /* Mobile: 60px (header-top) + 48px (mobile-nav-buttons) = 108px + 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 Top - Mobile */
    .header-top {
        min-height: 60px !important;
        height: 60px !important;
    }
    .header-container {
        width: 100%;
        max-width: none; /* Important: remove max-width on mobile */
        padding: 0 15px; /* Smaller padding on mobile */
        justify-content: space-between; /* Space between hamburger and logo */
    }
    .logo {
        flex: 1 !important; /* Take remaining space */
        display: flex !important;
        justify-content: center !important; /* Center logo */
        align-items: center !important;
        font-size: 24px; /* Smaller font for mobile logo */
    }
    .logo img {
        max-height: 56px !important; /* Mobile max height */
    }

    /* Hamburger Menu - Mobile */
    .hamburger-menu {
        display: block;
        order: -1; /* Place it first */
        margin-right: auto; /* Push logo to center */
    }

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

    /* Mobile Buttons - Show on Mobile */
    .mobile-nav-buttons {
        display: flex !important; /* Show mobile buttons */
        min-height: 48px;
        align-items: center;
        justify-content: center; /* Center buttons horizontally */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0 15px; /* Padding for the button bar */
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap; /* Ensure buttons stay on one line */
        background-color: #F4F7FB; /* Consistent background */
        border-bottom: 1px solid #D6E2FF;
    }
    .mobile-nav-buttons .btn {
        flex: 1; /* Distribute space evenly */
        min-width: 0; /* Allow shrinking */
        max-width: calc(50% - 5px); /* Max width for two buttons with gap */
        box-sizing: border-box;
        padding: 8px 12px; /* Smaller padding */
        font-size: 13px; /* Smaller font size */
        white-space: normal; /* Allow text wrapping */
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: center;
    }

    /* Main Navigation (Mobile Drawer) */
    .main-nav {
        display: none; /* Hidden by default on mobile */
        position: fixed;
        top: var(--header-offset); /* Position below header */
        left: 0;
        width: 80%; /* Width of the mobile drawer */
        max-width: 300px; /* Max width for drawer */
        height: calc(100vh - var(--header-offset)); /* Full height below header */
        background-color: #FFFFFF; /* Card BG for drawer */
        flex-direction: column; /* Stack menu items vertically */
        padding: 20px 0;
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        transform: translateX(-100%); /* Start off-screen */
        transition: transform 0.3s ease;
        z-index: 1000; /* Below overlay, but above content */
        overflow-y: auto; /* Enable scrolling for long menus */
        border-right: 1px solid #D6E2FF;
    }
    .main-nav.active {
        display: flex; /* Show when active */
        transform: translateX(0); /* Slide in */
    }
    .nav-container {
        width: 100%;
        max-width: none; /* Important: remove max-width on mobile */
        padding: 0 15px; /* Smaller padding */
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        height: auto; /* Allow content to dictate height */
    }
    .nav-menu {
        flex-direction: column; /* Stack menu items vertically */
        width: 100%;
        gap: 0; /* Remove gap */
    }
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #F4F7FB; /* Light border between items */
    }
    .nav-menu li:last-child {
        border-bottom: none;
    }
    .nav-menu li a {
        padding: 12px 0;
        display: block;
        width: 100%;
        color: #1F2D3D;
    }

    body.no-scroll {
        overflow: hidden;
    }
}

/* Footer Styles */
.site-footer {
    background-color: #1F2D3D; /* Text Main as footer background */
    color: #FFFFFF;
    padding: 40px 20px 20px;
    font-size: 14px;
    line-height: 1.6;
}
.site-footer a {
    color: #6FA3FF; /* Auxiliary color for footer links */
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}

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

.footer-col h3 {
    color: #FFFFFF;
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
}

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

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

.footer-logo {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #FFFFFF;
    margin-bottom: 15px;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.footer-slot-anchor-inner {
    min-height: 10px; /* Ensure visibility for injection */
    display: block; /* Ensure it takes up space even if empty */
}

.footer-bottom {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;
    color: rgba(255, 255, 255, 0.6);
    /* border-top: 1px solid rgba(255, 255, 255, 0.1); */ /* Removed redundant border */
}
.footer-bottom a {
    /* Forbidden to have links in footer-bottom */
    color: inherit;
    text-decoration: none;
    pointer-events: none;
}


@media (max-width: 768px) {
    .footer-top-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
    .site-footer {
        padding: 30px 15px 15px;
    }
    .footer-bottom {
        padding-top: 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;
  }
}
/* 内容保护（系统追加，请勿删除） */
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;
}
