/*
 * RZX 2025 自定义样式
 * 来源: wp_global_styles (twentytwentyfive Custom Styles, 2026-10-11 迁移)
 * 说明: 原数据库 11KB 全局样式中的手写 CSS 部分
 */

/* =========================================
   1. 全局终极清理 (强制移除所有链接的线、框、阴影)
   ========================================= */
a, a:focus, a:active,
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, 
.wp-block-post-title a,             
.wp-block-tag-cloud a,              
.post-tags a {
    text-decoration: none !important; 
    box-shadow: none !important;      
    outline: none !important;         
    border: none !important;          
    background-image: none !important;
}

*:focus, *:focus-visible {
    outline: none !important;
}

/* =========================================
   2. 全局 Hover 颜色 (强效穿透版，全站粉红)
   ========================================= */
body a:hover,
body a:hover *, 
.wp-block-site-title a:hover,
.wp-block-post-title a:hover,
.wp-block-tag-cloud a:hover,
.post-tags a:hover {
    color: #e05be5 !important; 
    text-decoration: none !important;
    transition: color 0.2s ease-in-out;
}

/* =========================================
   3. 导航专属修复 (当前页粉字 + 悬停黑底)
   ========================================= */
/* 移除焦点虚线框 */
.ray-href-style:focus,
.ray-href-style a:focus,
.ray-href-style a:active {
    outline: none !important;
    box-shadow: none !important;
}

/* 当前所在页面：黑色半透明模拟深色黑底（避免半透明顶栏出现实色灰板感）+ 左右深色阴影 + 白色加粗文字 */
.ray-href-style.current-menu-item,
.ray-href-style.current-menu-ancestor {
    background-color: rgba(0, 0, 0, 0.65) !important;
    box-shadow: inset 12px 0 12px -10px rgba(0, 0, 0, 0.7),
                inset -12px 0 12px -10px rgba(0, 0, 0, 0.7) !important;
    z-index: 5;
    position: relative;
}
.ray-href-style.current-menu-item > a,
.ray-href-style.current-menu-item > a *,
.ray-href-style.current-menu-ancestor > a,
.ray-href-style.current-menu-ancestor > a * {
    color: #ffffff !important;
    font-weight: 600;
}

/* 主菜单 Hover 效果（黑色低透明度模拟淡灰底 + 淡左右阴影，文字变黑） */
.ray-href-style:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: inset 12px 0 12px -10px rgba(0, 0, 0, 0.1),
                inset -12px 0 12px -10px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease;
}

/* 主菜单 Hover 时文字变黑（放在当前页面样式下方，确保悬停时能覆盖白色） */
.ray-href-style:hover > a,
.ray-href-style:hover > a * {
    color: #000000 !important;
}

/* 【彻底消除 1-2px 错位】强制下拉菜单与父级完美贴合 */
.ray-href-style .wp-block-navigation__submenu-container {
    box-shadow: none !important;
    border: none !important;      /* 干掉默认的 1px 边框 */
    margin: 0 !important;         /* 干掉可能偷偷存在的内外边距偏移 */
    left: 0 !important;           /* 强制左边缘物理对齐父级！ */
    background-color: #444444 !important; /* 统一下拉菜单底色 */
}

/* 确保下拉菜单里的文字也是纯白，抵抗全局粉色 */
.ray-href-style .wp-block-navigation__submenu-container a {
    color: #ffffff !important;
}

/* =========================================
   4. 其他独立组件
   ========================================= */
.ray-padding-25 {
    padding: 25px 15px !important; 
}

.ray-blurred-background {
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px); 
}

/* 固定侧边栏 */
.sticky-sidebar {
    position: sticky;
    top: 32px;
    align-self: flex-start;
    max-height: calc(100vh - 50px);
    overflow-y: auto;
}

