/*隐藏父主题的导航栏*/
#navbar-main,
.navbar-main{
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* 1. 统一尺寸 30×30 px */
.nav-brand img,
.nav-links img{
    width:50px !important;
    height:50px !important;
}

/* 2. 垂直居中（与导航栏文字对齐） */
.nav-brand,
.nav-brand img,
.nav-links a{
    display:inline-flex;
    align-items:center;
}

/* 3. 可选微调：让图标与文字间距更顺眼 */
.nav-links img{
    margin-right:0px;
}







/* 导航栏三栏：Logo | 菜单 | 按钮 */
#memory-navbar{
    display:flex;
    align-items:center;
}

/* Logo 固定最左 */
.nav-brand{
    margin-right:auto;
    flex:0 0 auto;
}
.nav-brand img{width:30px;height:30px;border-radius:50%;}

/* 一级菜单水平居中，宽松间距 */
.nav-links{
    display:flex;
    gap:36px;
    margin:0;
    padding:0;
    list-style:none;
}
.nav-links > li{        /* 只选一级 */
    position:relative;  /* 给子菜单定位用 */
}

/* 右侧按钮固定最右 */
.nav-right{margin-left:auto;display:flex;gap:20px;}




/* 二级菜单默认隐藏 */
.nav-links ul.sub-menu{
    display:none;
    position:absolute;
    top:100%;
    left:50%;
    transform:translateX(-50%);
    background:#fff;
    border-radius:6px;
    box-shadow:0 4px 12px rgba(0,0,0,.15);
    padding:8px 0;
    min-width:140px;
    z-index:9999;
}
.nav-links ul.sub-menu li{
    list-style:none;
}
.nav-links ul.sub-menu a{
    display:block;
    padding:6px 16px;
    color:#333;
    white-space:nowrap;
}
.nav-links ul.sub-menu a:hover{
    background:#f5f5f5;
}

/* hover 时显示二级菜单 */
.nav-links > li:hover > ul.sub-menu{
    display:block;
}




/* 仅放大导航栏 Logo 图片 */
.nav-brand img{
    width:  48px !important;   /* 想多大就调多大 */
    height: 48px !important;
}
/* 给导航栏 Logo 添加白色圆框 */
.nav-brand img {
    border: 3px solid #fff;
    border-radius: 50%;
    /* 如需阴影，可再打开下一行 */
    box-shadow: 0 0 6px rgba(0,0,0,.2); 
}


#search-toggle{position:relative;}   /* 让 inlineForm 以它为参考系 */

/*让搜索按钮与药丸之间留点空隙*/
#search-toggle{margin-right:12px;}

/* 滚动后导航栏背景改为更深的黑色 */
body.scrolled #memory-navbar{
    background:rgba(25,25,25,.80) !important;   /* 原来是 .75，可再调到 .9 或写死 #111 */
}

/* 增大一级菜单之间的间距 */
.nav-links{
    gap:48px;   /* 原来是 24-36px，可按需改成 48/60/... */
}





/* 移动端隐藏自定义 Logo/菜单 */
@media(max-width:768px){
    #memory-navbar .nav-brand,
    #memory-navbar .nav-center{
        display:none !important;
    }
    /* 确保汉堡按钮始终可见 */
    #custom-hamburger{
        display:flex !important;   /* 强制显示 */
    }
}

/* 汉堡按钮样式 */
/* 默认隐藏汉堡按钮 */
#custom-hamburger {
    display: none;
}

/* 仅移动端显示 */
@media (max-width: 768px) {
    #custom-hamburger {
        display: flex !important;
        margin-right: auto;
        border: none;
        background: transparent;
        padding: 4px;
        flex-direction: column;
        gap: 4px;
    }
    #custom-hamburger span {
        width: 22px;
        height: 2px;
        background: #fff;
    }
}
#custom-hamburger span{
    width:22px;
    height:2px;
    background:#fff;
}





/* ... 在您现有的CSS中添加/修改以下代码 ... */

