html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    padding-top: var(--header-offset);
    overflow-x: hidden;
}

:root {
    --primary-color: #26A9E0;
    --accent-color: #FFFFFF;
    --login-btn-color: #EA7C07;
    --background-color: #FFFFFF;
    --text-color: #000000;
    --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) */
}

.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(--accent-color); /* White background for the whole header */
}

.header-top {
    box-sizing: border-box;
    min-height: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: var(--primary-color); /* Primary color 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 20px; /* Inner padding for logo and buttons */
}

.logo {
    color: var(--accent-color);
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    display: flex; /* For vertical centering */
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}

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

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

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

.main-nav {
    box-sizing: border-box;
    min-height: 52px;
    height: 52px;
    display: flex; /* Displayed on desktop by default */
    align-items: center;
    overflow: hidden;
    background-color: #333; /* Darker background 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(--accent-color);
    text-decoration: none;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

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

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

.btn-register {
    background-color: var(--login-btn-color); /* Orange for register */
}

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

.btn-login {
    background-color: #007bff; /* A distinct blue for login */
}

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

.hamburger-menu {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

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

/* Footer Styles */
.site-footer {
    background-color: #222;
    color: #f0f0f0;
    padding: 40px 20px 20px;
    font-size: 15px;
}

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

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

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

.footer-description {
    line-height: 1.8;
    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: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    font-size: 14px;
}

.footer-bottom p {
    margin: 0;
    color: #aaa;
}

/* Ensure slot anchors are visible and not hidden */
.footer-slot-anchor-inner {
    min-height: 1px; /* Ensure it takes up minimal space */
    display: block;
}

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

    .site-header {
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    }

    .header-top {
        position: relative; /* For absolute positioning of logo */
        min-height: 60px !important;
        height: 60px !important;
        padding: 0 15px; /* Padding for hamburger */
    }

    .header-container {
        width: 100%;
        max-width: none;
        padding: 0;
        justify-content: space-between;
        position: static; /* Ensure it doesn't interfere with absolute logo */
    }

    .logo {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100%;
        max-width: calc(100% - 100px); /* Account for hamburger space and potential right space */
        z-index: 1; /* Below hamburger */
    }

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

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

    .mobile-nav-buttons {
        display: flex !important;
        min-height: 48px;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 8px 15px;
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap;
        background-color: #f0f0f0; /* Light background for mobile buttons */
        box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05);
    }

    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px); /* 50% minus half of 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, shown with .active */
        position: fixed;
        top: var(--header-offset); /* Position below fixed header and mobile buttons */
        left: 0;
        width: 70%; /* Slide out from left */
        height: calc(100vh - var(--header-offset));
        background-color: #333; /* Same as desktop main-nav */
        flex-direction: column;
        align-items: flex-start;
        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-out;
        z-index: 999;
        overflow-y: auto;
    }

    .main-nav.active {
        display: flex; /* Must set display to show */
        transform: translateX(0); /* Slide in */
    }

    .nav-container {
        flex-direction: column;
        width: 100%;
        max-width: none;
        padding: 0;
        align-items: flex-start;
    }

    .nav-link {
        width: 100%;
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 16px;
    }

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

    .hamburger-menu {
        display: block; /* Show hamburger on mobile */
        order: -1; /* Place on left */
        margin-left: -10px; /* Adjust padding */
        color: var(--accent-color);
        z-index: 2; /* Higher than logo */
    }

    .mobile-overlay {
        display: block; /* Hidden by default, shown with JS */
    }

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

    .footer-top-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col h3 {
        margin-top: 25px;
    }

    .footer-about .footer-logo, .footer-about .footer-description {
        text-align: center;
    }
    .footer-nav {
        text-align: center;
    }

    /* Prevent content images from overflowing */
    .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 no scroll for mobile menu */
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;
}
