/* spzh-header-styles - 两行三列专业版（优化布局） */

/* ==================== Kadence CSS变量映射 ==================== */
/* 第一步：只添加变量，不修改现有样式 */
:root {
    /* 映射Kadence颜色变量到我们的系统 */
    --spzh-primary: var(--kc-primary);
    --spzh-primary-hover: var(--kc-primary-light);
    --spzh-text-primary: var(--kc-read-title);
    --spzh-text-secondary: var(--kc-read-body);
    --spzh-text-muted: var(--kc-read-muted);
    --spzh-bg-light: var(--global-palette8, #f8fafc);
    --spzh-bg-white: var(--global-palette9, #ffffff);
    --spzh-border-color: var(--global-palette6, #a3aebe);
    --spzh-success: var(--global-palette11, #0CAF60);
    --spzh-info: var(--global-palette12, #2A85FF);
    --spzh-warning: var(--global-palette13, #FFC043);
    --spzh-danger: var(--global-palette14, #EF5E5E);
    --spzh-bg-gray: var(--global-palette15, #F5F5F5);
    
    /* 归档横幅专用 */
    --spzh-archive-banner-bg: var(--kc-purple-60);
    
    /* 字体系统 */
    --spzh-font-family: var(--global-body-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif);
    --spzh-heading-font-family: var(--global-heading-font-family, inherit);
    
    /* 布局系统 */
    --spzh-content-width: var(--global-content-width, 1200px);
    --spzh-content-padding: var(--global-content-edge-padding, 1.5rem);

    /* Header 交互/细节 token（集中管理，便于后续 UI 深化） */
    --spzh-divider: rgba(0, 0, 0, 0.06);
    --spzh-line: var(--global-gray-400, #e2e8f0);
    --spzh-hover-surface: var(--global-palette8, #f1f5f9);
    --spzh-nav-text-default: var(--kc-read-secondary);
    --spzh-nav-text-emphasis: var(--kc-read-body);
    --spzh-nav-weight-default: 400;
    --spzh-nav-weight-emphasis: 500;
    --spzh-dropdown-edge-inset: calc(var(--kc-spacing-1) / 4);
    --spzh-dropdown-pad-x-start: calc(1em + (2 * var(--spzh-dropdown-edge-inset)));
    --spzh-dropdown-pad-x-end: calc(1.35em + var(--spzh-dropdown-edge-inset));
    --spzh-sc-chip-text: #8B74B2;
    --spzh-sc-tag-color: var(--spzh-sc-chip-text);
    --spzh-dropdown-border: var(--spzh-divider, rgba(0, 0, 0, 0.06));
    --spzh-dropdown-shadow: none;
    --spzh-dropdown-current-bg: var(--global-palette8, #f1f5f9);
    --spzh-dropdown-current-text: var(--kc-read-body);
    --spzh-dropdown-current-inset-x: calc((var(--kc-spacing-1) * 0.75) + var(--spzh-dropdown-edge-inset));
    --spzh-dropdown-current-radius: var(--kc-border-radius-sm, 4px);
    --spzh-popover-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==================== 基础样式（与 Kadence 默认页眉统一：白底、极轻分割） ==================== */
.spzh-custom-header {
    width: 100%;
    background: var(--global-palette9, #fff);
    box-shadow: 0 1px 0 var(--spzh-divider);
    position: relative;
    z-index: 1000;
    font-family: var(--global-body-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

/* 公共前台页眉：实白底 + 极轻深紫空气阴影（排除学苑 Hub / 课程 / 课时） */
body.sp-public-body:not(.spzh-academy-hub):not(.kc-single-course-with-dashboard-nav):not(.pro-lesson-body) #spzh-custom-header:not(.spzh-custom-header--academy-hub) {
    box-shadow: var(--spzh-header-elevation);
}

/* ==================== 行样式 ==================== */
/* 保持原样，不修改 */
.spzh-header-row {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

.spzh-header-row-1 {
    height: 40px;
    background: #fff;
    border-bottom: 1px solid var(--spzh-divider);
    padding: 0;
    align-items: center;
}

.spzh-header-row-2 {
    height: 60px;
    background: var(--global-palette9, #fff);
    padding: 0;
    align-items: center;
}

/* ==================== 容器样式 ==================== */
/* 左右边距统一 20px（桌面与平板），由容器 padding 控制 */
.spzh-header-container {
    display: flex;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 20px;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

/* ==================== 列样式 ==================== */
/* 保持原样，不修改 */
.spzh-header-col {
    display: flex;
    align-items: center;
    height: 100%;
}

.spzh-header-col-left {
    flex: 0 0 300px;
    justify-content: flex-start;
}

.spzh-header-col-center {
    flex: 1;
    justify-content: center;
}

.spzh-header-col-right {
    flex: 0 0 300px;
    justify-content: flex-end;
}

/* ==================== 列内容样式 ==================== */
/* 保持原样，不修改 */
.spzh-col-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.spzh-col-content-left {
    justify-content: flex-start;
}

.spzh-col-content-center {
    justify-content: center;
}

.spzh-col-content-right {
    justify-content: flex-end;
}

/* ==================== Logo样式 ==================== */
.kb-identity {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--kc-read-title);
    transition: color 0.2s ease;
}

.kb-identity:hover {
    color: var(--global-palette-highlight, var(--global-palette4));
}

/* Logo图像尺寸控制 */
.kb-logo {
    max-height: 40px;
    width: auto;
    display: block;
}

/* 页眉第二行与手机栏长方形 Logo（宽约 4–5 倍；默认上限见下方 #spzh-custom-header） */
.spzh-logo-wide {
    max-height: 48px;
    max-width: 240px;
    width: auto;
    height: auto;
    display: block;
}

/*
 * 桌面第二行左侧主 Logo（≥1025px）：38px 上限。
 * DOM：#spzh-custom-header → .spzh-desktop-rows → 第二行 → .spzh-row2-left-content → .kb-identity → img.kb-logo.spzh-logo-wide
 * 用 min-width + .spzh-row2-left-content 与移动顶栏（.spzh-mobile-logo-wrap，≤1024 为 36px）分流。
 * 不影响登录页 .spzh-login-logo-img。
 */
@media (min-width: 1025px) {
    #spzh-custom-header .spzh-row2-left-content .kb-logo.spzh-logo-wide,
    #spzh-custom-header .spzh-row2-left-content .kc-brand-logo.kb-logo.spzh-logo-wide,
    #spzh-custom-header .spzh-row2-left-content .kb-logo.spzh-logo-academy,
    #spzh-custom-header .spzh-row2-left-content .kc-brand-logo.kb-logo.spzh-logo-academy {
        max-height: 38px;
        max-width: 200px;
        width: auto;
        height: auto;
        object-fit: contain;
    }
}

/* Logo容器 */
.kb-logo-container {
    display: flex;
    align-items: center;
    height: 100%;
}

/* 网站标题 */
.kb-site-title {
    font-size: 20px;
    font-weight: 600;
    color: inherit;
    margin-left: 10px;
}

/* 响应式Logo调整 */
@media (max-width: 768px) {
    .kb-logo {
        max-height: 32px;
    }
    
    .spzh-logo-wide {
        max-height: 48px;
        max-width: 200px;
    }
    
    .kb-site-title {
        font-size: 16px;
        margin-left: 8px;
    }
}

/* ==================== 第一行左侧：视角切换（简化版） ==================== */
.spzh-perspective-switcher-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%; /* 添加固定高度 */
}

/* 视角切换：与 Kadence 导航链接风格一致，中性色；高度与第一行同高以便下划线与文字有足够间距 */
.spzh-perspective-link-simple {
    padding: 3px 8px;
    text-decoration: none;
    color: var(--kc-read-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
    font-size: 12px;
    border-radius: 6px;
    /* 只对背景做过渡，颜色完全由本区块控制，避免主题默认 a:hover 紫色闪烁 */
    transition: background-color 0.2s ease;
    border: none;
    line-height: 1.2;
    height: 40px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
/* 统一锁定所有状态下的文字颜色，防止主题全局 a:hover 介入 */
.spzh-perspective-link-simple,
.spzh-perspective-link-simple:link,
.spzh-perspective-link-simple:visited,
.spzh-perspective-link-simple:hover,
.spzh-perspective-link-simple:focus,
.spzh-perspective-link-simple:active {
    color: var(--kc-read-muted) !important;
}
/* 当前视角：仅用极浅背景 + 略深文字色，不加粗 */
.spzh-perspective-link-simple.active,
.spzh-perspective-link-simple.active:hover,
.spzh-perspective-link-simple.active:focus {
    color: var(--kc-read-body) !important;
    font-weight: 400;
    background-color: var(--spzh-hover-surface);
}
/* 悬停：非当前项仅改变背景，文字颜色保持不变 */
.spzh-perspective-link-simple:hover {
    background-color: var(--spzh-hover-surface);
}

/* SP学苑链接：与主题链接色统一，不单独用绿色；高度与第一行同高 */
.spzh-sp-link-simple {
    padding: 3px 8px;
    text-decoration: none;
    color: var(--kc-read-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
    font-size: 12px;
    border-radius: 3px;
    transition: color 0.2s ease;
    border: none;
    line-height: 1.2;
    height: 40px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.spzh-sp-link-simple:hover {
    color: var(--global-palette-highlight, var(--global-palette3));
}
.spzh-sp-link-simple--active {
    color: var(--global-palette-highlight, var(--global-palette3));
}
.spzh-sp-link-simple--disabled {
    cursor: not-allowed;
    pointer-events: none;
    color: var(--kc-read-muted);
}

.spzh-current-indicator-simple {
    margin-left: 8px;
    padding: 3px 6px;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 11px;
    color: var(--kc-read-muted);
    line-height: 1.2;
    height: 40px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.spzh-current-indicator-simple strong {
    color: var(--kc-read-body);
}

/* ==================== 第一行中间和右侧：预留空间 ==================== */
.spzh-placeholder {
    padding: 6px 15px;
    background: transparent;
    border: none;
    color: var(--kc-read-muted);
    font-size: 13px;
    text-align: center;
    min-width: 80px;
}

/* ==================== 第二行左侧：Logo 与第一行文字左对齐 ==================== */
.spzh-row2-left-content {
    padding-left: 8px;
}

/* ==================== 导航样式（最小化版本） ==================== */

/* 导航容器 - 仅布局控制 */
.spzh-row2-center-content {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 40px;
}

/* 导航视角容器 - 仅显示/隐藏控制 */
.spzh-navigation-perspective {
    display: none;
    width: 100%;
}

.spzh-navigation-perspective.active {
    display: block;
}

.spzh-navigation-perspective.hidden {
    display: none;
}

/* 确保页眉导航容器在视角内正常渲染（与 header-functions 中 spzh-header-nav 一致） */
.spzh-navigation-perspective .spzh-header-nav {
    display: block;
    width: 100%;
}

/* 页眉内标准菜单样式（wp_nav_menu 与回退共用，与 Kadence 导航风格一致） */
.spzh-custom-header .menu-container {
    display: flex;
    width: 100%;
    justify-content: center;
}
.spzh-custom-header .kb-navigation.menu,
.spzh-custom-header .menu {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0 1em;
    justify-content: center;
    align-items: center;
}
/* 桌面第二行导航：子项间距略大；单行不换行（中间区由 flex 分配，避免 wrap 主动折行） */
@media (min-width: 1025px) {
    .spzh-custom-header .spzh-header-nav .menu {
        flex-wrap: nowrap;
        gap: 0 1.5em;
    }
}
/* 1160px 以下：缩小中间导航间距，避免压缩成两行 */
@media (max-width: 1160px) {
    .spzh-custom-header .spzh-header-nav .menu {
        gap: 0 1em;
    }
    .spzh-custom-header .spzh-header-nav .menu > li > a {
        padding-left: 0.4em;
        padding-right: 0.4em;
    }
}

.spzh-custom-header .menu > li {
    position: relative;
}
/* 有子菜单的项：链接与箭头同一行、箭头约 80% 大小、与文字同色（仅桌面第二行 .spzh-header-nav 内） */
@media (min-width: 1025px) {
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children {
        display: inline-flex;
        align-items: center;
        flex-wrap: nowrap;
        border-radius: 4px;
        position: relative;
    }
    /* 悬停背景用伪元素延伸，与菜单文字左侧等宽延伸到箭头右侧，不改变子项实际间距 */
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children::before {
        content: none;
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children > a {
        flex: 0 0 auto;
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children > .spzh-nav-arrow-wrap {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        margin-left: 0.2em;
        flex-shrink: 0;
        /* 让箭头继承 li 的 currentColor，方便与文字完全同步 */
        color: inherit;
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children .spzh-nav-arrow {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        background-color: currentColor;
        -webkit-mask-position: center;
        -webkit-mask-repeat: no-repeat;
        -webkit-mask-size: contain;
        mask-position: center;
        mask-repeat: no-repeat;
        mask-size: contain;
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children .spzh-nav-arrow-down {
        -webkit-mask-image: url('https://www.simpsonprotocolzh.com/wp-content/uploads/2026/02/kc_roll_down.svg');
        mask-image: url('https://www.simpsonprotocolzh.com/wp-content/uploads/2026/02/kc_roll_down.svg');
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children .spzh-nav-arrow-up {
        -webkit-mask-image: url('https://www.simpsonprotocolzh.com/wp-content/uploads/2026/02/kc_roll_up.svg');
        mask-image: url('https://www.simpsonprotocolzh.com/wp-content/uploads/2026/02/kc_roll_up.svg');
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children .spzh-nav-arrow-down {
        opacity: 1;
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children .spzh-nav-arrow-up {
        opacity: 0;
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children.is-open .spzh-nav-arrow-down {
        opacity: 0;
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children.is-open .spzh-nav-arrow-up {
        opacity: 1;
    }
    /* 桌面：悬停/聚焦即展开下拉 */
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children:hover > .sub-menu,
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children:focus-within > .sub-menu {
        display: block;
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children.is-open > .sub-menu {
        display: block;
    }
    .spzh-custom-header .spzh-header-nav .menu > li.menu-item-has-children > .sub-menu {
        flex-basis: 100%;
    }
}
@media (max-width: 1024px) {
    .spzh-custom-header .spzh-header-nav .menu .spzh-nav-arrow-wrap,
    .spzh-custom-header .menu .spzh-nav-arrow-wrap {
        display: none !important;
    }
}
/* 顶部与第二行导航项：默认浅一级；当前加字重；悬停不加粗（主导航下划线见下） */
.spzh-custom-header .menu > li {
    color: var(--spzh-nav-text-default);
    font-weight: var(--spzh-nav-weight-default);
}
.spzh-custom-header .menu > li > a {
    display: block;
    padding: 0.6em 0.5em;
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}
.spzh-custom-header .menu > li:hover,
.spzh-custom-header .menu > li:focus-within {
    color: var(--spzh-nav-text-emphasis);
    font-weight: var(--spzh-nav-weight-default);
}
.spzh-custom-header .menu > li.current-menu-item,
.spzh-custom-header .menu > li.current-menu-ancestor {
    color: var(--spzh-nav-text-emphasis);
    font-weight: var(--spzh-nav-weight-emphasis);
}
.spzh-custom-header .menu > li > a:hover,
.spzh-custom-header .menu > li > a:focus,
.spzh-custom-header .menu > li:hover > a,
.spzh-custom-header .menu > li:focus-within > a,
.spzh-custom-header .menu > li.current-menu-item > a,
.spzh-custom-header .menu > li.current-menu-item > a:hover,
.spzh-custom-header .menu > li.current-menu-item > a:focus,
.spzh-custom-header .menu > li.current-menu-ancestor > a,
.spzh-custom-header .menu > li.current-menu-ancestor > a:hover,
.spzh-custom-header .menu > li.current-menu-ancestor > a:focus {
    color: inherit;
    font-weight: inherit;
    border-bottom: none;
    text-decoration: none;
}

/*
 * 桌面主导航顶层标签悬停：下划线仅在文字（.spzh-nav-label）下方，自左向右。
 * 抽屉见 ≤1024 区块。
 */
@media (min-width: 1025px) {
    .spzh-custom-header .spzh-header-nav .menu > li > a .spzh-nav-label {
        position: relative;
        display: inline-block;
    }

    .spzh-custom-header .spzh-header-nav .menu > li > a .spzh-nav-label::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 1px;
        background-color: currentColor;
        transform: scaleX(0);
        transform-origin: left center;
        transition: transform 0.28s ease;
        pointer-events: none;
    }

    .spzh-custom-header .spzh-header-nav .menu > li > a:hover .spzh-nav-label::after,
    .spzh-custom-header .spzh-header-nav .menu > li > a:focus-visible .spzh-nav-label::after,
    .spzh-custom-header .spzh-header-nav .menu > li:hover > a .spzh-nav-label::after,
    .spzh-custom-header .spzh-header-nav .menu > li:focus-within > a .spzh-nav-label::after {
        transform: scaleX(1);
    }
}
.spzh-custom-header .menu .sub-menu {
    display: none;
    position: absolute;
    /* 贴齐父级 li 底边（桌面第二行即页眉底）；勿再用负 top 叠层 */
    top: 100%;
    left: 2px;
    width: max-content;
    min-width: 0;
    list-style: none;
    margin: 0;
    padding: 1em 0;
    background: var(--global-palette9, #fff);
    border: 1px solid var(--spzh-dropdown-border);
    /* 贴页眉底：上边直角；下两角圆角 */
    border-radius: 0 0 var(--kc-border-radius-md, 8px) var(--kc-border-radius-md, 8px);
    box-shadow: none;
    z-index: 1000;
    overflow: hidden;
}
.spzh-custom-header .menu li:hover > .sub-menu,
.spzh-custom-header .menu li.menu-item-has-children:focus-within > .sub-menu {
    display: block;
}
.spzh-custom-header .menu .sub-menu li {
    color: var(--kc-read-body);
    font-weight: var(--spzh-nav-weight-default);
}
.spzh-custom-header .menu .sub-menu a {
    display: block;
    padding: 0.6em var(--spzh-dropdown-pad-x-end) 0.6em var(--spzh-dropdown-pad-x-start);
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.spzh-custom-header .menu .sub-menu a:hover,
.spzh-custom-header .menu .sub-menu a:focus {
    color: var(--spzh-sc-tag-color) !important;
    text-decoration: none;
}
.spzh-custom-header .menu .sub-menu li.current-menu-item > a,
.spzh-custom-header .menu .sub-menu li.current-menu-ancestor > a {
    position: relative;
    z-index: 0;
    isolation: isolate;
    color: var(--spzh-dropdown-current-text) !important;
    text-decoration: none;
}
.spzh-custom-header .menu .sub-menu li.current-menu-item > a::before,
.spzh-custom-header .menu .sub-menu li.current-menu-ancestor > a::before {
    content: '';
    position: absolute;
    inset: 0 var(--spzh-dropdown-current-inset-x);
    background: var(--spzh-dropdown-current-bg);
    border-radius: var(--spzh-dropdown-current-radius);
    z-index: -1;
}
.spzh-custom-header .menu .sub-menu li.current-menu-item > a:hover,
.spzh-custom-header .menu .sub-menu li.current-menu-item > a:focus,
.spzh-custom-header .menu .sub-menu li.current-menu-ancestor > a:hover,
.spzh-custom-header .menu .sub-menu li.current-menu-ancestor > a:focus {
    color: var(--spzh-sc-tag-color) !important;
    text-decoration: none;
}
/* 桌面第二行：导航项撑满行高，下拉顶边与页眉底边对齐 */
@media (min-width: 1025px) {
    .spzh-custom-header .spzh-header-row-2 .spzh-header-nav .menu > li {
        height: 60px;
        align-items: center;
    }
    .spzh-custom-header .spzh-header-row-2 .spzh-header-nav .menu > li > a {
        display: flex;
        align-items: center;
        height: 100%;
        padding-top: 0;
        padding-bottom: 0;
    }
    .spzh-custom-header .spzh-header-row-2 .spzh-header-nav .menu .sub-menu {
        top: 100%;
        left: 2px;
        margin-top: 0;
    }

    /* 桌面下拉：左右内边距略增 */
    .spzh-custom-header .spzh-header-row-2 .spzh-header-nav .menu > li > .sub-menu > li > a {
        padding-left: calc(var(--spzh-dropdown-pad-x-start) + 0.2em);
        padding-right: calc(var(--spzh-dropdown-pad-x-end) + 0.2em);
    }
}

/* 响应式布局调整 */
@media (max-width: 1024px) {
    .spzh-row2-center-content {
        order: 3;
        width: 100%;
        margin-top: 15px;
        min-height: auto;
    }
}

/* ==================== 第二行右侧：用户菜单（用户信息在最右侧） ==================== */
.spzh-header-row-2 .spzh-header-col-right,
.spzh-header-row-2 .spzh-col-content-right,
.spzh-user-menu-row2 {
    overflow: visible;
}
.spzh-user-menu-row2 {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 第二行右侧 SP学苑 入口（单视角模式显示） */
.spzh-row2-sp-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 400;
    color: var(--kc-read-muted);
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.spzh-row2-sp-link:hover,
.spzh-row2-sp-link:focus {
    color: var(--global-palette-highlight, var(--global-palette4));
}
.spzh-row2-sp-link:hover {
    background-color: var(--spzh-bg-light, rgba(0, 0, 0, 0.04));
}

/* 可进入学苑：常显悬停态（紫色字 + 浅灰底） */
.spzh-row2-sp-link--active {
    color: var(--global-palette-highlight, var(--global-palette4)) !important;
    background-color: var(--spzh-bg-light, rgba(0, 0, 0, 0.04));
}
.spzh-row2-sp-link--active:hover {
    color: var(--global-palette-highlight, var(--global-palette4));
    background-color: var(--spzh-hover-surface, rgba(0, 0, 0, 0.06));
}

/* 不可进入学苑：默认灰字、点击无效 */
.spzh-row2-sp-link--disabled {
    cursor: not-allowed;
    pointer-events: none;
    color: var(--kc-read-muted);
}

/* 用户操作按钮（在左侧） */
.spzh-user-actions {
    display: flex;
    gap: 8px;
}

.spzh-user-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--kc-read-muted);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.spzh-user-action-btn:hover {
    color: var(--global-palette-highlight, var(--global-palette3));
}

.spzh-action-icon {
    display: block;
}

/* 用户信息（在最右侧，与 Kadence 简洁风格一致） */
.spzh-user-info-right {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    background: transparent;
    border-radius: 0;
    border: none;
    margin-left: auto;
}

.spzh-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.spzh-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spzh-user-details-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* 文字右对齐 */
}

.spzh-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--kc-read-title);
    text-align: right;
}

.spzh-user-role {
    font-size: 12px;
    color: var(--kc-read-muted);
    margin-top: 2px;
    text-align: right;
}

/* ==================== 手机/小平板单行栏与抽屉（≤1024px） ==================== */
.spzh-mobile-top-bar,
.spzh-mobile-drawer {
    display: none;
}

@media (max-width: 1024px) {
    .spzh-desktop-rows {
        display: none !important;
    }

    .spzh-mobile-top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 56px;
        padding: 0 16px;
        background: var(--global-palette9, #fff);
        border-bottom: none;
        gap: 12px;
    }

    .spzh-mobile-nav-toggle {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        padding: 0;
        border: none;
        background: transparent;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
        border-radius: 0;
    }
    .spzh-mobile-nav-toggle:hover,
    .spzh-mobile-nav-toggle:focus,
    .spzh-mobile-nav-toggle:active {
        background: transparent;
        color: inherit;
    }
    /* 悬停仅填充图标圆（最浅紫），不填整块按钮、不用品牌亮紫 */
    .spzh-mobile-nav-toggle:hover .spzh-mobile-nav-icon-menu,
    .spzh-mobile-nav-toggle:focus .spzh-mobile-nav-icon-menu,
    .spzh-mobile-nav-toggle:active .spzh-mobile-nav-icon-menu {
        background-color: var(--kc-purple-50, #f5f4fa);
        border-radius: 50%;
    }
    .spzh-mobile-nav-toggle .spzh-mobile-nav-icon {
        width: 30px;
        height: 30px;
        display: block;
        box-sizing: border-box;
    }
    .spzh-mobile-nav-toggle .spzh-mobile-nav-icon-close {
        width: 24px;
        height: 24px;
    }
    .spzh-mobile-nav-toggle .spzh-mobile-nav-icon[hidden] {
        display: none !important;
    }
    .spzh-mobile-nav-toggle.spzh-mobile-nav-toggle-hidden {
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .spzh-mobile-logo-wrap {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
    }
    .spzh-mobile-logo-wrap .kb-identity,
    .spzh-mobile-logo-wrap .kb-logo {
        max-height: 36px;
        width: auto;
    }
    .spzh-mobile-logo-wrap img.kb-logo,
    .spzh-mobile-logo-wrap .spzh-logo-wide,
    .spzh-mobile-logo-wrap svg.kb-logo,
    .spzh-mobile-logo-wrap svg.spzh-logo-wide,
    .spzh-mobile-logo-wrap img.spzh-logo-academy,
    .spzh-mobile-logo-wrap svg.spzh-logo-academy {
        max-height: 36px;
        max-width: 200px;
    }
    /* 覆盖 .spzh-logo-wide 默认 48px 等，保证移动顶栏 logo 为 36px */
    #spzh-custom-header .spzh-mobile-logo-wrap .kb-logo.spzh-logo-wide,
    #spzh-custom-header .spzh-mobile-logo-wrap .kc-brand-logo.kb-logo.spzh-logo-wide,
    #spzh-custom-header .spzh-mobile-logo-wrap .kb-logo.spzh-logo-academy,
    #spzh-custom-header .spzh-mobile-logo-wrap .kc-brand-logo.kb-logo.spzh-logo-academy {
        max-height: 36px;
        max-width: 200px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .spzh-mobile-user-wrap {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* P1：公共站点抽屉改右（body.spzh-mobile-drawer-site，见 eval-mobile-nav-drawer-right-plan.md） */
    body.spzh-mobile-drawer-site {
        --spzh-nav-drawer-edge: right;
        --spzh-nav-toggle-edge: right;
    }

    body.spzh-mobile-drawer-site .spzh-mobile-drawer-inner {
        left: auto;
        right: 0;
        max-width: var(--spzh-public-drawer-width, 320px);
        box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
    }

    /* 账户子视图：返回与关闭同一行，关闭在抽屉最右侧 */
    body.spzh-mobile-drawer-site .spzh-mobile-drawer-inner.spzh-drawer-view-account .spzh-mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 12px 8px 8px;
    }

    body.spzh-mobile-drawer-site .spzh-mobile-drawer-inner.spzh-drawer-view-account .spzh-mobile-drawer-header-spacer {
        display: none;
    }

    body.spzh-mobile-drawer-site .spzh-mobile-drawer-inner.spzh-drawer-view-account .spzh-drawer-account-back {
        display: inline-flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    body.spzh-mobile-drawer-site .spzh-mobile-drawer-inner.spzh-drawer-view-account .spzh-mobile-drawer-close {
        position: static;
        transform: none;
        left: auto;
        right: auto;
        flex-shrink: 0;
        margin-left: auto;
    }

    /* 抽屉：遮罩 + 侧板 */
    .spzh-mobile-drawer {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        visibility: hidden;
        opacity: 0;
        transition: visibility 0.25s, opacity 0.25s;
    }
    .spzh-mobile-drawer.spzh-drawer-open {
        visibility: visible;
        opacity: 1;
    }

    .spzh-mobile-drawer-backdrop {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
    }

    .spzh-mobile-drawer-inner {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 320px;
        height: 100%;
        background: var(--global-palette9, #fff);
        box-shadow: 2px 0 12px rgba(0,0,0,0.15);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 0;
    }

    /* 抽屉右上角关闭按钮（绝对定位保证在右侧） */
    .spzh-mobile-drawer-header {
        flex-shrink: 0;
        position: relative;
        min-height: 48px;
        padding: 12px 8px 8px;
    }
    .spzh-mobile-drawer-header-spacer {
        display: none;
    }
    .spzh-mobile-drawer-close {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: none;
        background: transparent;
        color: var(--kc-read-body);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        border-radius: 8px;
    }
    .spzh-mobile-drawer-close:hover,
    .spzh-mobile-drawer-close:focus {
        background: var(--spzh-hover-surface);
        color: var(--kc-read-title);
    }
    .spzh-mobile-drawer-close img {
        display: block;
    }

    /* 中部可滚动区：站点导航 + SP学苑/视角链接 */
    body.spzh-mobile-drawer-site .spzh-mobile-drawer-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 上部导航：在 drawer-body 内自然堆叠，由外层统一滚动 */
    .spzh-mobile-drawer-nav {
        flex: 0 0 auto;
        overflow: visible;
        padding: 0 20px 16px;
        text-align: left;
    }
    .spzh-mobile-drawer-nav .spzh-drawer-nav-block {
        display: none;
        width: 100%;
    }
    .spzh-mobile-drawer-nav .spzh-drawer-nav-block.active {
        display: block;
    }
    .spzh-mobile-drawer-nav .menu-container {
        justify-content: flex-start;
        padding-left: 0;
        margin-left: 0;
    }
    .spzh-mobile-drawer-nav .menu,
    .spzh-mobile-drawer-nav .kb-navigation.menu {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        width: 100%;
        gap: 0;
        padding-left: 0;
        margin-left: 0;
        list-style: none;
    }
    .spzh-mobile-drawer-nav .menu > li {
        width: 100%;
        border-bottom: 1px solid var(--spzh-line);
    }
    /* 取消上部导航最后一项底边线，避免与分区横线重复 */
    .spzh-mobile-drawer-nav .menu > li:last-child {
        border-bottom: none;
    }
    .spzh-mobile-drawer-nav .menu > li > a {
        position: relative;
        padding: 14px 0;
        font-size: 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        width: 100%;
        box-sizing: border-box;
    }

    /*
     * 抽屉主导航顶层：与桌面一致——悬停不加粗；
     * 下划线仅在 .spzh-nav-label 文字下方（不拉满整行、不盖住展开图标）。
     */
    .spzh-mobile-drawer-nav .menu > li:hover,
    .spzh-mobile-drawer-nav .menu > li:focus-within {
        font-weight: var(--spzh-nav-weight-default);
    }

    .spzh-mobile-drawer-nav .menu > li > a .spzh-nav-label {
        position: relative;
        display: inline-block;
    }

    .spzh-mobile-drawer-nav .menu > li > a .spzh-nav-label::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 1px;
        background-color: currentColor;
        transform: scaleX(0);
        transform-origin: left center;
        transition: transform 0.28s ease;
        pointer-events: none;
    }

    .spzh-mobile-drawer-nav .menu > li > a:hover .spzh-nav-label::after,
    .spzh-mobile-drawer-nav .menu > li > a:focus-visible .spzh-nav-label::after,
    .spzh-mobile-drawer-nav .menu > li:hover > a .spzh-nav-label::after,
    .spzh-mobile-drawer-nav .menu > li:focus-within > a .spzh-nav-label::after {
        transform: scaleX(1);
    }

    .spzh-mobile-drawer-nav .menu-item-has-children > a .spzh-drawer-submenu-icon {
        flex-shrink: 0;
        width: 20px;
        height: 20px;
        margin-left: 8px;
    }
    .spzh-mobile-drawer-nav .menu-item-has-children > a .spzh-drawer-submenu-icon img {
        display: block;
        width: 20px;
        height: 20px;
    }
    .spzh-mobile-drawer-nav .menu .sub-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding-top: 0;
        padding-bottom: 0.75em;
        padding-left: calc(var(--kc-spacing-2) + var(--spzh-dropdown-edge-inset));
        width: 100%;
        box-sizing: border-box;
    }
    /* 抽屉内仅用 .open 控制展开，禁用 hover/focus-within 以免触屏“粘住”导致收起无效 */
    .spzh-mobile-drawer-nav .menu li:hover > .sub-menu,
    .spzh-mobile-drawer-nav .menu li.menu-item-has-children:focus-within > .sub-menu {
        display: none;
    }
    .spzh-mobile-drawer-nav .menu li.menu-item-has-children.open > .sub-menu {
        display: block;
    }
    /* 展开时父行置于上层，保证右侧箭头可点 */
    .spzh-mobile-drawer-nav .menu-item-has-children.open > a {
        position: relative;
        z-index: 2;
    }
    /* 手机端抽屉主导航顶层：禁用原生 text-decoration；悬停下划线由 ::after 负责 */
    .spzh-mobile-drawer-nav .menu > li > a:hover,
    .spzh-mobile-drawer-nav .menu > li > a:focus,
    .spzh-mobile-drawer-nav .menu > li.current-menu-item > a,
    .spzh-mobile-drawer-nav .menu > li.current-menu-item > a:hover,
    .spzh-mobile-drawer-nav .menu > li.current-menu-item > a:focus,
    .spzh-mobile-drawer-nav .menu > li.current-menu-ancestor > a,
    .spzh-mobile-drawer-nav .menu > li.current-menu-ancestor > a:hover,
    .spzh-mobile-drawer-nav .menu > li.current-menu-ancestor > a:focus {
        border-bottom: none !important;
        text-decoration: none !important;
        font-weight: inherit;
    }
    .spzh-mobile-drawer-nav .menu .sub-menu a:hover,
    .spzh-mobile-drawer-nav .menu .sub-menu a:focus {
        color: var(--spzh-sc-tag-color) !important;
        text-decoration: none !important;
    }
    .spzh-mobile-drawer-nav .menu .sub-menu li.current-menu-item > a,
    .spzh-mobile-drawer-nav .menu .sub-menu li.current-menu-ancestor > a {
        position: relative;
        z-index: 0;
        isolation: isolate;
        color: var(--spzh-dropdown-current-text) !important;
        text-decoration: none !important;
    }
    .spzh-mobile-drawer-nav .menu .sub-menu li.current-menu-item > a::before,
    .spzh-mobile-drawer-nav .menu .sub-menu li.current-menu-ancestor > a::before {
        content: '';
        position: absolute;
        inset: 0 var(--spzh-dropdown-current-inset-x);
        background: var(--spzh-dropdown-current-bg);
        border-radius: var(--spzh-dropdown-current-radius);
        z-index: -1;
    }
    .spzh-mobile-drawer-nav .menu .sub-menu li.current-menu-item > a:hover,
    .spzh-mobile-drawer-nav .menu .sub-menu li.current-menu-item > a:focus,
    .spzh-mobile-drawer-nav .menu .sub-menu li.current-menu-ancestor > a:hover,
    .spzh-mobile-drawer-nav .menu .sub-menu li.current-menu-ancestor > a:focus {
        color: var(--spzh-sc-tag-color) !important;
        text-decoration: none !important;
    }

    /* 中部【来访者】【催眠师】【SP学苑】：位于账户区之上 */
    .spzh-mobile-drawer-links {
        flex-shrink: 0;
        padding: 20px 20px 16px;
        display: flex;
        flex-direction: column;
        gap: 0;
        text-align: left;
        position: relative;
    }
    .spzh-mobile-drawer-links::before {
        content: '';
        display: block;
        position: absolute;
        left: 20px;
        right: 20px;
        top: 0;
        height: 1px;
        background: var(--spzh-line);
    }
    .spzh-drawer-link {
        display: flex;
        align-items: center;
        padding: 14px 6.4px;
        font-size: 16px;
		font-weight: 500;
        color: var(--kc-read-body);
        text-decoration: none;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
        border-bottom: 1px solid var(--spzh-line);
    }
    .spzh-mobile-drawer-links .spzh-drawer-link:last-child {
        border-bottom: none;
    }
    /* SP学苑与 English Overview 之间：灰色分栏线（替换条目底边） */
    .spzh-mobile-drawer-links .spzh-drawer-link-sp {
        border-bottom: none;
    }
    .spzh-drawer-links-divider {
        flex-shrink: 0;
        height: 1px;
        margin: 8px 0;
        background: var(--spzh-line, var(--kc-border, #e2e8f0));
    }
    .spzh-drawer-link:hover,
    .spzh-drawer-link:focus {
        color: var(--global-palette-highlight, var(--global-palette3));
        background: var(--spzh-hover-surface);
    }
    .spzh-drawer-link.active {
        color: var(--global-palette-highlight, var(--global-palette3));
        font-weight: 600;
    }
    .spzh-drawer-link--disabled {
        cursor: not-allowed;
        pointer-events: none;
        color: var(--kc-read-muted);
    }

	/* 抽屉底部「SP学苑」：仅高亮这一行，匹配桌面状态与样式 */
	.spzh-mobile-drawer-links .spzh-drawer-link-sp:not(.spzh-drawer-link--disabled) {
		/* 字重与桌面 SP 学苑一致：不额外加粗 */
		font-weight: 400;
		/* 文本颜色与桌面高亮一致 + 浅色背景 */
		color: var(--global-palette-highlight, var(--global-palette4)) !important;
		background-color: var(--spzh-bg-light, rgba(0, 0, 0, 0.04));
	}

	/* 抽屉底部「SP学苑」禁用态：保持灰色，无背景 */
	.spzh-mobile-drawer-links .spzh-drawer-link-sp.spzh-drawer-link--disabled {
		font-weight: 400;
		color: var(--kc-read-muted) !important;
		background-color: transparent !important;
	}

	/* English Overview：常规字重，位于分栏线下方 */
	.spzh-mobile-drawer-links .spzh-drawer-link-en {
		font-weight: 400;
	}

    /* P2 drill-down：主菜单底部账户入口；点击进入独立账户子视图 */
    body.spzh-mobile-drawer-site .spzh-mobile-drawer-account-entry {
        flex-shrink: 0;
        padding: 16px 20px 24px;
        position: relative;
    }

    body.spzh-mobile-drawer-site .spzh-mobile-drawer-account-entry::before {
        content: '';
        display: block;
        position: absolute;
        left: 20px;
        right: 20px;
        top: 0;
        height: 1px;
        background: var(--spzh-line);
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-entry {
        display: flex;
        align-items: center;
        gap: 12px;
        /* 相对父级 20px 内边距略向外扩，悬停底左右更宽 */
        width: calc(100% + 16px);
        max-width: none;
        margin: 0 -8px;
        padding: 8px 12px;
        border: none;
        background: transparent;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        min-height: 44px;
        box-sizing: border-box;
        box-shadow: none;
        transform: none;
        filter: none;
        appearance: none;
        -webkit-appearance: none;
        border-radius: var(--kc-border-radius-sm, 4px);
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-entry:hover,
    body.spzh-mobile-drawer-site .spzh-drawer-account-entry:focus,
    body.spzh-mobile-drawer-site .spzh-drawer-account-entry:focus-visible,
    body.spzh-mobile-drawer-site .spzh-drawer-account-entry:active {
        background: var(--spzh-hover-surface) !important;
        border-radius: var(--kc-border-radius-sm, 4px) !important;
        box-shadow: none !important;
        transform: none !important;
        filter: none !important;
        outline: none;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-entry-arrow {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-entry-panel .kc-guest-menu-independent {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding-top: 8px;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-entry-panel .kc-login-btn-independent,
    body.spzh-mobile-drawer-site .spzh-drawer-account-entry-panel .kc-register-btn-independent {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 8px;
        font-size: 16px;
        font-weight: 500;
        color: var(--kc-read-body);
        text-decoration: none;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-entry-panel .kc-login-btn-independent:hover,
    body.spzh-mobile-drawer-site .spzh-drawer-account-entry-panel .kc-register-btn-independent:hover,
    body.spzh-mobile-drawer-site .spzh-drawer-account-entry-panel .kc-login-btn-independent:focus,
    body.spzh-mobile-drawer-site .spzh-drawer-account-entry-panel .kc-register-btn-independent:focus {
        color: var(--global-palette-highlight, var(--global-palette3));
        background: var(--spzh-hover-surface);
        border-radius: var(--spzh-radius-sm, 4px);
    }

    /* 账户子视图：与主菜单互斥 */
    body.spzh-mobile-drawer-site .spzh-mobile-drawer-inner.spzh-drawer-view-account .spzh-mobile-drawer-body,
    body.spzh-mobile-drawer-site .spzh-mobile-drawer-inner.spzh-drawer-view-account .spzh-mobile-drawer-account-entry {
        display: none;
    }

    body.spzh-mobile-drawer-site .spzh-mobile-drawer-account-view {
        display: none;
        flex: 1 1 auto;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
    }

    body.spzh-mobile-drawer-site .spzh-mobile-drawer-inner.spzh-drawer-view-account .spzh-mobile-drawer-account-view:not([hidden]) {
        display: flex;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-back {
        flex-shrink: 0;
        display: none;
        align-items: center;
        gap: 6px;
        margin: 0;
        padding: 6px 10px;
        border: none;
        background: transparent;
        color: var(--kc-read-body);
        font-size: 16px;
        font-weight: 500;
        line-height: 1.25;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        min-height: 44px;
        box-sizing: border-box;
        text-align: left;
        box-shadow: none;
        transform: none;
        filter: none;
        appearance: none;
        -webkit-appearance: none;
        border-radius: var(--kc-border-radius-sm, 4px);
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-back:not([hidden]) {
        display: inline-flex;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-back:hover,
    body.spzh-mobile-drawer-site .spzh-drawer-account-back:focus,
    body.spzh-mobile-drawer-site .spzh-drawer-account-back:focus-visible,
    body.spzh-mobile-drawer-site .spzh-drawer-account-back:active {
        background: var(--spzh-hover-surface) !important;
        color: var(--kc-read-body) !important;
        border-radius: var(--kc-border-radius-sm, 4px) !important;
        box-shadow: none !important;
        transform: none !important;
        filter: none !important;
        outline: none;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-back img {
        display: block;
        flex-shrink: 0;
        width: 1em;
        height: 1em;
        object-fit: contain;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-view-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 12px 24px;
    }

    /* 与桌面下拉对齐：头像中心 = 菜单图标中心（左 pad 16 + 半头像 14 = 30；图标 8+13+9） */
    body.spzh-mobile-drawer-site .spzh-drawer-account-view-content .kc-user-info-independent {
        padding: 14px 8px 14px 16px;
        margin: 0;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-view-content .kc-menu-items-independent {
        padding: 10px 0 0;
    }

    /* 触控高度保留；勿用简写 padding 冲掉图标对齐的左右内边距 */
    body.spzh-mobile-drawer-site .spzh-drawer-account-view-content .kc-menu-item-independent {
        min-height: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-view-content a.kc-signout-independent {
        padding-top: 18px !important;
        padding-bottom: 8px !important;
        min-height: 0;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-view-content .kc-notification-area-independent {
        display: none !important;
    }

    /* 主抽屉底部账户入口：与桌面下拉头区统一（灰圆 + 仅用户名，保留右侧箭头进子视图） */
    body.spzh-mobile-drawer-site .spzh-drawer-account-entry .kc-user-avatar-independent {
        width: 28px !important;
        height: 28px !important;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0 !important;
        background: var(--kc-border-subtle, #e6e6e6);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-entry .kc-user-avatar-independent .kc-svg-container,
    body.spzh-mobile-drawer-site .spzh-drawer-account-entry .kc-user-avatar-independent .kc-svg-container svg {
        display: none !important;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-entry .kc-user-email-independent {
        display: none !important;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-entry .kc-user-name-independent {
        font-size: 14px;
        font-weight: 400;
        color: var(--kc-read-title, var(--kc-text-title, #383344));
        line-height: 1.35;
    }

    body.spzh-mobile-drawer-site .spzh-drawer-account-entry .kc-user-details-independent {
        display: flex;
        align-items: center;
        min-height: 28px;
    }
}

body.spzh-drawer-body-open {
    overflow: hidden;
}
/* 抽屉从展开到完全收起期间隐藏顶栏展开按钮。已知：点击展开时仍可能轻微闪一下变紫/关闭图标，待后续优化 */
body.spzh-drawer-body-open .spzh-mobile-nav-toggle {
    visibility: hidden;
    pointer-events: none;
}
body.spzh-drawer-body-open .spzh-mobile-nav-toggle:hover,
body.spzh-drawer-body-open .spzh-mobile-nav-toggle:focus {
    background: transparent;
    color: inherit;
}

/* ==================== 响应式设计（桌面 1025px+ 保留原两行） ==================== */
@media (min-width: 1025px) {
    .spzh-mobile-top-bar,
    .spzh-mobile-drawer {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .spzh-header-col-left,
    .spzh-header-col-right {
        flex: 0 0 250px;
    }
}

@media (max-width: 768px) {
    .spzh-header-col-left {
        flex: 0 0 200px;
    }
    
    .spzh-header-col-right {
        flex: 0 0 200px;
    }
    
    .spzh-perspective-switcher-simple {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .spzh-current-indicator-simple {
        margin-left: 0;
        margin-top: 3px;
        width: 100%;
        text-align: center;
    }
    
    .spzh-placeholder {
        padding: 4px 10px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .spzh-user-menu-row2 {
        gap: 10px;
    }
    
    .spzh-user-info-right {
        padding: 4px 8px;
    }
    
    .spzh-user-name {
        font-size: 13px;
    }
    
    .spzh-user-role {
        font-size: 11px;
    }
    
    .spzh-user-action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .spzh-header-row-1 {
        height: 50px;
    }
    
    .spzh-header-row-2 {
        height: 70px;
    }
    
    .spzh-header-col-left,
    .spzh-header-col-right {
        flex: 0 0 150px;
    }
    
    .kb-logo {
        max-height: 30px;
    }
    
    .spzh-logo-wide {
        max-height: 44px;
        max-width: 200px;
    }
    
    .kb-site-title {
        font-size: 16px;
    }
    
    .spzh-perspective-link-simple,
    .spzh-sp-link-simple {
        padding: 2px 6px;
        font-size: 11px;
    }
    
    .spzh-current-indicator-simple {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .spzh-placeholder {
        padding: 3px 8px;
        font-size: 11px;
        min-width: 50px;
    }
    
    .spzh-user-menu-row2 {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .spzh-user-actions {
        width: 100%;
        justify-content: center;
    }
    
    .spzh-user-info-right {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
    
    .spzh-user-details-right {
        align-items: center; /* 在小屏幕上居中对齐 */
    }
    
    .spzh-user-name,
    .spzh-user-role {
        text-align: center;
    }
}

.spzh-header-row-2 {
    border-bottom: none;
}

/* ==================== 用户头像（无彩色描边） ==================== */
.spzh-user-avatar {
    border: 1px solid var(--spzh-line);
    box-shadow: none;
}

/* ==================== 页眉右侧用户头像悬停状态优化 ==================== */
/* 自定义页眉内：仅在头像后面加极浅灰色圆形背景，保持图标填充风格不变 */
.spzh-custom-header .kc-user-toggle-independent:hover .kc-user-avatar-independent .kc-svg-container,
.spzh-custom-header .kc-user-toggle-independent:focus .kc-user-avatar-independent .kc-svg-container {
    background-color: var(--spzh-bg-gray, #F5F5F5);
    border-radius: 999px;
}

/* 覆盖课程页头里为悬停状态强制填充 SVG 的规则，保持图标本身的描边/填充风格 */
.spzh-custom-header .kc-user-toggle-independent:hover .kc-user-avatar-independent .kc-svg-container svg,
.spzh-custom-header .kc-user-toggle-independent:focus .kc-user-avatar-independent .kc-svg-container svg {
    fill: none;
    stroke: currentColor;
    color: inherit;
}

/* ==================== 打印样式 ==================== */
@media print {
    .spzh-custom-header {
        box-shadow: none;
        border-bottom: 1px solid var(--kc-border-subtle);
    }
    
    .spzh-placeholder,
    .spzh-user-actions {
        display: none;
    }
    
    .spzh-user-info-right {
        background: none;
        border: none;
    }
}

/* ==================== 用户菜单（自定义页眉用，下拉 fixed 定位，避免被裁切） ==================== */
/* 来源：与 kc-course-header.css 用户下拉菜单一致，此处为自定义页眉场景单独提供，避免依赖 Kadence 内联重复输出 */

.kc-user-dropdown-independent {
    position: relative;
    display: inline-block;
}

.kc-user-toggle-independent {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    outline: none;
}

/* 自定义页眉：下拉 fixed，顶边贴齐页眉底；右缘贴视口；浅边、无重阴影、仅下圆角 */
@media (min-width: 769px) {
    .spzh-custom-header .kc-user-menu-independent .kc-dropdown-menu-independent {
        position: fixed !important;
        top: var(--spzh-header-height, 60px) !important;
        right: 0 !important;
        left: auto !important;
        margin-top: 0 !important;
        background: var(--global-palette9, #ffffff);
        border: 1px solid var(--spzh-divider, var(--kc-border-subtle, rgba(0, 0, 0, 0.06)));
        border-radius: 0 0 var(--kc-border-radius-md, 8px) var(--kc-border-radius-md, 8px);
        box-shadow: none;
        min-width: 0;
        width: 210px;
        z-index: 1001;
        overflow: hidden;
    }
}

.kc-user-info-independent {
    position: relative;
    padding: 14px 16px;
    background: var(--global-palette9, #ffffff);
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.kc-user-details-independent {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.kc-user-name-independent {
    font-weight: 400;
    color: var(--kc-read-title);
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
}

.kc-user-email-independent {
    font-size: 12px;
    color: var(--kc-read-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.kc-menu-items-independent {
    display: flex;
    flex-direction: column;
    padding: 10px 0 0;
    gap: 0;
}

.kc-menu-item-independent {
    display: flex;
    align-items: center;
    padding-top: 0.6em;
    padding-bottom: 0.6em;
    padding-left: 13px;
    padding-right: 8px;
    color: var(--kc-read-body);
    text-decoration: none;
    gap: 16px;
    margin: 0 8px;
    border: none;
    border-radius: var(--kc-border-radius-sm, 4px);
}

.kc-menu-item-independent:hover {
    background: var(--spzh-hover-surface);
}

.kc-menu-icon-independent {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--kc-read-secondary, #6c6671);
}

.kc-menu-icon-independent svg {
    width: 100%;
    height: 100%;
    color: var(--kc-read-secondary, #6c6671) !important;
}

.kc-menu-text-independent {
    font-size: 14px;
    flex: 1;
}

.kc-dropdown-menu-independent a.kc-menu-item-independent.kc-signout-independent,
.kc-signout-independent {
    color: var(--kc-read-body) !important;
    border: none !important;
    margin: 10px 8px 10px !important;
    padding-top: 18px !important;
    padding-bottom: 8px !important;
    border-radius: var(--kc-border-radius-sm, 4px) !important;
    background: transparent !important;
}

.kc-dropdown-menu-independent a.kc-menu-item-independent.kc-signout-independent:hover,
.kc-signout-independent:hover {
    background: transparent !important;
    color: var(--kc-read-body) !important;
}

/* 学苑入口：未购买课程时显示为浅色，提示需先购买 */
.kc-menu-item-no-access {
    opacity: 0.6;
    color: var(--kc-read-muted) !important;
    cursor: not-allowed;
}
.kc-menu-item-no-access:hover {
    opacity: 0.7;
    background: var(--spzh-hover-surface);
    color: var(--kc-read-muted) !important;
}

.kc-menu-arrow-independent {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    min-height: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

.kc-menu-arrow-independent svg {
    width: 10px !important;
    height: 10px !important;
    color: var(--kc-read-muted) !important;
}

/* 公共页用户下拉：与主导航一致——无重阴影，顶边贴页眉底 */
.kc-user-menu-independent .kc-dropdown-menu-independent {
	box-shadow: none;
}

.kc-menu-divider-independent {
    height: 1px;
    background: var(--spzh-divider);
    margin: 4px 16px;
}

/* ===== 移动端用户下拉：贴齐页眉底 ===== */
@media (max-width: 768px) {
	.spzh-custom-header .kc-user-menu-independent .kc-dropdown-menu-independent {
		position: fixed !important;
		top: var(--spzh-header-height, 56px) !important;
		right: 0 !important;
		left: auto !important;
		bottom: auto !important;
		width: 210px !important;
		max-width: calc(100vw - 16px) !important;
		min-width: 0 !important;
		max-height: 75vh !important;
		margin-top: 0 !important;
		background: var(--global-palette9, #ffffff) !important;
		border: 1px solid var(--spzh-divider, var(--kc-border-subtle, rgba(0, 0, 0, 0.06))) !important;
		border-radius: 0 0 var(--kc-border-radius-md, 8px) var(--kc-border-radius-md, 8px) !important;
		box-shadow: none !important;
		z-index: 10010 !important;
		overflow-y: auto;
	}
}

.kc-notification-area-independent,
.kc-user-dropdown-independent {
    display: inline-flex;
    align-items: center;
}

/* 导师角色：强制用户下拉菜单可见（覆盖可能按角色隐藏的规则） */
body.role-instructor .kc-user-dropdown-independent,
body.role-llms_instructor .kc-user-dropdown-independent {
    display: inline-flex !important;
    visibility: visible !important;
}

/* 公共页眉：暂时隐藏通知栏目（样式偏大、与用户名重叠），见 TD-HEADER-02 */
.spzh-custom-header .kc-notification-area-independent {
    display: none !important;
}

.kc-user-menu-independent {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
}

.kc-user-toggle-independent {
    display: flex;
    align-items: center;
    padding: 0;
}

.kc-user-display-independent {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.kc-user-toggle-independent:hover,
.kc-user-toggle-independent:active,
.kc-user-toggle-independent:focus,
.kc-user-toggle-independent:visited {
    background: transparent;
    border-color: transparent;
    color: inherit;
    outline: none;
    box-shadow: none;
    text-decoration: none;
}

.kc-dropdown-menu-independent .kc-user-info-independent {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.kc-dropdown-menu-independent .kc-user-avatar-independent {
    flex-shrink: 0 !important;
}

.kc-dropdown-menu-independent .kc-user-details-independent {
    flex: 1 !important;
    min-width: 0 !important;
}

@media (max-width: 768px) {
    .spzh-custom-header .kc-dropdown-menu-independent {
        top: var(--spzh-header-height, 56px) !important;
        right: 0 !important;
        min-width: 0;
        width: 210px;
        max-width: calc(100vw - 16px);
    }
    .kc-username-text-independent {
        display: none !important;
    }
}

/* ==================== WP Admin Bar 避让（普通页面/文章自定义页眉） ==================== */
@media screen {
    body.admin-bar {
        --wp-admin-bar-height: 32px;
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar {
        --wp-admin-bar-height: 46px;
    }
}

/*
 * html margin 被 kc-init 清零时，勿沿用 Kadence admin-bar 的 min-height:calc(100vh-32px)+padding-top，
 * 否则 #wrapper 外盒矮一截工具栏高，视口底露出 body 紫色背景。
 */
body.admin-bar #wrapper {
    min-height: 100vh !important;
    box-sizing: border-box !important;
}

body.admin-bar:not(.spzh-header-mobile-fixed):not(.spzh-header-is-fixed) #wrapper {
    padding-top: var(--wp-admin-bar-height);
}

body.admin-bar #spzh-custom-header {
    margin-top: 0;
}

body.admin-bar.spzh-header-mobile-fixed #spzh-custom-header,
body.admin-bar.spzh-header-is-fixed #spzh-custom-header {
    top: var(--spzh-header-top-offset, var(--wp-admin-bar-height)) !important;
}

@media (min-width: 769px) {
    body.admin-bar .spzh-custom-header .kc-user-menu-independent .kc-dropdown-menu-independent {
        top: calc(var(--spzh-header-height, 60px) + var(--spzh-header-top-offset, var(--wp-admin-bar-height))) !important;
    }

    body.admin-bar.spzh-header-is-fixed .spzh-custom-header .kc-user-menu-independent .kc-dropdown-menu-independent {
        top: calc(var(--spzh-header-height, 60px) + var(--spzh-header-top-offset, var(--wp-admin-bar-height))) !important;
    }
}

@media (max-width: 768px) {
    body.admin-bar .spzh-custom-header .kc-user-menu-independent .kc-dropdown-menu-independent {
        top: calc(var(--spzh-header-height, 56px) + var(--spzh-header-top-offset, var(--wp-admin-bar-height))) !important;
    }
}

/* ==================== 页眉固定：≤1024 始终固定、无滞后/无动画；≥1025 滚动滞后 + 渐显（spzh-header-sticky.js） ==================== */

/* 小平板/手机：自加载起固定顶栏，不占「先滚走再固定」逻辑，无 transform 动画（避免抽屉 fixed 被包含块裁切） */
@media (max-width: 1024px) {
    /*
     * 顶距放在 main#inner-wrap，而不是 body：
     * Kadence header.php 结构为 body > #wrapper > [页眉] + main#inner-wrap；position:fixed 页眉不占流，
     * main 会从 #wrapper 顶部贴齐视口。仅给 body 加 padding-top 易被主题/其它规则抵消；
     * Kadence Blocks 内联的 .kb-row-layout-xxx > .kt-row-column-wrap { padding-top: 1.5rem } 只是行内留白，
     * 无法替代「整段页眉 + admin bar」的占位。此处用与 JS 变量一致的 calc，首行仍叠加上述 1.5rem。
     */
    body.spzh-header-mobile-fixed {
        padding-top: 0 !important;
    }

    body.spzh-header-mobile-fixed #inner-wrap {
        padding-top: calc(max(var(--spzh-header-height, 56px), 56px) + var(--spzh-header-top-offset, 0px)) !important;
    }

    body.spzh-header-mobile-fixed #spzh-custom-header {
        position: fixed !important;
        top: var(--spzh-header-top-offset, var(--wp-admin-bar-height, 0px));
        left: 0;
        right: 0;
        z-index: 1000;
        transform: none;
    }
}

/* 桌面：滚动超 1.5 屏后固定 + 渐显 */
@media (min-width: 1025px) {
    body.spzh-header-is-fixed {
        padding-top: calc(var(--spzh-header-height, 60px) + var(--spzh-header-top-offset, 0)) !important;
    }

    body.spzh-header-is-fixed #spzh-custom-header {
        position: fixed !important;
        top: var(--spzh-header-top-offset, var(--wp-admin-bar-height, 0px));
        left: 0;
        right: 0;
        z-index: 1000;
        animation: spzh-header-fade-in 0.6s ease-out forwards;
    }
}

@keyframes spzh-header-fade-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Admin Bar 避让（文件末尾，压过 Kadence calc(100vh-32px) 与固定顶栏 top 回退） */
body.admin-bar #wrapper {
    min-height: 100vh !important;
    box-sizing: border-box !important;
}

body.admin-bar:not(.spzh-header-mobile-fixed):not(.spzh-header-is-fixed) #wrapper {
    padding-top: var(--wp-admin-bar-height) !important;
}

body.admin-bar.spzh-header-mobile-fixed #spzh-custom-header,
body.admin-bar.spzh-header-is-fixed #spzh-custom-header {
    top: var(--spzh-header-top-offset, var(--wp-admin-bar-height)) !important;
}
