/* === Stack 主题 - 杂志风标题美化 (终极隔离版) === */
/* 核心逻辑：使用 ">" 选择器，只美化文章直属标题，不再穿透 Shortcode */

/* ============================================
   1. 核心变量配置
   ============================================ */
:root {
    --h-main: #3b82f6;            /* 主色调：蓝色 */
    --h-bg: rgba(59, 130, 246, 0.06);  /* H2 背景装饰色 (极淡) */
    --h-border: rgba(59, 130, 246, 0.3); /* H3 线条颜色 */
}

[data-scheme="dark"] {
    --h-main: #60a5fa;
    --h-bg: rgba(96, 165, 250, 0.12);
    --h-border: rgba(96, 165, 250, 0.4);
}

/* ============================================
   2. 文章主体标题样式
   注意：所有选择器都加了 ">"，这是隔离 Shortcode 的关键！
   ============================================ */

/* 全局重置 (仅针对直属标题) */
.article-content > h2, 
.article-content > h3, 
.article-content > h4, 
.article-content > h5 {
    color: var(--card-text-color-main);
    font-family: inherit;
    line-height: 1.35;
    position: relative;
    scroll-margin-top: 100px;
    font-weight: 800;
}

/* --- H2: 核心章节 --- */
.article-content > h2 {
    font-size: 2.1rem;
    margin-top: 3.5rem;
    margin-bottom: 2rem;
    
    padding: 12px 20px;
    background: linear-gradient(to right, var(--h-bg), transparent);
    border-left: 6px solid var(--h-main);
    border-radius: 0 6px 6px 0;
}

/* --- H3: 子章节 --- */
.article-content > h3 {
    font-size: 1.75rem;
    margin-top: 2.8rem;
    margin-bottom: 1.2rem;
    padding-bottom: 10px;
    
    border-bottom: 2px solid var(--h-border);
    display: flex;
    align-items: center;
}

/* H3 的特殊符号 § */
.article-content > h3::before {
    content: '§';
    font-family: serif;
    font-size: 1.2em;
    color: var(--h-main);
    margin-right: 12px;
    opacity: 0.8;
    line-height: 1;
}

/* --- H4: 小标题 --- */
.article-content > h4 {
    font-size: 1.45rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

/* H4 的菱形点缀 */
.article-content > h4::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: var(--h-main);
    margin-right: 12px;
    transform: rotate(45deg);
    opacity: 0.9;
    flex-shrink: 0;
}

/* --- H5: 备注 --- */
.article-content > h5 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    color: var(--card-text-color-secondary);
    border-left: 3px solid var(--card-border-color);
    padding-left: 12px;
}

/* ============================================
   3. 特殊补丁区
   如果某些特殊的 Shortcode 内部结构非常奇怪，导致 ">" 也不管用，
   可以在这里单独处理。但对于标准的 Readbook/Gallery，上面的 ">" 已经完美解决。
   ============================================ */

/* 预防万一：强制清除 Shortcode 容器内可能残留的伪元素 */
.article-content .readbook-card h3::before,
.article-content .note-card h3::before,
.article-content .hugo-gallery h3::before {
    content: none !important;
    display: none !important;
}

/* 强制 Readbook 标题恢复默认样式 (保险起见) */
.readbook-title {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}




/* === 悬浮面包屑插件 (HUD Design) === */

/* 1. 外层容器：负责定位和居中 */
#float-breadcrumb-plugin {
    position: fixed;
    bottom: 40px;          /* 距离底部的高度，可微调 */
    left: 50%;
    transform: translateX(-50%); /* 核心：绝对居中 */
    z-index: 99999;        /* 保证在所有元素最上层 */
    
    width: auto;
    display: flex;
    justify-content: center;
    pointer-events: none;  /* 容器透传点击，不挡鼠标 */
}

/* 2. 胶囊本体：核心设计 */
.plugin-capsule {
    pointer-events: auto;  /* 恢复点击 */
    
    /* 玻璃拟态背景 (白底微透 + 模糊) */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    /* 胶囊形状 */
    padding: 10px 24px;    /* 增加内边距，更像胶囊 */
    border-radius: 50px;   /* 满圆角 */
    
    /* 悬浮质感 */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); /* 柔和的长阴影 */
    border: 1px solid rgba(255, 255, 255, 0.6); /* 淡淡的描边 */
    
    /* 布局与字体 */
    display: flex;
    align-items: center;
    gap: 10px;             /* 元素间距 */
    font-size: 14px;
    color: #333;
    font-weight: 500;
    letter-spacing: 0.3px;
    
    /* 进场动画：从下往上浮出 */
    animation: hudFloatUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 3. 暗黑模式适配 (Dark Mode) */
[data-scheme="dark"] .plugin-capsule {
    background: rgba(40, 40, 40, 0.85); /* 深灰微透 */
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* 4. 链接项 (首页、分类) */
.plugin-item {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 6px;              /* 图标和文字的间距 */
    transition: all 0.2s ease;
    opacity: 0.75;         /* 默认稍微淡一点 */
}

/* 悬停高亮 */
.plugin-item:hover {
    opacity: 1;
    color: var(--h-main, #3b82f6); /* 使用你的主题蓝 */
    transform: translateY(-1px);   /* 轻微上浮反馈 */
}

/* 5. 分隔符 (/) */
.plugin-sep {
    color: #ccc;
    font-size: 0.85em;
    margin: 0 2px;
}
[data-scheme="dark"] .plugin-sep { color: #666; }

/* 6. 当前文章标题 */
.plugin-current {
    font-weight: 600;
    color: var(--card-text-color-main, #000);
    opacity: 1;
    
    /* 限制标题长度，防止胶囊太长 */
    max-width: 180px; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
[data-scheme="dark"] .plugin-current { color: #fff; }

/* 7. 动画定义 */
@keyframes hudFloatUp {
    from { 
        transform: translateY(40px) scale(0.95); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

/* === 最后的防线：强制清除页脚背景 === */
/* 确保之前的旧代码绝对不会影响页面 */
footer, .site-footer, .footer {
    background: transparent !important;
    background-color: transparent !important;
}