:root {
    --primary-color: #E53935;
    --secondary-color: #FF5A4F;
    --text-main-color: #333333;
    --card-bg-color: #FFFFFF;
    --background-color: #F5F7FA;
    --border-color: #E0E0E0;
    --header-offset: 122px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-main-color);
    background-color: var(--background-color);
    margin: 0;
    padding-top: var(--header-offset);
    overflow-x: hidden;
}

/* Global container */
.header-container, .nav-container, .footer-top-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
    width: 100%;
}

/* Header styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-top {
    background-color: var(--primary-color); /* Distinct from main-nav */
    min-height: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
}

.header-top .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    color: var(--card-bg-color);
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    display: block;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.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;
}

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

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

.btn-primary {
    background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #333333; /* A dark neutral color for contrast */
    border: none;
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.main-nav {
    background-color: #333333; /* Different from header-top */
    min-height: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}

.main-nav .nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 25px;
}

.nav-link {
    color: var(--card-bg-color);
    text-decoration: none;
    font-weight: bold;
    padding: 5px 0;
    transition: color 0.3s ease;
    white-space: nowrap;
    font-size: 15px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary-color);
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-menu .bar {
    width: 100%;
    height: 3px;
    background-color: var(--card-bg-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Footer styles */
.site-footer {
    background-color: var(--text-main-color);
    color: #f0f0f0;
    padding: 40px 0 20px;
    font-size: 14px;
}

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

.footer-col {
    padding: 10px 0;
}

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

.footer-description {
    color: #cccccc;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.footer-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

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

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

.footer-nav a {
    color: #cccccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #cccccc;
}

.footer-bottom p {
    margin: 0;
}

.footer-slot-anchor-inner {
    min-height: 1px; /* Ensure anchor is rendered */
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 998;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive styles */
@media (max-width: 768px) {
    :root {
        --header-offset: 110px;
    }

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

    .header-top {
        min-height: 60px !important;
        height: 60px !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .header-top .header-container {
        justify-content: space-between;
        padding: 0;
        max-width: none;
        width: 100%;
        position: relative;
    }

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

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

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

    .hamburger-menu {
        display: flex;
        order: -1; /* Place it at the beginning */
        margin-right: auto; /* Push logo to center */
    }

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

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

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

    .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-left: 15px;
        padding-right: 15px;
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap;
        background-color: #222; /* Slightly darker than main-nav for distinction */
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px);
        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 */
        flex-direction: column;
        position: fixed;
        top: var(--header-offset);
        left: 0;
        width: 280px;
        height: calc(100% - var(--header-offset));
        background-color: #333333;
        padding: 20px 0;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
        transform: translateX(-100%); /* Off-screen */
        transition: transform 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        box-sizing: border-box;
    }

    .main-nav.active {
        display: flex; /* Show 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 content to dictate height */
        max-width: none;
        width: 100%;
    }

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

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

    .footer-top-grid {
        grid-template-columns: 1fr;
        padding-left: 15px;
        padding-right: 15px;
    }

    .footer-col {
        margin-bottom: 20px;
    }

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