/* ============================================================
   b2 Theme - floating-top 悬浮类型菜单样式
   风格参考：maker.taptap.cn 顶部导航栏
   双层结构：外层透明容器 + 内层白色胶囊容器
   ============================================================ */

/* === 0. 清除 body 顶部间距，防止内容被遮挡 === */

body.floating-top {
    padding-top: 0 !important;
}

.admin-bar.floating-top {
    padding-top: 0 !important;
}

/* === 1. 外层容器与整体重置 === */

.site-header.floating-top {
    height: auto;
    margin: 0;
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    width: calc(100% - 2rem);
    max-width: 1232px;
    background: transparent;
    box-shadow: none;
}

.site-header.floating-top.social-no-sub {
    height: auto;
}

.site-header.floating-top .site-header-in {
    position: static;
    background: transparent;
    width: 100%;
    box-shadow: none;
}

/* === 2. 内层白色胶囊容器 === */

.floating-top .header-banner {
    height: auto;
    z-index: 0;
}

.floating-top .header-banner-content.wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0px 8px 30px -4px rgba(0, 192, 183, 0.15);
    padding-left: 25px;
    padding-right: 25px;
    box-sizing: border-box;
    position: relative;
}

/* === 3. 左侧区域：LOGO + 菜单 === */

.floating-top .header-banner-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

/* LOGO */
.floating-top .header-logo {
    padding: 0;
    margin-right: 0;
    display: flex;
    align-items: center;
}

.floating-top .header-logo img,
.floating-top .header-logo .logo img {
    max-height: 36px;
    width: auto;
}

/* 菜单容器 */
.floating-top .ym-menu ul {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* 一级菜单项 - 胶囊药丸风格 */
.floating-top .ym-menu ul li.menu-item > a,
.floating-top .header-banner-left .menu li a {
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-decoration: none;
    background: transparent;
    line-height: 20px;
    opacity: 1;
    height: auto;
    border: none;
}

.floating-top .header-banner-left .menu li a {
    font-size: 14px;
    position: static;
}

/* hover 效果 */
.floating-top .ym-menu ul li.menu-item > a:hover,
.floating-top .header-banner-left .menu li a:hover {
    color: #4d4dad;
    background-color: rgba(99, 102, 241, 0.1);
}

/* 当前激活菜单项 */
.floating-top .ym-menu ul li.current-menu-item > a,
.floating-top .header-banner-left .menu li.current-menu-item a {
    color: #4d4dad;
    background-color: rgba(99, 102, 241, 0.1);
}

/* 子菜单下拉容器 */
.floating-top .ym-menu .sub-menu {
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
                0 8px 10px -6px rgba(0, 0, 0, 0.06);
    padding: 6px;
    min-width: 160px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.floating-top .ym-menu .sub-menu li a {
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
}

.floating-top .ym-menu .sub-menu li a:hover {
    background-color: rgba(99, 102, 241, 0.08);
    color: #4d4dad;
}

/* === 4. 右侧区域：搜索 + 用户 + 按钮 === */

.floating-top .header-banner-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

/* 搜索框 */
.floating-top .top-search {
    margin-right: 0;
}

.floating-top .top-search .top-search-select {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 14px;
    color: #6B7280;
    background: transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.floating-top .top-search .top-search-select:hover {
    background-color: rgba(99, 102, 241, 0.08);
    color: #4d4dad;
}

.floating-top .top-search .mobile-search-input {
    display: flex;
    align-items: center;
}

/* 用户头像区域 */
.floating-top .header-user {
    position: initial;
    right: auto;
    display: flex;
    align-items: center;
    width: auto;
    justify-content: flex-end;
}

.floating-top .top-user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
}

/* 登录/CTA 按钮 - TapTap 风格 */
.floating-top .header-login-button button,
.floating-top .top-submit .button,
.floating-top .top-submit button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 8px 24px;
    border-radius: 9999px;
    border: none;
    background-color: #111827;
    color: #FAFAFA;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    will-change: transform;
    text-decoration: none;
}

.floating-top .header-login-button button:hover,
.floating-top .top-submit .button:hover,
.floating-top .top-submit button:hover {
    background-color: #4D4DAD;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
                0 4px 6px -4px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    color: #FAFAFA;
    border-color: transparent;
}

/* 空心/次要按钮 */
.floating-top .header-login-button button.empty,
.floating-top .top-submit .button.empty {
    background-color: transparent;
    color: #111827;
    border: 1px solid #E5E7EB;
    box-shadow: none;
}

.floating-top .header-login-button button.empty:hover,
.floating-top .top-submit .button.empty:hover {
    background-color: rgba(99, 102, 241, 0.08);
    border-color: #4d4dad;
    color: #4d4dad;
    transform: translateY(-2px);
}

/* === 5. 汉堡菜单按钮（移动端显示） === */

.floating-top .top-style-menu .menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.floating-top .top-style-menu .menu-icon .line-1,
.floating-top .top-style-menu .menu-icon .line-2,
.floating-top .top-style-menu .menu-icon .line-3 {
    width: 24px;
    height: 2px;
    border-radius: 9999px;
    background-color: #374151;
    transition: all 0.2s ease;
}

/* === 6. 暗色模式适配 === */

.post-style-2 .floating-top .header-banner-content.wrapper {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0px 8px 30px -4px rgba(0, 0, 0, 0.4);
}

.post-style-2 .floating-top .ym-menu ul li.menu-item > a,
.post-style-2 .floating-top .header-banner-left .menu li a {
    color: #D1D5DB;
}

.post-style-2 .floating-top .ym-menu ul li.menu-item > a:hover,
.post-style-2 .floating-top .header-banner-left .menu li a:hover {
    color: #818CF8;
    background-color: rgba(129, 140, 248, 0.15);
}

.post-style-2 .floating-top .header-login-button button,
.post-style-2 .floating-top .top-submit .button {
    background-color: #4D4DAD;
    color: #ffffff;
}

.post-style-2 .floating-top .header-login-button button:hover,
.post-style-2 .floating-top .top-submit .button:hover {
    background-color: #6366F1;
}

.post-style-2 .floating-top .top-style-menu .menu-icon .line-1,
.post-style-2 .floating-top .top-style-menu .menu-icon .line-2,
.post-style-2 .floating-top .top-style-menu .menu-icon .line-3 {
    background-color: #D1D5DB;
}

.post-style-2 .floating-top .header-banner {
    background: transparent;
}

.post-style-2 .floating-top .header {
    background: transparent;
}