/* 滚动条美化可选 */
.sticky-sidebar::-webkit-scrollbar { width: 6px; }
.sticky-sidebar::-webkit-scrollbar-thumb {
    background: #e4e6eb;
    border-radius: 3px;
}
/* =========================================
   修复：有子菜单的导航项顶部白条问题
   核心：让 submenu 上移 1px 并贴紧父级，同时确保有子菜单的 li
   hover 时整个高度都有背景色
   ========================================= */

/* 1. 子菜单向上贴紧父级，消除 1px 缝隙 */
.ray-href-style.has-child .wp-block-navigation__submenu-container {
    top: calc(100% - 1px) !important;  /* 上移 1px 贴紧 */
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
}

/* 2. 确保有子菜单的 li 在 hover 时整行背景色连续（从顶到底铺满）*/
.ray-href-style.has-child {
    background-color: transparent;
}
.ray-href-style.has-child:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* 3. 子菜单第一项不要有顶部间距（看起来像白条的最常见原因）*/
.ray-href-style .wp-block-navigation__submenu-container > .wp-block-navigation-item:first-child > .wp-block-navigation-item__content {
    padding-top: 0.5em !important;  /* 保持内边距但不要额外留白 */
    margin-top: 0 !important;
}

/* 4. 保险：让父 li 的 a 标签撑满高度，背景色和 li 一致 */
.ray-href-style.has-child > a {
    height: 100%;
    display: flex;
    align-items: center;
}
/* =========================================
   修复：有子菜单的导航项顶部白条问题
   根因：submenu <ul> 继承了 ray-padding-25，顶部 25px padding
   与父菜单 hover 背景色衔接处透出页面白色背景
   ========================================= */

/* 1. 子菜单容器去掉继承的 ray-padding-25（核心修复）*/
.wp-block-navigation__submenu-container.ray-padding-25,
.wp-block-navigation__submenu-container.wp-block-navigation-submenu {
    padding: 0 !important;
}

/* 2. 子菜单内每个项目单独设置内边距 */
.wp-block-navigation__submenu-container .wp-block-navigation-item {
    padding: 0.6em 1.2em !important;
}

/* 3. 子菜单第一项不留顶部间距 */
.wp-block-navigation__submenu-container > .wp-block-navigation-item:first-child {
    padding-top: 0.8em !important;
}

/* 4. 子菜单最后一项不留底部间距 */
.wp-block-navigation__submenu-container > .wp-block-navigation-item:last-child {
    padding-bottom: 0.8em !important;
}

/* 5. 有子菜单的父 li：hover 时整行背景色铺满 */
.wp-block-navigation-item.has-child.ray-href-style:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* 6. 父 li 的 a 标签撑满高度 */
.wp-block-navigation-item.has-child.ray-href-style > a {
    height: 100%;
    display: flex;
    align-items: center;
}

/* 7. 子菜单与父级完全贴合无间隙 */
.wp-block-navigation .has-child:not(.open-on-click):hover > .wp-block-navigation__submenu-container,
.wp-block-navigation .has-child:not(.open-on-click).is-menu-open > .wp-block-navigation__submenu-container {
    top: 100% !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
    border: none !important;
}

/* =========================================
   修复v2：有子菜单的导航项顶部白条（真正根因）
   根因：has-child 的 <a> 被 WP 设为 display:flex，高度 27px，
   导致 li 总高 77px < nav 83px，垂直居中后顶部露出 3px 白条。
   修复：让 has-child 的 <a> 高度与普通项一致（33px），
   同时 li 用 stretch 撑满 nav 高度。
   ========================================= */