/* 移动端侧边栏抽屉效果 */
@media (max-width: 768px) {
    #memory_sidebar_mask {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0,0,0,.5) !important;
        z-index: 99998 !important;   /* 比侧边栏低一级 */
        display: none;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    #leftbar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 99999 !important;   /* 最高层级 */
        overflow-y: auto;
        transition: left .3s ease;
        background: #fff;
    }
    
    body.sidebar-open #memory_sidebar_mask { 
        display: block !important; 
    }
    
    body.sidebar-open #leftbar { 
        left: 0 !important; 
    }
    
    /* 确保Argon的遮罩不会干扰 */
    #sidebar_mask {
        display: none !important;
    }
    
    /* 汉堡按钮动画效果 */
    #custom-hamburger {
        transition: transform 0.3s ease;
        z-index: 100000 !important;
    }
    
    body.sidebar-open #custom-hamburger {
        transform: rotate(90deg);
    }
    
    body.sidebar-open #custom-hamburger span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    
    body.sidebar-open #custom-hamburger span:nth-child(2) {
        opacity: 0;
    }
    
    body.sidebar-open #custom-hamburger span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
    
    #custom-hamburger span {
        transition: all 0.3s ease;
    }
}

/* 确保在移动端显示汉堡按钮 */
@media (max-width: 768px) {
    #custom-hamburger {
        display: flex !important;
        margin-right: auto;
        border: none;
        background: transparent;
        padding: 4px;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
    }
}

















/* 侧边栏滑动更柔和（带弹性） */
@media (max-width: 768px) {
    #leftbar {
        transition: left 0.4s cubic-bezier(0.25, 1.25, 0.5, 1);
    }

    /* 遮罩层淡入淡出 */
    #memory_sidebar_mask {
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    body.sidebar-open #memory_sidebar_mask {
        opacity: 1 !important;
    }

    /* 菜单项依次淡入 */
    #leftbar ul li {
        opacity: 0;
        transform: translateX(-20px);
        transition: all 0.4s ease;
    }
    body.sidebar-open #leftbar ul li {
        opacity: 1;
        transform: translateX(0);
    }
    body.sidebar-open #leftbar ul li:nth-child(1) { transition-delay: 0.1s; }
    body.sidebar-open #leftbar ul li:nth-child(2) { transition-delay: 0.2s; }
    body.sidebar-open #leftbar ul li:nth-child(3) { transition-delay: 0.3s; }
    body.sidebar-open #leftbar ul li:nth-child(4) { transition-delay: 0.4s; }
    /* 可以继续往下加 nth-child(...) */

    /* 汉堡按钮呼吸动画（未展开时） */
    #custom-hamburger {
        animation: breathe 2s infinite;
    }
    body.sidebar-open #custom-hamburger {
        animation: none; /* 打开时取消呼吸动画 */
    }

    @keyframes breathe {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.1); }
    }
}




.post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-card:hover {
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 0 16px 32px rgba(0,0,0,0.12);
}



.nav-links a {
    position: relative;
    transition: color 0.3s ease;
}
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0%;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}
.nav-links a:hover::after {
    width: 100%;
}



#leftbar {
    transition: left 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}








/* 导航栏菜单项整体放大（含文字+图标） */
.nav-links > li > a,
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease;
    transform-origin: center;
}

.nav-links > li:hover > a,
.nav-brand:hover {
    transform: scale(1.1);
}

/* 图标单独放大（可选更强效果） */
.nav-links img,
.nav-brand img {
    transition: transform 0.3s ease;
    transform-origin: center;
}

.nav-links > li:hover img,
.nav-brand:hover img {
    transform: scale(1.2);
}

/* 防止放大时触发布局抖动 */
.nav-links > li,
.nav-brand {
    overflow: visible;
    transform-origin: center;
}


.nav-brand img {
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-brand:hover img {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.5);
}

.nav-links > li > a {
    color: #fff;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links > li:hover > a {
    color: #667eea;
}


/* 搜索按钮 & 药丸按钮：统一放大悬停动画 */
#search-toggle,
#theme-toggle {
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: center;
}

#search-toggle:hover,
#theme-toggle:hover {
    transform: scale(1.2);
}

/* 搜索图标内部图片也同步放大 */
#search-toggle img {
    transition: transform 0.3s ease;
    transform-origin: center;
}

#search-toggle:hover img {
    transform: scale(1.15);
}

#search-toggle:hover,
#theme-toggle:hover {
    filter: drop-shadow(0 0 6px rgba(102, 126, 234, 0.6));
}



/* 移动端不换行、字体自适应缩小 */
.section-header .section-nav{
    flex-wrap: nowrap;                /* 禁止换行 */
}

