:root {
    --header-offset: 122px;
    --primary-color: #C61F1F;
    --secondary-color: #E53030;
    --button-gradient: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);
    --card-bg: #2A1212;
    --site-bg: #140C0C;
    --text-main: #FFF1E8;
    --border-color: #6A1E1E;
    --gold-color: #F3C54D;
    --deep-red: #7E0D0D;
}

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

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

a:hover {
    text-decoration: underline;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background-color: var(--site-bg); /* Base background for the entire fixed header */
}

.header-top {
    box-sizing: border-box;
    min-height: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: var(--deep-red); /* Distinct background for top bar */
    width: 100%;
    color: var(--text-main);
}

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

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--gold-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo:hover {
    text-decoration: none;
}

.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 {
    box-sizing: border-box;
    display: none; /* Hidden by default on desktop */
    min-height: 48px;
    background-color: var(--card-bg);
    padding: 8px 20px;
    width: 100%;
    justify-content: center; /* Center buttons on desktop if they were visible */
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-main);
    background: var(--button-gradient);
    border: none;
    transition: all 0.3s ease;
}

.btn:hover {
    opacity: 0.9;
    text-decoration: none;
}

.main-nav {
    box-sizing: border-box;
    min-height: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: var(--primary-color); /* Distinct background for main nav */
    width: 100%;
    color: var(--text-main);
    position: relative;
}

.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 {
    display: block;
    padding: 10px 15px;
    color: var(--text-main);
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.hamburger-menu {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1002;
    margin-right: 15px; /* Space between hamburger and logo */
}

.hamburger-menu .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    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);
}

/* Footer Styles */
.site-footer {
    background-color: var(--card-bg);
    color: var(--text-main);
    padding: 40px 0 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

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

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

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

.footer-description {
    color: var(--text-main);
    line-height: 1.8;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.footer-nav li a {
    color: var(--text-main);
    padding: 5px 0;
    display: block;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    color: var(--text-main);
}

.footer-bottom p {
    margin: 0;
}

.footer-slot-anchor {
    display: contents; /* Allows injected content to flow naturally */
}

.footer-slot-anchor-inner {
    /* Placeholder for dynamic content, must be visible */
    min-height: 1px; /* Ensure it takes up space even if empty */
}

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

    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 {
        min-height: 60px;
        height: 60px;
    }

    .header-container {
        padding: 0 15px;
        position: relative;
        justify-content: space-between;
    }

    .hamburger-menu {
        display: block;
        order: 0;
    }

    .logo {
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        font-size: 22px;
        order: 1;
        margin-left: -45px; /* Offset to visually center due to hamburger */
    }

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

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

    .mobile-nav-buttons {
        display: flex !important;
        min-height: 48px;
        height: auto; /* Allow height to adjust if text wraps */
        align-items: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 8px 15px;
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap;
        background-color: var(--card-bg);
    }

    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px); /* 50% minus half of the gap */
        box-sizing: border-box;
        padding: 8px 12px;
        font-size: 13px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .main-nav {
        position: fixed;
        top: var(--header-offset);
        left: 0;
        width: 80%; /* Adjust as needed */
        max-width: 300px;
        height: calc(100vh - var(--header-offset));
        background-color: var(--card-bg);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 20px 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: none; /* Hidden by default, shown by JS */
        z-index: 999;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    }

    .main-nav.active {
        transform: translateX(0);
        display: flex; /* Ensure it becomes visible when active */
    }

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

    .site-header .header-container::after {
        content: '';
        display: block;
        width: 30px; /* Placeholder to balance hamburger-menu on the left */
        order: 2;
    }

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

    .footer-col {
        text-align: center;
    }

    .footer-col-title {
        text-align: center;
    }

    .footer-nav li a {
        text-align: center;
    }

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