/* 1. 核心修复：has-child 的 <a> 高度对齐普通项 */
.wp-block-navigation-item.has-child.ray-href-style > a {
    display: flex !important;
    align-items: center !important;
    height: 33px !important;
    min-height: 33px !important;
    line-height: 33px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* 2. 让 has-child 的 li 也撑满 nav 高度（stretch） */
.wp-block-navigation-item.has-child.ray-href-style {
    align-self: stretch !important;
}

/* 3. 保险：nav 内所有顶层 li 统一 stretch */
nav.wp-block-navigation .wp-block-navigation-item {
    align-self: stretch !important;
}

/* 4. 保险：has-child 的 li 在 hover 时背景覆盖整个高度 */
.wp-block-navigation-item.has-child.ray-href-style:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* 5. 移除上一轮针对 padding 的错误修复（恢复子菜单内边距） */
.wp-block-navigation__submenu-container .wp-block-navigation-item {
    padding: 0.6em 1.2em !important;
}


/* =========================================
   老站顶部导航风格复刻（2026-10-23）
   字体、状态色重声明、首页屏蔽、header 底阴影
   ========================================= */

/* 导航字体：字号/文字色/字重/大小写/字距已在导航块属性里设置（Site Editor → 选中导航块 → 排版/颜色 可视化调整）
   此处只兜底字体族；状态样式（hover/当前页）在下方区块 */
.wp-block-navigation-item.ray-href-style > a {
    font-family: Arial, Helvetica, sans-serif;
}
/* 压住主题自带 GS 规则 :root :where(.wp-block-navigation-link){font-size:large}
   否则导航项字号恒为 22px、编辑器里改字号无效；改回继承自导航块设置（ul 内联字号，Site Editor 可调） */
.wp-block-navigation-item.ray-href-style {
    font-size: inherit;
}

/* 状态色在字体规则之后重新声明（保证覆盖字体灰色） */
.ray-href-style:hover > a,
.ray-href-style:hover > a * {
    color: #000000 !important;
}
.ray-href-style.current-menu-item > a,
.ray-href-style.current-menu-item > a *,
.ray-href-style.current-menu-ancestor > a,
.ray-href-style.current-menu-ancestor > a * {
    color: #ffffff !important;
    font-weight: 600;
}

/* 首页屏蔽：只屏蔽“当前页”高亮（首页是 HOME，HOME 不高亮）；hover 反馈保留 */
body.home .ray-href-style.current-menu-item,
body.home .ray-href-style.current-menu-ancestor {
    background-color: transparent !important;
    box-shadow: none !important;
}
body.home .ray-href-style.current-menu-item > a,
body.home .ray-href-style.current-menu-item > a *,
body.home .ray-href-style.current-menu-ancestor > a,
body.home .ray-href-style.current-menu-ancestor > a * {
    color: #777 !important;
    font-weight: 500;
}
/* home：HOME 项（当前页）hover 时仍显示 hover 反馈（特异性压过上方 current 屏蔽） */
body.home .ray-href-style.current-menu-item:hover,
body.home .ray-href-style.current-menu-ancestor:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: inset 12px 0 12px -10px rgba(0, 0, 0, 0.1),
                inset -12px 0 12px -10px rgba(0, 0, 0, 0.1) !important;
}
body.home .ray-href-style.current-menu-item:hover > a,
body.home .ray-href-style.current-menu-item:hover > a *,
body.home .ray-href-style.current-menu-ancestor:hover > a,
body.home .ray-href-style.current-menu-ancestor:hover > a * {
    color: #000000 !important;
}

/* 顶部栏下部：淡灰透明阴影 */
.rzx-site-header {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

/* 拟物菜单一行不换行 + 图标 30-100px */
.rzx-skeuo__menu { flex-wrap: nowrap !important; gap: 16px !important; justify-content: space-between !important; }
.rzx-skeuo__item { flex: 1 1 0 !important; min-width: 30px !important; max-width: 100px !important; width: auto !important; }
.rzx-skeuo__icon { width: 100% !important; height: auto !important; aspect-ratio: 1 !important; }
.rzx-skeuo { max-width: 1000px !important; margin-left: auto !important; margin-right: auto !important; padding: 0 10px !important; }

/* LOGO 圆角方形 */
.rzx-site-header .wp-block-site-logo img, .rzx-site-header .wp-block-site-logo { border-radius: 4px !important; }