/*
Theme Name:     B2子主题
Theme URI:      http: //7b2.com/
Description:    Child theme for the B2 PRO
Author:         子主题模版
Author URI:     http: //7b2.com/
Template:       b2
Version:        0.3.0
*/

.site-header {
    --b2child-nav-height: 64px;
    --nav-accent: #963d50; --nav-tint: #f8eff2; --nav-rule: rgb(95 70 75 / 10%); --nav-muted: #83767c; --nav-control: rgb(120 100 108 / 5%);
}
.site-header[data-b2child-nav-tone="dark"] { --nav-accent: #f2b4c4; --nav-tint: rgb(242 180 196 / 12%); --nav-rule: rgb(255 255 255 / 15%); --nav-muted: #c6b5bc; --nav-control: rgb(255 255 255 / 7%); }
.site-header .site-header-in { box-shadow: 0 3px 18px rgb(40 30 35 / 6%); }
.site-header .header-logo { flex-shrink: 0; padding: 0; }
.site-header .logo { height: auto; min-height: 0; }
.site-header .logo .b2child-brand { display: flex; width: min(var(--b2child-logo-width, 130px), 130px); max-width: 100%; align-items: center; }
.site-header .logo h1 { margin: 0; line-height: 0; }
.site-header .logo img.b2child-brand-image, .login-logo img.b2child-brand-image { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; aspect-ratio: 600 / 240; }
.login-logo { padding: 6px 0; }
.login-logo img.b2child-brand-image { width: min(var(--b2child-logo-login, 260px), 100%); }
.b2child-navbar-no-logo .site-header { --b2child-nav-height: 64px; }
.b2child-navbar-no-logo .site-header .header-logo { display: none; }

/* Primary row: brand, icon links, search and account tools. */
.site-header.social-top > .site-header-in > .header-banner { height: auto; min-height: var(--b2child-nav-height); border-bottom: 1px solid var(--nav-rule); box-sizing: border-box; }
.site-header.social-top .header-banner-content { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 20px; height: auto; min-height: var(--b2child-nav-height); align-items: center; box-sizing: border-box; }
.site-header.social-top .header-banner-left { display: contents; }
.site-header.social-top .header-logo { grid-column: 1; grid-row: 1; padding: 0; margin: 0; }
.site-header.social-top .ym-menu { grid-column: 2; grid-row: 1; min-width: 0; height: auto; }
.site-header.social-top .ym-menu > ul { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px; width: max-content; max-width: none; margin: 0; }
.site-header.social-top .header-banner-left .menu > li { flex: 0 0 auto; margin: 0; padding: 0; }
.site-header.social-top .header-banner-left .menu > li.menu-item-has-children { color: inherit; }
.site-header.social-top .header-banner-left .menu > li > a { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px; border-radius: 7px; font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap; transition: color .15s, background-color .15s; }
.site-header.social-top .header-banner-left .menu > li > a:hover,
.site-header.social-top .header-banner-left .menu > li:focus-within > a,
.site-header.social-top .header-banner-left .menu > li.current-menu-item > a,
.site-header.social-top .header-banner-left .menu > li.current-menu-ancestor > a { background: var(--nav-tint); color: var(--nav-accent); }
.site-header.social-top .header-banner-left .menu > li.current-menu-item > a::after { display: none; }
.site-header.social-top .header-banner-right { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 16px; min-width: 0; }
.site-header.social-top .header-user { position: static; width: auto; top: auto; transform: none; gap: 8px; align-items: center; }
.site-header.social-top .top-search { margin: 0; }
.site-header.social-top .top-search form { height: 38px; align-items: center; background: var(--nav-control); border: 1px solid var(--nav-rule); border-radius: 8px; box-sizing: border-box; }
.site-header.social-top .top-search form:focus-within { border-color: var(--nav-accent); box-shadow: 0 0 0 2px var(--nav-tint); }
.site-header.social-top .top-search input { box-sizing: border-box; width: 124px; padding: 9px 30px 9px 10px; font-size: 12px; }
.site-header.social-top .top-search-select { padding: 0 9px 0 12px; font-size: 12px; }
.site-header.social-top .top-search .search-button-action { top: 0; right: 0; height: 36px; width: 34px; padding: 0; display: grid; place-items: center; }
.site-header.social-top .top-search .search-button-action i { font-size: 18px; }
.site-header.social-top .header-user .change-theme { display: flex; align-items: center; gap: 4px; margin: 0; }
.site-header.social-top .header-user .change-theme > div > :is(a, button) { display: grid; place-items: center; width: 34px; height: 34px; margin: 0; padding: 0; border-radius: 8px; line-height: 1; color: inherit; }
.site-header.social-top .header-user .change-theme > div > :is(a, button):hover { color: var(--nav-accent); background: var(--nav-tint); }
.site-header.social-top .header-user .change-theme :is(a, button) > i { font-size: 21px; line-height: 1; }
.site-header.social-top[data-b2child-nav-tone="dark"] .header-user .change-theme > div > :is(a, button) { color: #fff; }
.site-header.social-top .top-user-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: visible; outline: 1px solid var(--nav-rule); outline-offset: 3px; }
.site-header.social-top .top-user-avatar img { border-radius: 50%; }
.site-header.social-top .login-button .text { margin-right: 0; }
.site-header.social-top .login-button > :is(a, button) { border-radius: 7px; }
.site .site-header.social-top .site-header-in, .social-top .site.up .site-header-in { transform: none; }
.site-header.social-top .header-banner-left.hidden { opacity: 1; }
.b2child-navbar-no-logo .site-header.social-top .header-banner-content { grid-template-columns: minmax(0, 1fr) auto; }
.b2child-navbar-no-logo .site-header.social-top .ym-menu { grid-column: 1; }
.b2child-navbar-no-logo .site-header.social-top .header-banner-right { grid-column: 2; }

/* Fixed-size defaults and custom images use the same alignment. */
.site-header .b2child-nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin: 0; padding: 0; flex: 0 0 18px; object-fit: contain; vertical-align: middle; font-size: 18px; line-height: 1; color: inherit; }
.site-header .b2child-nav-icon svg { display: block; width: 100%; height: 100%; }
.site-header svg.b2child-nav-icon { fill: none; }
.site-header .b2child-nav-label { line-height: inherit; }
.site-header .top-menu .depth-0 > a:has(.b2child-nav-icon), .site-header .top-menu .depth-0 > a > span:has(.b2child-nav-icon) { display: flex; align-items: center; gap: 7px; }
.site-header .top-menu .has_children:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.b2child-toggle-icon { display: block; width: 22px; height: 22px; object-fit: contain; }
.site-header :is(.ym-menu a, .top-menu a, button, #mobile-menu-button):focus-visible, .b2child-brand:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: 3px; }

/* Positioned dropdowns stay outside the mobile scroller's clipping area. */
.site-header.social-top .ym-menu > ul > li > .sub-menu { top: calc(100% + 8px); left: 0; width: 190px; padding: 6px; border: 1px solid #ece5e7; border-radius: 10px; box-shadow: 0 10px 32px rgb(46 28 36 / 12%); background: #fff; box-sizing: border-box; overflow: visible; }
.site-header.social-top .ym-menu > ul > li > .sub-menu::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.site-header.social-top .ym-menu > ul > li:focus-within > .sub-menu { display: block; }
.site-header.social-top .ym-menu .sub-menu > li { margin: 0; }
.site-header.social-top .ym-menu .sub-menu > li > a { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 6px; line-height: 1.5; color: #4a3c42; }
.site-header.social-top .ym-menu .sub-menu > li > a:is(:hover, :focus-visible) { color: #963d50; background: #f8eff2; }
.post-style-2 .site-header.social-top .ym-menu .sub-menu > li > a { color: #4a3c42 !important; }
.site-header .b2child-submenu-toggle { display: none; }
.site-header.social-top .ym-menu > ul > li.b2child-submenu-open > .sub-menu { display: block; }
.site-header.social-top .ym-menu > ul > li.b2child-submenu-dismissed > .sub-menu { display: none !important; }
.site-header.social-top .ym-menu > ul > li > .sub-menu.b2child-positioned-menu { position: fixed; top: var(--b2child-submenu-top); left: var(--b2child-submenu-left); max-height: calc(100vh - var(--b2child-submenu-top) - 16px); overflow-y: auto; overscroll-behavior: contain; }

/* Other B2 header placements keep their original menu structure. */
.site-header .header:has(.top-style .b2child-brand):not(.logo-top) { height: var(--b2child-nav-height); }
.site-header .header .top-style > .wrapper { height: var(--b2child-nav-height); min-height: var(--b2child-nav-height); }
.b2child-navbar-no-logo .site-header .header:not(.social-top):not(.logo-top) { height: var(--b2child-nav-height); }
.site-header .header.logo-top, .site-header .header.logo-top .top-style > .wrapper { height: auto; }
.site-header .header.logo-top .header-logo { padding: 8px 0; }
.site-header .header-user { top: 50%; transform: translateY(-50%); }
.site-header.social-top .header-user { top: auto; transform: none; }
.logo-center .header-logo { pointer-events: none; }
.logo-center .b2child-brand { pointer-events: auto; }

@media (min-width: 769px) {
    .site-header.social-top.b2child-nav-compact .header-banner-content { column-gap: 12px; }
    .site-header.social-top.b2child-nav-compact .header-banner-right > .top-search { display: none; }
    .site-header.social-top.b2child-nav-compact .header-user .change-theme > .mobile-show { display: block; }
    .site-header.social-top.b2child-nav-wrap .header-banner-content { grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; }
    .site-header.social-top.b2child-nav-wrap .header-logo { grid-column: 1; grid-row: 1; margin: 6px 0; }
    .site-header.social-top.b2child-nav-wrap .header-banner-right { grid-column: 2; grid-row: 1; }
    .site-header.social-top.b2child-nav-wrap .ym-menu { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--nav-rule); padding: 7px 0; }
    .site-header.social-top.b2child-nav-wrap .ym-menu > ul { justify-content: center; width: 100%; }
    .site-header .header:is(.logo-center, .menu-center).b2child-primary-wrap:has(.top-style .b2child-brand) { height: auto; }
    .site-header .header:is(.logo-center, .menu-center).b2child-primary-wrap .top-style > .wrapper { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: var(--b2child-nav-height) auto; height: auto; }
    .site-header .header:is(.logo-center, .menu-center).b2child-primary-wrap .header-logo { position: static; grid-column: 1 / -1; grid-row: 1; }
    .site-header .header.menu-center.b2child-primary-wrap .header-logo { grid-column: 1; }
    .site-header .header:is(.logo-center, .menu-center).b2child-primary-wrap .header-user { position: static; grid-column: 2; grid-row: 1; top: auto; transform: none; }
    .site-header .header:is(.logo-center, .menu-center).b2child-primary-wrap .mobile-box { grid-column: 1 / -1; grid-row: 2; margin: 0; border-top: 1px solid var(--nav-rule); }
}
@media (min-width: 769px) and (max-width: 1160px) {
    .site-header.social-top .header-banner-content { padding-inline: 20px; }
}
@media (max-width: 768px) {
    .site-header { --b2child-nav-height: 56px; }
    .site-header .header:has(.top-style .b2child-brand):not(.logo-top) { height: var(--b2child-nav-height) !important; }
    .site-header .header.logo-top { height: auto !important; }
    .site-header .logo .b2child-brand { width: min(var(--b2child-logo-mobile, 110px), 110px); max-width: calc(100vw - 150px); }
    .site-header .header-logo { min-width: 0; padding: 0; }
    .login-logo img.b2child-brand-image { max-width: 230px; }
    .site-header.social-top .header-banner-content { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: var(--b2child-nav-height) auto; min-height: 0; padding: 0 12px; gap: 0; }
    .site-header.social-top .header-banner-content .header-banner-left { display: contents; border: 0; padding: 0; }
    .site-header.social-top .header-banner .header-logo { grid-row: 1; grid-column: 1; position: static; width: auto; margin: 0; padding: 0; justify-content: flex-start; }
    .site-header.social-top .header-banner-content .header-banner-right { grid-row: 1; grid-column: 2; position: static; height: auto; margin: 0; gap: 8px; }
    .site-header.social-top .header-user .change-theme { gap: 2px; }
    .site-header.social-top .header-user { gap: 6px; }
    .site-header.social-top .top-user-avatar { width: 28px; height: 28px; }
    .site-header.social-top .header-user .change-theme > div > :is(a, button) { width: 30px; height: 32px; }
    .site-header.social-top .header-banner-content .ym-menu { grid-row: 2; grid-column: 1 / -1; height: auto; margin: 0; padding: 0; border-top: 1px solid var(--nav-rule); overflow: visible; }
    .site-header.social-top .ym-menu > ul { width: 100%; min-height: 44px; height: auto; gap: 0; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
    .site-header.social-top .ym-menu > ul::-webkit-scrollbar { display: none; }
    .site-header.social-top .header-banner-left .menu > li { flex: 1 0 auto; margin: 0; padding: 4px 0; min-width: 44px; }
    .site-header.social-top .header-banner-left .menu > li > a { flex-direction: row; gap: 5px; min-height: 36px; padding: 8px 9px; box-sizing: border-box; font-size: 13px; line-height: 20px; border-radius: 6px; }
    .site-header.social-top .ym-menu > ul > li > a > .b2child-nav-icon { width: 18px; height: 18px; flex-basis: 18px; }
    .site-header.social-top .header-banner-content .top-style-menu.mobile-show { position: static; bottom: auto; right: auto; display: block; }
    .site-header.social-top.social-no-sub .header-banner-content .top-style-menu.mobile-show { display: none; }
    .site-header.social-top .header-banner-content .menu-icon { width: 22px; margin: 0; }
    .site-header.social-top .ym-menu > ul > li:has(> .b2child-submenu-toggle) > a { padding-right: 20px; }
    .site-header.social-top .b2child-submenu-toggle { display: grid; place-items: center; position: absolute; top: 8px; right: 0; width: 18px; height: 28px; margin: 0; padding: 0; color: var(--nav-muted); background: transparent; border: 0; border-radius: 4px; }
    .site-header.social-top .b2child-submenu-toggle[aria-expanded="true"] { color: var(--nav-accent); }
    .site-header.social-top .b2child-submenu-toggle svg { width: 12px; height: 12px; }
    .site-header.social-top .ym-menu > ul > li > .sub-menu { display: none; }
    .site-header.social-top .ym-menu > ul > li:not(.b2child-submenu-open):is(:hover, :focus-within) > .sub-menu { display: none; }
    .site-header.social-top .ym-menu > ul > li.b2child-submenu-open > .sub-menu { display: block; }
    .b2child-navbar-no-logo .site-header.social-top .header-banner-content { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 48px auto; }
    .b2child-navbar-no-logo .site-header.social-top .header-banner-right { grid-column: 2; }
    .b2child-navbar-no-logo .site-header.social-top .header-banner-content::before { content: '导航'; grid-column: 1; grid-row: 1; font-size: 14px; font-weight: 600; color: var(--nav-muted); }
}
@media (prefers-reduced-motion: reduce) { .site-header *, .site-header *::before, .site-header *::after { transition: none !important; animation: none !important; } }

