/* Unified desktop header: shared by every home style, list and detail page. */
html body .site-header {
    position: relative !important;
    top: auto !important;
    z-index: 1000 !important;
    box-sizing: border-box !important;
    height: 100px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #f0f2f5 !important;
    background: #fff !important;
    box-shadow: 0 4px 16px rgba(31, 46, 61, .035) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html body .site-header::after { display: none !important; }
html body .site-header > .container {
    display: flex !important;
    box-sizing: border-box !important;
    width: calc(100% - 30px) !important;
    max-width: 1140px !important;
    height: 100px !important;
    min-height: 100px !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
}
html body .site-header .logo {
    display: flex !important;
    position: relative !important;
    box-sizing: border-box !important;
    width: auto !important;
    height: 68px !important;
    max-width: 220px !important;
    flex: 0 0 220px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}
html body .site-header .logo a {
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    overflow: hidden !important;
    color: #15191e !important;
    font-size: 28px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: -1px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
html body .site-header .logo a::before {
    display: flex !important;
    width: 48px !important;
    height: 48px !important;
    flex: 0 0 48px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 15px 5px 15px 5px !important;
    background: linear-gradient(135deg, #19b4f5, #087de5) !important;
    box-shadow: inset 0 0 0 5px rgba(255,255,255,.22) !important;
    color: #fff !important;
    content: "M" !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}
html body .site-header .logo::after {
    display: block !important;
    position: absolute !important;
    top: 52px !important;
    left: 60px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #737982 !important;
    content: "安全优质的软件资源" !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    letter-spacing: 1px !important;
    white-space: nowrap !important;
}
html body .site-header .logo.has-logo-image a::before,
html body .site-header .logo.has-logo-image::after,
html body .site-header .logo:has(img) a::before,
html body .site-header .logo:has(img)::after { display: none !important; }
html body .site-header .logo img {
    display: block !important;
    width: auto !important;
    max-width: 225px !important;
    height: auto !important;
    max-height: 66px !important;
}
html body .site-header .main-nav {
    width: auto !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
}
html body .site-header .main-nav > ul {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    list-style: none !important;
}
html body .site-header .main-nav > ul > li {
    display: block !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
}
html body .site-header .main-nav > ul > li:nth-child(n+7) { display: none !important; }
html body .site-header .main-nav > ul > li > a {
    display: flex !important;
    position: relative !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    height: 100px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #626262 !important;
    font-family: Arial, "Microsoft YaHei", "微软雅黑", sans-serif !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    line-height: 100px !important;
    transform: none !important;
    white-space: nowrap !important;
}
html body .site-header .main-nav > ul > li > a::after {
    display: block !important;
    position: absolute !important;
    right: auto !important;
    bottom: 22px !important;
    left: 50% !important;
    width: 32px !important;
    height: 3px !important;
    margin-left: -16px !important;
    border-radius: 3px !important;
    background: #12a6ff !important;
    content: "" !important;
    opacity: 0 !important;
    transition: opacity .2s ease !important;
}
html body .site-header .main-nav > ul > li > a:hover,
html body .site-header .main-nav > ul > li.active > a,
html body .site-header .main-nav > ul > li.on > a {
    background: transparent !important;
    box-shadow: none !important;
    color: #11151a !important;
    font-weight: 700 !important;
    transform: none !important;
}
html body .site-header .main-nav > ul > li > a:hover::after,
html body .site-header .main-nav > ul > li.active > a::after,
html body .site-header .main-nav > ul > li.on > a::after { opacity: 1 !important; }
html body .site-header .search-box {
    display: flex !important;
    width: auto !important;
    flex: 0 0 300px !important;
    align-items: center !important;
    margin-left: auto !important;
}
html body .site-header .top-search-wrap { position: relative !important; width: 100% !important; flex: none !important; }
html body .site-header .top-search-form {
    display: flex !important;
    position: relative !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 50px !important;
    align-items: center !important;
    overflow: hidden !important;
    border: 1px solid #e1e7ee !important;
    border-radius: 27px !important;
    background: #f8fafc !important;
    box-shadow: inset 0 1px 2px rgba(31,55,82,.025) !important;
}
html body .site-header .top-search-form:focus-within {
    border-color: #9bcfff !important;
    box-shadow: 0 0 0 3px rgba(18,166,255,.08) !important;
}
html body .site-header .top-search-leading-icon {
    display: block !important;
    flex: 0 0 auto !important;
    margin-left: 17px !important;
    color: #c1c5ca !important;
    font-size: 17px !important;
}
html body .site-header .top-search-input {
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 48px !important;
    flex: 1 !important;
    padding: 0 10px !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: #333 !important;
    font-size: 14px !important;
}
html body .site-header .top-search-input:focus {
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
html body .site-header .top-search-form button {
    display: inline-flex !important;
    box-sizing: border-box !important;
    width: 96px !important;
    height: 40px !important;
    flex: 0 0 96px !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 4px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 22px !important;
    background: linear-gradient(90deg,#13aafc,#0875ff) !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 16px !important;
    cursor: pointer !important;
}
html body .site-header .top-search-form button span { display: block !important; color: #fff !important; }
html body .site-header .top-search-form button:hover {
    background: linear-gradient(90deg,#079cf4,#006bea) !important;
    box-shadow: 0 6px 14px rgba(8,117,238,.2) !important;
}
html body .site-header .top-search-suggest {
    top: calc(100% + 10px) !important;
    left: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 300px !important;
    padding: 14px !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 15px !important;
    background: rgba(255,255,255,.98) !important;
    box-shadow: 0 14px 34px rgba(31,55,82,.14) !important;
    transform-origin: top center !important;
}
html body .site-header .top-search-suggest::before { display: none !important; }
html body .site-header .top-search-suggest-title { margin-bottom: 11px !important; color: #8a94a3 !important; font-size: 12px !important; }
html body .site-header .top-search-suggest-list { gap: 8px !important; }
html body .site-header .top-search-suggest-item { min-height: 32px !important; padding: 0 12px !important; box-shadow: none !important; }
html body .site-header .dark-mode-toggle,
html body .site-header .user-action-menu { display: none !important; }

/* Desktop vs Mobile User Menu Visibility */
.mobile-category-list { display: none; }
.desktop-user-menu { display: block; }

@media (max-width: 820px) {
    .mobile-category-list { display: block; }
    .desktop-user-menu { display: none; }
    
    .mobile-category-list ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .mobile-category-list li a {
        display: block;
        padding: 12px 16px;
        color: #333;
        border-bottom: 1px solid #f0f2f5;
        font-size: 15px;
    }
    .mobile-category-list li:last-child a {
        border-bottom: none;
    }
}

@media (min-width: 821px) {
    html body.pan-header-user-enabled #pan-site-header .search-box { flex-basis: 350px !important; }
    html body.pan-header-user-enabled #pan-site-header .top-search-wrap { width: auto !important; min-width: 0 !important; flex: 1 1 auto !important; }
    html body.pan-header-user-enabled #pan-site-header .user-action-menu { display: block !important; flex: 0 0 40px !important; margin: 0 0 0 10px !important; }
    html body.pan-header-user-enabled #pan-site-header .user-info-trigger { box-sizing: border-box !important; width: 40px !important; height: 40px !important; justify-content: center !important; padding: 3px !important; border: 1px solid #e2e8f0 !important; border-radius: 50% !important; background: #f8fafc !important; }
    html body.pan-header-user-enabled #pan-site-header .user-info-trigger:hover { border-color: #9ccfff !important; background: #eef7ff !important; }
    html body.pan-header-user-enabled #pan-site-header .user-avatar { display: flex !important; width: 32px !important; height: 32px !important; flex: 0 0 32px !important; }
    html body.pan-header-user-enabled #pan-site-header .mobile-menu-icon { display: none !important; }
    html body.pan-header-user-enabled #pan-site-header .user-dropdown-content { right: -2px !important; min-width: 210px !important; margin-top: 12px !important; overflow: visible !important; border: 1px solid #e2e8f0 !important; border-radius: 12px !important; background: #fff !important; box-shadow: 0 14px 35px rgba(31,55,82,.15) !important; }
}

/* The dual-home template still contains legacy inline header rules. The ID
   keeps this shared design authoritative there as well as on every other page. */
@media (min-width: 821px) {
    html body #pan-site-header { position: relative !important; top: auto !important; height: 100px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-bottom: 1px solid #f0f2f5 !important; background: #fff !important; box-shadow: 0 4px 16px rgba(31,46,61,.035) !important; backdrop-filter: none !important; }
    html body #pan-site-header > .container { width: calc(100% - 30px) !important; max-width: 1140px !important; height: 100px !important; min-height: 100px !important; gap: 0 !important; padding: 0 !important; }
    html body #pan-site-header .logo { width: auto !important; height: 68px !important; max-width: 220px !important; flex: 0 0 220px !important; margin: 0 !important; padding: 0 !important; }
    html body #pan-site-header .logo a { gap: 11px !important; color: #15191e !important; font-size: 28px !important; font-weight: 800 !important; }
    html body #pan-site-header .logo a::before { width: 48px !important; height: 48px !important; flex-basis: 48px !important; border-radius: 15px 5px 15px 5px !important; font-size: 24px !important; }
    html body #pan-site-header .logo::after { top: 52px !important; left: 60px !important; margin: 0 !important; padding: 0 !important; background: transparent !important; content: "安全优质的软件资源" !important; font-size: 10px !important; }
    html body #pan-site-header .main-nav { flex: 0 0 auto !important; }
    html body #pan-site-header .main-nav > ul { gap: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
    html body #pan-site-header .main-nav > ul > li > a { height: 100px !important; padding: 0 18px !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: #626262 !important; font-size: 20px !important; font-weight: 400 !important; line-height: 100px !important; }
    html body #pan-site-header .main-nav > ul > li > a::after { display: block !important; bottom: 22px !important; width: 32px !important; height: 3px !important; margin-left: -16px !important; opacity: 0 !important; }
    html body #pan-site-header .main-nav > ul > li > a:hover,
    html body #pan-site-header .main-nav > ul > li.active > a,
    html body #pan-site-header .main-nav > ul > li.on > a { background: transparent !important; box-shadow: none !important; color: #11151a !important; font-weight: 700 !important; }
    html body #pan-site-header .main-nav > ul > li > a:hover::after,
    html body #pan-site-header .main-nav > ul > li.active > a::after,
    html body #pan-site-header .main-nav > ul > li.on > a::after { opacity: 1 !important; }
    html body #pan-site-header .search-box { flex: 0 0 300px !important; margin-left: auto !important; }
    html body #pan-site-header .top-search-form { width: 100% !important; height: 50px !important; border: 1px solid #e7ebf0 !important; border-radius: 27px !important; background: #fff !important; box-shadow: none !important; }
    html body #pan-site-header .top-search-input { height: 48px !important; padding: 0 10px !important; font-size: 14px !important; }
    html body #pan-site-header .top-search-form button { width: 96px !important; height: 40px !important; flex-basis: 96px !important; margin: 4px !important; border-radius: 22px !important; background: linear-gradient(90deg,#13aafc,#0875ff) !important; }
}

@media (max-width: 1180px) and (min-width: 821px) {
    html body .site-header .logo { max-width: 200px !important; flex-basis: 200px !important; }
    html body .site-header .main-nav > ul > li > a { padding-right: 13px !important; padding-left: 13px !important; font-size: 17px !important; }
    html body .site-header .search-box { flex-basis: 280px !important; }
    html body #pan-site-header .logo { max-width: 190px !important; flex-basis: 190px !important; }
    html body #pan-site-header .main-nav > ul > li > a { padding-right: 10px !important; padding-left: 10px !important; font-size: 16px !important; }
    html body #pan-site-header .search-box { flex-basis: 260px !important; }
    html body.pan-header-user-enabled #pan-site-header .search-box { flex-basis: 310px !important; }
}

@media (max-width: 820px) {
    html body .site-header { height: 72px !important; }
    html body .site-header > .container { width: calc(100% - 24px) !important; height: 72px !important; min-height: 72px !important; flex-direction: row !important; padding: 0 !important; }
    html body .site-header .logo { width: auto !important; height: 56px !important; max-width: calc(100% - 56px) !important; flex: 1 1 auto !important; justify-content: flex-start !important; order: 1 !important; }
    html body .site-header .logo a { justify-content: flex-start !important; font-size: 23px !important; }
    html body .site-header .logo a::before { width: 42px !important; height: 42px !important; flex-basis: 42px !important; font-size: 20px !important; }
    html body .site-header .logo::after { top: 44px !important; left: 52px !important; font-size: 8px !important; }
    html body .site-header .logo img { max-width: 190px !important; max-height: 54px !important; }
    html body .site-header .main-nav { display: none !important; }
    html body .site-header .search-box { display: flex !important; width: 44px !important; flex: 0 0 44px !important; justify-content: flex-end !important; order: 3 !important; margin-left: 8px !important; }
    html body .site-header .top-search-wrap,
    html body .site-header .dark-mode-toggle { display: none !important; }
    html body.pan-header-user-enabled .site-header .user-action-menu,
    html body.pan-home-dual .site-header .user-action-menu { display: block !important; position: relative !important; margin: 0 !important; }
    html body .site-header .user-info-trigger { display: flex !important; width: 42px !important; height: 42px !important; align-items: center !important; justify-content: center !important; }
    html body .site-header .mobile-menu-icon { display: block !important; box-sizing: border-box !important; width: 40px !important; height: 40px !important; padding: 9px !important; border: 1px solid #e6ebf1 !important; border-radius: 12px !important; background: #f7f9fc !important; color: #26374b !important; font-size: 19px !important; line-height: 20px !important; text-align: center !important; }
}
