/* =================================================================
 * Shanling Tech Header Cleaned & Upgraded Stylesheet (Performance Optimized)
 * 1. 基础全局防护与布局
 * ================================================================= */

/* 防重复 Header 隐写 */
#shanling-header ~ #shanling-header,
header#shanling-header + header#shanling-header,
#shanling-header .header-nav > ul ~ ul,
#shanling-header .header-nav ul li > a ~ a,
#shanling-header .header-nav a::before,
#shanling-header .header-nav a::after {
    display: none !important;
}

html {
    overflow-y: scroll !important;
    scrollbar-gutter: stable !important;
}

body {
    min-height: 101vh !important;
}

/* 基础 Header 定位 (首屏禁用 transition，彻底消除闪烁动画) */
#shanling-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid transparent;
    transform: translate3d(0, 0, 0);
    contain: layout style;
    /* 核心修复：初始进入页面时不加 transition 动画，防止进入页面时播放“透明变色”动画 */
    transition: none !important;
}

/* 滚动发生后 (is-scrolled) 开启渐变过渡 */
#shanling-header.is-scrolled {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(28px) saturate(180%) brightness(1.04) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.04) !important;
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.06) !important;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

/* 容器排版强效修正 */
#shanling-header .header-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding: 0 32px !important;
    height: 68px !important;
    gap: 16px !important;
    box-sizing: border-box !important;
}

/* Logo 样式 */
#shanling-header .header-logo {
    flex-shrink: 0 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    user-select: none !important;
}

#shanling-header .header-logo .logo-icon {
    width: 34px !important;
    height: 34px !important;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%) !important;
    border-radius: 9px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.4) !important;
}

#shanling-header .header-logo .logo-icon svg {
    width: 19px !important;
    height: 19px !important;
    fill: #fff !important;
}

#shanling-header .header-logo .logo-text {
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em !important;
    color: #ffffff !important;
    line-height: 1 !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
    transition: color 0.2s ease, text-shadow 0.2s ease !important;
}

#shanling-header .header-logo .logo-text span {
    color: #93c5fd !important;
    transition: color 0.2s ease !important;
}

/* 导航主列表（一级的样式） */
#shanling-header .header-nav {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

#shanling-header .header-nav > ul {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
}

#shanling-header .header-nav > ul > li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
}

/* 主导航一级链接 */
#shanling-header .header-nav > ul > li > a {
    display: inline-flex !important;
    align-items: center !important;
    padding: 7px 16px !important;
    font-size: 14.5px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.92) !important;
    text-decoration: none !important;
    border-radius: 20px !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#shanling-header .header-nav > ul > li .dropdown-arrow {
    font-size: 10px !important;
    margin-left: 4px !important;
    display: inline-block !important;
    opacity: 0.75 !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#shanling-header .header-nav > ul > li.menu-item-has-children:hover > a .dropdown-arrow {
    transform: rotate(180deg) !important;
    opacity: 1 !important;
}

#shanling-header .header-nav > ul > li > a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15) !important;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.15) !important;
}

#shanling-header .header-nav > ul > li.is-active > a {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2) !important;
    font-weight: 600 !important;
}


/* =================================================================
 * 2. 🛒 唯一生效：带右侧大图 + 中间分割线 + 左侧单列居中 Mega Menu 下拉菜单
 * ================================================================= */

/* 悬停防断连感应桥 */
#shanling-header .header-nav > ul > li.menu-item-has-children::after {
    content: '' !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    height: 16px !important;
}

/* 1) 下拉白色卡片容器 (580px 适度缩窄，精致感) */
#shanling-header .header-nav ul li .sub-menu.shopify-mega-menu {
    display: block !important;
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 50% !important;
    transform: translate(-50%, 8px) !important;
    
    width: 550px !important;
    padding: 24px !important;
    margin: 0 !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s !important;
    z-index: 99999 !important;
}

/* 2) Hover 展开 */
#shanling-header .header-nav ul li.menu-item-has-children:hover > .sub-menu.shopify-mega-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translate(-50%, 0) !important;
}

/* 3) 内部布局：Flex 左右排版 */
#shanling-header .shopify-mega-menu .mega-menu-inner {
    display: flex !important;
    align-items: stretch !important;
    gap: 24px !important;
}

/* 4) 左侧子菜单：单列垂直居中列表 */
#shanling-header .shopify-mega-menu .mega-menu-list {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;    /* 强制垂直纵向排列 */
    align-items: center !important;        /* 核心：菜单卡片整体水平居中 */
    gap: 12px !important;                  /* 间距 */
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#shanling-header .shopify-mega-menu .mega-menu-list li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 240px !important;           /* 居中包裹感限制 */
}