.nav-tab{
    white-space: nowrap;              /* 文字不换行 */
}

/* 极小屏再压一点 */
@media (max-width: 360px){
    .nav-tab{
        font-size: clamp(10px, 3vw, 12px);
        padding: 4px 2px;
    }
}

/* 导航栏菜单按钮：移动端不换行 + 字体自适应缩小 */
.nav-center .nav-links {
    flex-wrap: nowrap;          /* 禁止换行 */
}

.nav-links > li > a {
    white-space: nowrap;        /* 文字不换行 */
}

/* 超窄屏再压一点 */
@media (max-width: 360px) {
    .nav-links > li > a {
        font-size: clamp(10px, 2.2vw, 12px);
    }
}



/* 1首页按钮 取消旧高亮 */
.nav-links a[href*="home"],
.nav-links a[href="/"],
.nav-links .current-menu-item a {
    color: #fff !important;
}



/* 二级菜单容器 */
.nav-links > li {
    position: relative;   /* 给子菜单定位 */
}

.nav-links ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    min-width: 180px;
    max-width: 220px;
    margin: 4px 0 0;
    padding: 8px 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
}

/* 暗黑模式 */
body.darkmode .nav-links ul.sub-menu {
    background: rgba(30, 30, 30, 0.75);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* 悬停出现二级 */
.nav-links > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


.nav-links .sub-menu li {
    list-style: none;
    position: relative;   /* 给三级用 */
}

.nav-links .sub-menu a {
    display: block;
    padding: 10px 18px;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.25s, background 0.25s;
}

body.darkmode .nav-links .sub-menu a {
    color: #e2e8f0;
}

.nav-links .sub-menu a:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}


.nav-links .sub-menu .sub-menu {
    top: -8px;            /* 与父项对齐 */
    left: 100%;           /* 右侧弹出 */
    margin-left: 4px;
    min-width: 160px;
    transform: translateX(-8px);
}

.nav-links .sub-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* 1️⃣ 二级菜单卡片（初始隐藏） */
.nav-links .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    min-width: 200px;
    max-width: 240px;
    margin: 6px 0 0;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.96);
    transition: opacity 0.35s ease,
                visibility 0s linear 0.5s,   /* ← 离开后再等 0.5s 才隐藏 */
                transform 0.35s cubic-bezier(.34,1.56,.64,1);
}

body.darkmode .nav-links .sub-menu {
    background: rgba(30, 30, 30, 0.65);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* 2️⃣ 悬停时立即滑出 + 微弹跳 */
.nav-links > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity 0.35s ease,
                visibility 0s linear 0.5s,   /* ← 立即可见 */
                transform 0.35s cubic-bezier(.34,1.56,.64,1);
}

/* 3️⃣ 二级菜单项（卡片按钮） */
.nav-links .sub-menu a {
    display: block;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 15px;
    color: #333;
    transition: background 0.25s, color 0.25s, transform 0.25s;
}

body.darkmode .nav-links .sub-menu a {
    color: #e2e8f0;
}

.nav-links .sub-menu a:hover {
    background: rgba(102, 126, 234, 0.18);
    color: #667eea;
    transform: translateX(4px);
}


/* 强制显示三级菜单 */
.nav-links .sub-menu .sub-menu {
    display: block !important;
    position: absolute;
    top: -12px;
    left: 100%;
    margin-left: 6px;
    min-width: 180px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px) scale(.96);
    transition: all .35s cubic-bezier(.34,1.56,.64,1);
    z-index: 10000;
}

/* 悬停时出现 */
.nav-links .sub-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
}

body.darkmode .nav-links .sub-menu .sub-menu {
    background: rgba(30,30,30,.75);
}







/* 二级菜单：上下左右各多 8 px 气垫 */
.nav-links > li > .sub-menu::before {
    content: '';
    position: absolute;
    top: -8px;          /* 向上延伸 8 px */
    left: -8px;
    right: -8px;
    bottom: -8px;
    z-index: -1;        /* 不影响点击 */
}

/* 三级菜单：同样 8 px 气垫 */
.nav-links .sub-menu .sub-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    z-index: -1;
}


.pio-show {
  transform: scale(2) translateY(-40px);
   transform-origin: 50% 0; /* 控制放大基准点 */
}