/* General Reset & Body Styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #FFF1E8; /* Text Main */
    background-color: #140C0C; /* Background */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--header-offset); /* Fixed header offset */
    overflow-x: hidden; /* Prevent horizontal scroll on body */
}

a {
    text-decoration: none;
    color: inherit;
}

/* Color Variables */
:root {
    --primary-color: #C61F1F;
    --secondary-color: #E53030;
    --button-gradient: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);
    --card-bg: #2A1212;
    --background-color: #140C0C;
    --text-main: #FFF1E8;
    --border-color: #6A1E1E;
    --gold-color: #F3C54D;
    --deep-red: #7E0D0D;

    /* Header Offset Calculation: Desktop 68px (header-top) + 52px (main-nav) = 120px. Add 2px for safety. */
    --header-offset: 122px;
}

/* Site Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    background-color: var(--background-color); /* Fallback, main parts have specific colors */
}

/* Header Top Area */
.header-top {
    box-sizing: border-box;
    min-height: 68px;
    height: 68px; /* Fixed height for desktop */
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: var(--deep-red); /* Different from main-nav */
    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 30px; /* Padding for logo and buttons */
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--gold-color); /* Gold color for logo text */
    text-transform: uppercase;
    display: flex;
    align-items: center;
    height: 100%;
}

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

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Mobile Navigation Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
    box-sizing: border-box;
    display: none; /* Hidden on desktop */
    min-height: 48px; /* Fixed height for mobile */
    background-color: var(--card-bg); /* Different background */
    width: 100%;
    padding: 0 15px; /* Mobile padding */
}

/* Main Navigation */
.main-nav {
    box-sizing: border-box;
    min-height: 52px;
    height: 52px; /* Fixed height for desktop */
    display: flex; /* Desktop default: flex */
    align-items: center;
    overflow: hidden;
    background-color: var(--primary-color); /* Different from header-top */
    width: 100%;
}

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

.nav-link {
    color: var(--text-main);
    padding: 0 15px;
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
    transition: color 0.3s ease, background-color 0.3s ease;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--gold-color);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
    display: none; /* Hidden on desktop */
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 1001; /* Above header */
}

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

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu span:nth-child(3) { bottom: 0; }

.hamburger-menu.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* Buttons */
.btn {
    background: var(--button-gradient);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

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

.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(--gold-color);
    font-size: 18px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-col p {
    color: var(--text-main);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

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

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

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

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

.footer-bottom p {
    margin: 0;
}

/* Dynamic Slot Anchor Styles (must be visible) */
.footer-slot-anchor-inner {
    min-height: 1px; /* Ensure visibility for injection */
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Header Offset Calculation: Mobile 60px (header-top) + 48px (main-nav) = 108px. Add 2px for safety. */
    :root {
        --header-offset: 110px;
    }

    body {
        overflow-x: hidden; /* Ensure body doesn't scroll horizontally */
    }

    /* Mobile Header Top */
    .header-top {
        min-height: 60px;
        height: 60px; /* Fixed height for mobile */
        padding: 0 15px; /* Mobile padding */
        justify-content: space-between; /* Space out hamburger and logo */
    }

    .header-container {
        width: 100%;
        max-width: none; /* No max-width on mobile */
        padding: 0; /* Handled by header-top padding */
        position: relative; /* For absolute logo centering */
        justify-content: flex-start; /* Reset desktop justify */
    }

    /* Mobile Logo Centering (Method 2 for image, but text logo works with flex) */
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        max-width: calc(100% - 100px); /* Leave space for hamburger */
        z-index: 1; /* Below hamburger */
        font-size: 24px; /* Adjust font size for mobile */
    }

    .logo img {
        max-height: 56px; /* Max height for mobile logo */
    }

    /* Hamburger Menu (visible on mobile) */
    .hamburger-menu {
        display: block; /* Visible on mobile */
        order: -1; /* Place at the beginning of flex container */
    }

    /* Desktop Nav Buttons (hidden on mobile) */
    .desktop-nav-buttons {
        display: none !important;
    }

    /* Mobile Nav Buttons (visible on mobile, below header-top, above main-nav) */
    .mobile-nav-buttons {
        display: flex !important; /* Visible on mobile */
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%; /* Ensure full width */
        box-sizing: border-box;
        padding: 8px 15px; /* Adjust padding */
        gap: 10px;
        flex-wrap: nowrap; /* Prevent buttons from wrapping */
        background-color: var(--card-bg); /* Use card background for this strip */
    }

    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px); /* Max width for two buttons with gap */
        padding: 8px 12px; /* Smaller padding for mobile buttons */
        font-size: 13px; /* Smaller font size for mobile buttons */
        white-space: normal; /* Allow text to wrap */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Mobile Main Navigation (hidden by default, fixed to left) */
    .main-nav {
        display: none; /* Hidden by default on mobile */
        position: fixed;
        top: var(--header-offset); /* Below fixed header */
        left: 0;
        width: 280px; /* Sidebar width */
        height: calc(100% - var(--header-offset)); /* Full height below header */
        flex-direction: column; /* Vertical menu */
        justify-content: flex-start;
        background-color: var(--background-color);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
        transform: translateX(-100%); /* Off-screen by default */
        transition: transform 0.3s ease;
        overflow-y: auto; /* Scroll for long menus */
        padding-top: 20px;
    }

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

    .nav-container {
        flex-direction: column; /* Vertical links */
        align-items: flex-start;
        padding: 0; /* Reset desktop padding */
        max-width: none; /* No max-width on mobile */
        width: 100%;
        height: auto; /* Allow content to dictate height */
    }

    .nav-link {
        width: 100%;
        padding: 12px 20px; /* Larger padding for mobile links */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        justify-content: flex-start;
    }

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

    /* Overlay for mobile menu */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 999; /* Below menu, above content */
        transition: opacity 0.3s ease;
        opacity: 0;
    }

    .overlay.active {
        display: block;
        opacity: 1;
    }

    /* Prevent body scroll when menu is open */
    body.no-scroll {
        overflow: hidden;
    }

    /* Footer Mobile */
    .footer-top-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        margin-bottom: 20px;
    }

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

    .footer-col:last-child {
        margin-bottom: 0;
    }

    .footer-bottom {
        padding-top: 15px;
    }

    /* Mobile Content Image Overflow Protection */
    .page-content img {
      max-width: 100% !important;
      height: auto !important;
      display: block;
    }
    .page-content {
      overflow-x: hidden;
      max-width: 100%;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
