/* ================================================== */
/* === COMMON HEADER & NAVIGATION STYLES V2.0 ======= */
/* === 统一移动端样式 - 所有页面通用 ================ */
/* ================================================== */

/* === RESET === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* 防止移动端地址栏变化导致的布局问题 */
    height: 100%;
    height: -webkit-fill-available;
}

/* === LAYOUT VARIABLES (由 JS 动态更新，提供稳定的 fixed 顶部布局) === */
:root {
    --vv-top: 0px;      /* 保留但不用于位移（某些机型会导致悬浮条“跑下来”） */
    --header-h: 100px;  /* header 实际高度 */
    --nav-h: 55px;      /* nav 实际高度（移动端为 0，桌面端为真实高度） */
}

/* === BODY BASE === */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #e8e8e8;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0a0e27 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    width: 100%;
    /* 为 fixed 的 header + nav 让出空间（避免滚动时变量变化导致页面抖动） */
    padding-top: calc(var(--header-h) + var(--nav-h));
    -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
}

/* 仅在滚动过程中短暂关闭 blur，避免 iOS/部分浏览器 fixed+backdrop-filter 下滑时偶发“消失/闪烁”
   停止滚动后 JS 会立刻移除 is-scrolling，从而恢复原样（静态样式不变） */
html.is-scrolling .main-header,
html.is-scrolling .main-nav,
body.is-scrolling .main-header,
body.is-scrolling .main-nav {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* === CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ================================================== */
/* === HEADER - DESKTOP ============================ */
/* ================================================== */
.main-header {
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #ffd700;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.1);
    /* 固定贴顶，避免 vv-top 在部分机型上导致悬浮条下移 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Logo + Text 水平排列（桌面端） */
.logo-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 10px;
}

.logo-text h1 {
    font-size: 1.5em;
    color: #ffd700;
    margin-bottom: 3px;
    font-weight: 700;
}

.logo-text p {
    font-size: 0.85em;
    color: #a0a0a0;
}

/* ================================================== */
/* === HEADER CTA BUTTONS - DESKTOP ================ */
/* ================================================== */
.header-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.header-cta .btn {
    flex: 0 0 auto;
    min-width: 160px;
}

/* ================================================== */
/* === BUTTONS ===================================== */
/* ================================================== */
.btn {
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #ffcc00 0%, #ffeb3b 100%);
    color: #0d0d0d !important;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4);
    border: 3px solid #ff9800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 204, 0, 0.6);
    background: linear-gradient(135deg, #ffeb3b 0%, #fff176 100%);
}

.btn-outline {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    border: 3px solid #ff5722;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-outline:hover {
    background: linear-gradient(135deg, #ff8c42 0%, #ffa726 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6);
}

/* ================================================== */
/* === NAVIGATION - DESKTOP ======================== */
/* ================================================== */
.main-nav {
    background: rgba(26, 31, 58, 0.95);
    padding: 0;
    border-bottom: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: max-height 0.4s ease;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links > li {
    position: relative;
}

.nav-links > li > a {
    color: #e8e8e8;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    padding: 18px 25px;
    display: block;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links > li > a:hover {
    background: rgba(255, 204, 0, 0.15);
    color: #ffeb3b;
}

.dropdown-arrow {
    font-size: 0.7em;
    margin-left: 5px;
    transition: transform 0.3s;
}

.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* ================================================== */
/* === DROPDOWN MENU - DESKTOP ===================== */
/* ================================================== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: rgba(10, 14, 39, 0.98);
    border: 2px solid rgba(255, 204, 0, 0.3);
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    list-style: none;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    color: #e8e8e8;
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.dropdown-menu a:hover {
    background: rgba(255, 204, 0, 0.15);
    border-left-color: #ffeb3b;
    color: #ffeb3b;
    padding-left: 25px;
}

/* ================================================== */
/* === MOBILE MENU TOGGLE - HIDDEN ON DESKTOP ====== */
/* ================================================== */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 204, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 8px;
    width: 48px;
    height: 48px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 204, 0, 0.2);
    transform: scale(1.05);
}

.mobile-menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: #ffd700;
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ================================================== */
/* === FOOTER ====================================== */
/* ================================================== */
.main-footer {
    background: rgba(10, 14, 39, 0.95);
    border-top: 2px solid rgba(255, 215, 0, 0.3);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #ffd700;
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    color: #808080;
    font-size: 0.9em;
}

/* ================================================== */
/* ================================================== */
/* === MOBILE STYLES (768px and below) ============= */
/* === 使用 !important 确保覆盖所有内联样式 ========= */
/* ================================================== */
/* ================================================== */

@media (max-width: 768px) {
    /* 移动端：保持与之前一致的 fixed 悬浮样式 */
    
    /* ============================================== */
    /* === HEADER - MOBILE FIXED =================== */
    /* ============================================== */
    .main-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        /* 注意：移动端使用 100vw 容易在某些浏览器产生横向偏移/溢出，导致看起来"偏右" */
        height: auto !important;
        min-height: 195px !important;
        max-height: none !important;
        z-index: 9999 !important;
        background: #0a0e27 !important;
        /* 关键：移动端背景不透明，关闭 backdrop-filter 不会改变视觉样式，但能避免下滑时偶发消失/闪烁 */
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        /* iOS/部分 WebView：fixed 元素在滚动时偶发不绘制，避免强制合成层相关的 transform 提示 */
        -webkit-transform: none !important;
        transform: none !important;
        will-change: auto !important;
        overflow: visible !important;
        border-bottom: 3px solid #ffd700 !important;
        -webkit-backface-visibility: visible !important;
        backface-visibility: visible !important;
        contain: paint !important;
        isolation: isolate !important;
        padding-bottom: 15px !important;
        /* iOS 安全区域支持 */
        padding-top: env(safe-area-inset-top, 0) !important;
        padding-top: constant(safe-area-inset-top, 0) !important;
        /* 强制确保始终可见（防止浏览器渲染 bug） */
        visibility: visible !important;
        display: block !important;
        opacity: 1 !important;
    }
    
    /* ============================================== */
    /* === HEADER CONTENT - MOBILE LAYOUT ========== */
    /* ============================================== */
    .main-header .container {
        position: relative !important;
        padding: 15px 20px 10px 20px !important;
        max-width: 100% !important;
        overflow: visible !important;
    }
    
    .header-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: center !important;
        padding: 0 !important;
        position: relative !important;
        gap: 15px !important;
        overflow: visible !important;
        width: 100% !important;
    }
    
    /* ============================================== */
    /* === LOGO SECTION - MOBILE =================== */
    /* ============================================== */
    .logo-section {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        margin-bottom: 10px !important;
        width: auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Logo + Text 水平排列（移动端） */
    .logo-left {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }
    
    .logo-img {
        width: 65px !important;
        height: 65px !important;
    }
    
    .logo-text {
        text-align: left !important;
    }
    
    .logo-text h1 {
        font-size: 1.4em !important;
        color: #ffd700 !important;
        margin: 0 !important;
        margin-bottom: 2px !important;
    }
    
    .logo-text p {
        font-size: 0.8em !important;
        color: #a0a0a0 !important;
        margin: 0 !important;
    }
    
    /* ============================================== */
    /* === CTA BUTTONS - MOBILE (SIDE BY SIDE) ===== */
    /* ============================================== */
    .header-cta {
        display: flex !important;
        flex-direction: row !important;
        width: calc(100% - 20px) !important;
        gap: 10px !important;
        margin: 0 auto !important;
        padding: 0 10px !important;
        order: 2 !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 999 !important;
        flex-shrink: 0 !important; /* 防止被压缩 */
    }
    
    .header-cta .btn,
    .header-cta a.btn,
    .header-cta .btn-primary,
    .header-cta .btn-outline {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 1 1 45% !important;
        width: auto !important;
        max-width: 45% !important;
        min-width: 120px !important;
        padding: 14px 15px !important;
        font-size: 0.9em !important;
        font-weight: 700 !important;
        border-radius: 30px !important;
        text-align: center !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
        overflow: visible !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
    }
    
    .header-cta .btn-primary {
        background: linear-gradient(135deg, #ffcc00 0%, #ffeb3b 100%) !important;
        color: #0d0d0d !important;
        border: 3px solid #ff9800 !important;
        box-shadow: 0 4px 15px rgba(255, 204, 0, 0.5) !important;
    }
    
    .header-cta .btn-outline {
        background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%) !important;
        color: #ffffff !important;
        border: 3px solid #ff5722 !important;
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.5) !important;
    }
    
    /* ============================================== */
    /* === HAMBURGER MENU BUTTON - MOBILE ========== */
    /* ============================================== */
    .mobile-menu-toggle {
        display: flex !important;
        position: absolute !important;
        top: 15px !important;
        right: 0 !important;
        z-index: 1001 !important;
        width: 48px !important;
        height: 48px !important;
        background: rgba(255, 204, 0, 0.15) !important;
        border: 2px solid #ffd700 !important;
        border-radius: 10px !important;
    }
    
    .mobile-menu-toggle span {
        width: 26px !important;
        height: 3px !important;
        background: #ffd700 !important;
    }
    
    /* ============================================== */
    /* === NAVIGATION - MOBILE ===================== */
    /* ============================================== */
    .main-nav {
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.4s ease !important;
        position: fixed !important;
        top: var(--header-h) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        transform: translateX(0) !important;
        z-index: 999 !important;
        border-bottom: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        -webkit-transform: none !important;
        transform: none !important;
        will-change: auto !important;
        overflow-x: hidden !important;
        contain: paint !important;
        isolation: isolate !important;
        /* 强制确保元素本身可见（防止浏览器渲染 bug，即使 max-height=0 也保持元素存在） */
        visibility: visible !important;
        display: block !important;
    }

    /* 让移动端菜单内容以屏幕为基准居中（不被 container padding 推偏） */
    .main-nav .container {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .main-nav.mobile-open {
        /* 打开时改为可滚动容器，避免下拉内容被截断、无法下滑 */
        max-height: none !important;
        height: calc(100vh - var(--header-h)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        padding-bottom: 24px !important;
        /* 强制确保打开时始终可见 */
        visibility: visible !important;
        display: block !important;
        opacity: 1 !important;
    }
    
    .nav-links {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
    }
    
    .nav-links > li {
        width: 100% !important;
        border-bottom: 1px solid rgba(255, 204, 0, 0.1) !important;
    }
    
    .nav-links > li > a {
        padding: 16px 20px !important;
        text-align: center !important;
        font-size: 1em !important;
    }
    
    /* ============================================== */
    /* === DROPDOWN MENU - MOBILE ================== */
    /* ============================================== */
    .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        border-radius: 0 !important;
        border: none !important;
        border-top: 1px solid rgba(255, 204, 0, 0.2) !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.3s ease, padding 0.3s ease !important;
        padding: 0 !important;
        background: rgba(10, 14, 39, 0.95) !important;
        box-shadow: none !important;
    }
    
    .has-dropdown.menu-open .dropdown-menu {
        max-height: 900px !important;
        padding: 10px 0 !important;
    }
    
    .dropdown-menu a {
        padding: 14px 40px !important;
        text-align: center !important;
    }
    
    .dropdown-menu a:hover {
        padding-left: 40px !important;
    }
    
    /* ============================================== */
    /* === FOOTER - MOBILE ========================= */
    /* ============================================== */
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }
    
    .footer-section {
        text-align: center !important;
    }
    
    .footer-section h4 {
        font-size: 1.1em !important;
    }
    
    .footer-section a {
        font-size: 0.9em !important;
    }
}

/* ================================================== */
/* === VERY SMALL SCREENS (480px and below) ======== */
/* ================================================== */
@media (max-width: 480px) {
    .main-header {
        min-height: 180px !important;
        height: auto !important;
        padding-bottom: 10px !important;
    }
    
    .main-nav {
        top: var(--header-h) !important;
    }
    
    .logo-section {
        gap: 10px !important;
    }
    
    .logo-img {
        width: 55px !important;
        height: 55px !important;
    }
    
    .logo-text h1 {
        font-size: 1.2em !important;
    }
    
    .logo-text p {
        font-size: 0.75em !important;
    }
    
    .header-cta .btn,
    .header-cta a.btn {
        padding: 12px 8px !important;
        font-size: 0.85em !important;
    }
    
    .mobile-menu-toggle {
        width: 44px !important;
        height: 44px !important;
        top: 12px !important;
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ================================================== */
/* === ANIMATIONS ================================== */
/* ================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4);
    }
    50% {
        box-shadow: 0 6px 25px rgba(255, 204, 0, 0.6);
    }
}

@keyframes pulse-orange {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    }
    50% {
        box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
    }
}