/* 核心修复：重置下拉字体颜色，居中显示 */
#shanling-header .header-nav ul li .sub-menu.shopify-mega-menu .mega-menu-list li a,
html body #shanling-header.is-scrolled .header-nav ul li .sub-menu.shopify-mega-menu .mega-menu-list li a {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    text-decoration: none !important;
    text-shadow: none !important;
    background: transparent !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    display: block !important;
    text-align: center !important;         /* 文字水平居中 */
    transition: all 0.15s ease !important;
}

/* 下拉菜单项 Hover */
#shanling-header .header-nav ul li .sub-menu.shopify-mega-menu .mega-menu-list li a:hover {
    color: #000000 !important;            /* Shopify 品牌高亮绿 */
    background: #f1f5f9 !important;
}

/* 5) 中间竖向灰色分割线 */
#shanling-header .shopify-mega-menu .mega-menu-divider {
    width: 1px !important;
    background-color: #e2e8f0 !important;
    flex-shrink: 0 !important;
    margin: 2px 0 !important;
}

/* 6) 右侧推荐大图 */
#shanling-header .shopify-mega-menu .mega-menu-featured {
    width: 240px !important;
    flex-shrink: 0 !important;
}

#shanling-header .shopify-mega-menu .featured-card {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    position: relative !important;
    text-decoration: none !important;
}

#shanling-header .shopify-mega-menu .featured-card img {
    width: 100% !important;
    height: 160px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 8px !important;
    transition: transform 0.3s ease !important;
}

#shanling-header .shopify-mega-menu .featured-card:hover img {
    transform: scale(1.04) !important;
}

#shanling-header .shopify-mega-menu .featured-title {
    display: block !important;
    margin-top: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    text-align: center !important;
}


/* =================================================================
 * 3. 按钮区域 (Login & Contact)
 * ================================================================= */

#shanling-header .header-actions {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

#shanling-header .btn-account {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px 16px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    border-radius: 20px !important;
    white-space: nowrap !important;
    letter-spacing: -0.01em !important;
    cursor: pointer !important;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease !important;
}

#shanling-header .btn-account:hover {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.75) !important;
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12) !important;
}

#shanling-header .btn-account svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0 !important;
    stroke: currentColor !important;
}

#shanling-header .btn-account.is-logged-in {
    border-radius: 20px !important;
    padding: 6px 14px 6px 8px !important;
    gap: 7px !important;
}

#shanling-header .btn-account .avatar-ring {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #3b82f6, #06b6d4) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

#shanling-header .btn-account .avatar-ring svg {
    width: 13px !important;
    height: 13px !important;
    stroke: #fff !important;
}

#shanling-header .btn-contact {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 18px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 20px !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease !important;
}

#shanling-header .btn-contact:hover {
    opacity: 0.92 !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-1px) !important;
}

#shanling-header .btn-contact svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
    stroke: currentColor !important;
}


/* =================================================================
 * 4. 页面向下滚动 (is-scrolled) 触发的主导航颜色反转（排除下拉菜单）
 * ================================================================= */

html body #shanling-header.is-scrolled .header-logo .logo-text,
html body #shanling-header.is-scrolled .header-logo .logo-text span,
html body #shanling-header.is-scrolled .header-nav > ul > li > a,
html body #shanling-header.is-scrolled .btn-account,
html body #shanling-header.is-scrolled .btn-account.is-logged-in {
    color: #0f172a !important;
    text-shadow: none !important;
}

#shanling-header.is-scrolled .header-nav > ul > li > a:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}

#shanling-header.is-scrolled .header-nav > ul > li.is-active > a {
    background: rgba(0, 0, 0, 0.08) !important;
}

#shanling-header.is-scrolled .btn-account,
#shanling-header.is-scrolled .btn-account.is-logged-in {
    border-color: rgba(0, 0, 0, 0.15) !important;
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

#shanling-header.is-scrolled .btn-account:hover {
    border-color: rgba(0, 0, 0, 0.3) !important;
    background: rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08) !important;
}

#shanling-header.is-scrolled .btn-contact {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

html body #shanling-header.is-scrolled .btn-contact,
html body #shanling-header.is-scrolled .btn-contact * {
    color: #ffffff !important;
}


/* =================================================================
 * 5. 移动端 Hamburger & 侧滑菜单
 * ================================================================= */

