/* 
 * 侧边栏布局强制修复覆盖 - 增强版
 * 覆盖任何错误的float: right和margin-left: 20px规则
 * 添加时间: $(date)
 * 优先级: 最高级修复
 */

/* ===== 核心强制修复 ===== */
/* 使用最高特异性选择器确保覆盖 */
html body.single-post .sidebar,
html body.single .sidebar,
html body .sidebar,
body.single-post .sidebar,
body.single .sidebar,
body .sidebar,
.single-post .sidebar,
.single .sidebar,
.sidebar {
    /* 强制浮动布局 */
    float: left !important;
    margin-left: -300px !important;
    width: 300px !important;
    
    /* 确保显示 */
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    
    /* 重置可能冲突的属性 */
    clear: none !important;
    right: auto !important;
    left: auto !important;
}

/* ===== 覆盖所有可能的错误规则 ===== */
/* 覆盖任何float: right规则 */
.sidebar[style*="float: right"],
.sidebar[style*="float:right"] {
    float: left !important;
}

/* 覆盖任何margin-left: 20px规则 */
.sidebar[style*="margin-left: 20px"],
.sidebar[style*="margin-left:20px"] {
    margin-left: -300px !important;
}

/* ===== 确保内容区域正确 ===== */
.content-wrap .sidebar ~ .content,
.content-wrap .content:has(+ .sidebar),
.content-wrap > .content {
    float: left !important;
    width: calc(100% - 320px) !important;
    margin-right: 20px !important;
}

/* ===== 容器布局修复 ===== */
.container .content-wrap,
.main .content-wrap,
#main .content-wrap {
    overflow: hidden !important;
    width: 100% !important;
    position: relative !important;
}

/* ===== 响应式处理 ===== */
/* 保持原主题在小屏幕隐藏侧边栏的行为 */
@media (max-width: 925px) {
    html body .sidebar,
    body .sidebar,
    .sidebar {
        display: none !important;
    }
    
    .content-wrap .content {
        width: 100% !important;
        margin-right: 0 !important;
        float: none !important;
    }
}

/* ===== 调试辅助 ===== */
/* 添加边框帮助调试（可移除） */
.sidebar {
    /* border: 2px solid #4CAF50 !important; */ /* 绿色边框表示修复生效 */
}

/* 如果看到绿色边框，说明修复CSS已加载 */