#shanling-header .hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
}

#shanling-header .hamburger-btn svg {
    width: 20px;
    height: 20px;
    stroke: rgba(255, 255, 255, 0.95);
    transition: stroke 0.2s ease, opacity 0.15s ease;
}

html body #shanling-header.is-scrolled .hamburger-btn svg,
html body #shanling-header.is-scrolled .hamburger-btn svg * {
    stroke: #0f172a !important;
    color: #0f172a !important;
}

#shanling-header .hamburger-btn .icon-close {
    display: none;
}

#shanling-header.mobile-open .hamburger-btn .icon-open {
    display: none;
}

#shanling-header.mobile-open .hamburger-btn .icon-close {
    display: block;
}

/* 移动端侧滑菜单面板 */
#shanling-mobile-menu {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow-y: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 24px 28px 48px;
    transform: translate3d(0, -6px, 0);
    opacity: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
    will-change: transform, opacity;
}

#shanling-mobile-menu.is-open {
    display: block;
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

#shanling-mobile-menu .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 20px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

#shanling-mobile-menu .mobile-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}

#shanling-mobile-menu .mobile-brand .brand-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

#shanling-mobile-menu .mobile-brand .brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #000000;
}

#shanling-mobile-menu .mobile-nav-list {
    list-style: none;
    margin: 8px 0 28px 0;
    padding: 0;
}

#shanling-mobile-menu .mobile-nav-list li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    list-style: none;
}

#shanling-mobile-menu .mobile-nav-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 4px;
    font-size: 16px;
    font-weight: 500;
    color: #000000;
    text-decoration: none;
}

#shanling-mobile-menu .mobile-nav-list .sub-menu {
    list-style: none;
    padding-left: 16px;
    margin: 4px 0 10px 0;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
}

#shanling-mobile-menu .mobile-nav-list .sub-menu li a {
    font-size: 14px;
    padding: 10px 8px;
    color: #334155;
}

#shanling-mobile-menu .mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 4px;
}

#shanling-mobile-menu .mobile-btn-account {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #000000;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

#shanling-mobile-menu .mobile-btn-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

/* 响应式断点 */
@media (max-width: 1023px) {
    #shanling-header .header-nav,
    #shanling-header .header-actions {
        display: none !important;
    }

    #shanling-header .hamburger-btn {
        display: flex !important;
    }

    #shanling-header .header-inner {
        padding: 0 20px !important;
        height: 62px !important;
    }

    #shanling-mobile-menu {
        top: 62px !important;
    }
}

@media (min-width: 1024px) {
    #shanling-mobile-menu {
        display: none !important;
    }
}

.shanling-header-spacer {
    height: 0;
}
/* =================================================================
 * 🌟 下拉菜单项常驻“精致按钮”风格（苹果 / SaaS 风格）
 * ================================================================= */

/* 1. 默认状态：赋予干净温润的浅色按钮底色与细腻边框 */
#shanling-header .header-nav ul li .sub-menu.shopify-mega-menu .mega-menu-list li a {
    background-color: #f8fafc !important;        /* 按钮默认的浅灰白底色 */
    border: 1px solid #e2e8f0 !important;        /* 加上一圈精致清晰的微边框，让它看起来像个按钮 */
    border-radius: 10px !important;              /* 温润舒适的圆角 */
    padding: 10px 16px !important;               /* 适当撑开上下左右内边距，更有按钮质感 */
    color: #334155 !important;                   /* 沉稳的文字颜色 */
    text-align: center !important;               /* 文字居中 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important; /* 极轻微的立体投影 */
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* 2. 鼠标悬停（Hover）或当前高亮（is-active）状态：变成科技感深蓝/高亮按钮 */
#shanling-header .header-nav ul li .sub-menu.shopify-mega-menu .mega-menu-list li a:hover,
#shanling-header .header-nav ul li .sub-menu.shopify-mega-menu .mega-menu-list li.is-active a,
#shanling-header .header-nav ul li .sub-menu.shopify-mega-menu .mega-menu-list li.current-menu-item a {
    background-color: #eff6ff !important;        /* 悬停时变为高亮浅蓝色背景 */
    border-color: #3b82f6 !important;            /* 边框变为鲜明的科技蓝 */
    color: #1d4ed8 !important;                   /* 文字变为深蓝色 */
    transform: translateY(-1px) !important;      /* 悬停时轻微向上浮起，增强按钮交互感 */
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12) !important; /* 悬浮时的精致投影 */
}