/*
WordPress兼容性CSS - 强力版本
用于解决在WordPress环境中侧边栏显示问题
*/

/* 最强力的布局重置 - 覆盖所有可能的WordPress容器 */
#contentout,
.wp-block-html #contentout,
.wp-block-shortcode #contentout,
.elementor-widget-html #contentout,
.widget_text #contentout,
.textwidget #contentout,
.entry-content #contentout,
.post-content #contentout,
.article-content #contentout,
.single-post #contentout,
.single #contentout,
article #contentout,
.post #contentout,
div[class*="content"] #contentout,
div[id*="content"] #contentout {
    width: 1100px !important;
    padding-top: 5px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: left !important;
    overflow: auto !important;
    display: block !important;
    position: relative !important;
    clear: both !important;
    max-width: none !important;
    min-width: 1100px !important;
    box-sizing: content-box !important;
}

/* 强力重置内容区域样式 */
#content,
.wp-block-html #content,
.wp-block-shortcode #content,
.elementor-widget-html #content,
.widget_text #content,
.textwidget #content,
.entry-content #content,
.post-content #content,
.article-content #content,
.single-post #content,
.single #content,
article #content,
.post #content,
div[class*="content"] #content,
div[id*="content"] #content {
    padding: 0px 0px 15px 0px !important;
    width: 728px !important;
    float: left !important;
    display: block !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    max-width: 728px !important;
    min-width: 728px !important;
    position: relative !important;
    clear: none !important;
}

/* 强力重置侧边栏样式 */
#right,
.wp-block-html #right,
.wp-block-shortcode #right,
.elementor-widget-html #right,
.widget_text #right,
.textwidget #right,
.entry-content #right,
.post-content #right,
.article-content #right,
.single-post #right,
.single #right,
article #right,
.post #right,
div[class*="content"] #right,
div[id*="content"] #right {
    width: 336px !important;
    float: right !important;
    text-align: center !important;
    padding: 0px !important;
    box-sizing: border-box !important;
    display: block !important;
    position: relative !important;
    margin: 0 !important;
    clear: none !important;
    max-width: 336px !important;
    min-width: 336px !important;
    height: auto !important;
    overflow: visible !important;
}

/* 确保清除浮动 */
.single-post #contentout::after,
.single #contentout::after,
article #contentout::after,
.post #contentout::after {
    content: "";
    display: table;
    clear: both;
}

/* WordPress主题可能添加的容器样式重置 */
.entry-content,
.post-content,
.article-content {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 侧边栏内容样式强化 - 超级强力版本 */
#right #othercalc,
.wp-block-html #right #othercalc,
.wp-block-shortcode #right #othercalc,
.elementor-widget-html #right #othercalc,
.widget_text #right #othercalc,
.textwidget #right #othercalc,
.entry-content #right #othercalc,
.post-content #right #othercalc,
.article-content #right #othercalc {
    border: solid 1px #336699 !important;
    margin: auto !important;
    text-align: left !important;
    width: 332px !important;
    background: white !important;
    display: block !important;
    position: relative !important;
    clear: none !important;
    float: none !important;
    box-sizing: border-box !important;
    max-width: 332px !important;
    min-width: 332px !important;
}

/* 侧边栏标题样式 */
#right #octitle,
.wp-block-html #right #octitle,
.wp-block-shortcode #right #octitle,
.elementor-widget-html #right #octitle,
.widget_text #right #octitle,
.textwidget #right #octitle,
.entry-content #right #octitle,
.post-content #right #octitle,
.article-content #right #octitle {
    background-color: #336699 !important;
    padding: 6px !important;
    color: #fff !important;
    font-size: 18px !important;
    font-weight: bold !important;
    margin: 0 !important;
    border: none !important;
    display: block !important;
}

/* 侧边栏内容区域 */
#right #occontent,
.wp-block-html #right #occontent,
.wp-block-shortcode #right #occontent,
.elementor-widget-html #right #occontent,
.widget_text #right #occontent,
.textwidget #right #occontent,
.entry-content #right #occontent,
.post-content #right #occontent,
.article-content #right #occontent {
    padding: 3px 6px !important;
    font-size: 14px !important;
    background: white !important;
    margin: 0 !important;
    display: block !important;
}

/* 侧边栏链接样式 */
#right #occontent a,
.wp-block-html #right #occontent a,
.wp-block-shortcode #right #occontent a,
.elementor-widget-html #right #occontent a,
.widget_text #right #occontent a,
.textwidget #right #occontent a,
.entry-content #right #occontent a,
.post-content #right #occontent a,
.article-content #right #occontent a {
    display: inline-block !important;
    width: 158px !important;
    padding: 3px 0px !important;
    color: #069 !important;
    text-decoration: underline !important;
    font-size: 14px !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* 侧边栏底部区域 */
#right #ocother,
.wp-block-html #right #ocother,
.wp-block-shortcode #right #ocother,
.elementor-widget-html #right #ocother,
.widget_text #right #ocother,
.textwidget #right #ocother,
.entry-content #right #ocother,
.post-content #right #ocother,
.article-content #right #ocother {
    background-color: #ddd !important;
    padding: 6px !important;
    text-align: center !important;
    font-size: 15px !important;
    color: #bbb !important;
    margin: 0 !important;
    display: block !important;
}

/* 搜索框样式强化 */
#right #searchbox,
.wp-block-html #right #searchbox,
.wp-block-shortcode #right #searchbox,
.elementor-widget-html #right #searchbox,
.widget_text #right #searchbox,
.textwidget #right #searchbox,
.entry-content #right #searchbox,
.post-content #right #searchbox,
.article-content #right #searchbox {
    padding-top: 16px !important;
    width: 100% !important;
    background: transparent !important;
    margin: 0 !important;
    display: block !important;
    clear: none !important;
    position: relative !important;
}

#right #searchbox table,
.wp-block-html #right #searchbox table,
.wp-block-shortcode #right #searchbox table,
.elementor-widget-html #right #searchbox table,
.widget_text #right #searchbox table,
.textwidget #right #searchbox table,
.entry-content #right #searchbox table,
.post-content #right #searchbox table,
.article-content #right #searchbox table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    display: table !important;
}

#right #searchbox td,
.wp-block-html #right #searchbox td,
.wp-block-shortcode #right #searchbox td,
.elementor-widget-html #right #searchbox td,
.widget_text #right #searchbox td,
.textwidget #right #searchbox td,
.entry-content #right #searchbox td,
.post-content #right #searchbox td,
.article-content #right #searchbox td {
    padding: 2px !important;
    border: none !important;
    background: transparent !important;
    vertical-align: top !important;
}

#right #searchbox input[type="text"],
#right #searchbox .inlongest,
.wp-block-html #right #searchbox input[type="text"],
.wp-block-html #right #searchbox .inlongest,
.wp-block-shortcode #right #searchbox input[type="text"],
.wp-block-shortcode #right #searchbox .inlongest,
.elementor-widget-html #right #searchbox input[type="text"],
.elementor-widget-html #right #searchbox .inlongest,
.widget_text #right #searchbox input[type="text"],
.widget_text #right #searchbox .inlongest,
.textwidget #right #searchbox input[type="text"],
.textwidget #right #searchbox .inlongest,
.entry-content #right #searchbox input[type="text"],
.entry-content #right #searchbox .inlongest,
.post-content #right #searchbox input[type="text"],
.post-content #right #searchbox .inlongest,
.article-content #right #searchbox input[type="text"],
.article-content #right #searchbox .inlongest {
    width: 100% !important;
    padding: 6px 8px !important;
    border: 1px solid #044284 !important;
    border-radius: 2px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    box-shadow: 1px 1px 2px #666 !important;
    background-color: #fff !important;
    margin: 0 !important;
    display: block !important;
    height: auto !important;
    line-height: normal !important;
    font-family: arial, helvetica, sans-serif !important;
}

/* 搜索按钮样式强化 */
#right #bluebtn,
.wp-block-html #right #bluebtn,
.wp-block-shortcode #right #bluebtn,
.elementor-widget-html #right #bluebtn,
.widget_text #right #bluebtn,
.textwidget #right #bluebtn,
.entry-content #right #bluebtn,
.post-content #right #bluebtn,
.article-content #right #bluebtn {
    border-radius: 2px !important;
    background: #336699 !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    color: #fff !important;
    cursor: pointer !important;
    border: none !important;
    white-space: nowrap !important;
    display: inline-block !important;
    text-decoration: none !important;
    margin: 0 !important;
    height: auto !important;
    line-height: normal !important;
    font-family: arial, helvetica, sans-serif !important;
    font-weight: normal !important;
}

#right #bluebtn:hover,
.wp-block-html #right #bluebtn:hover,
.wp-block-shortcode #right #bluebtn:hover,
.elementor-widget-html #right #bluebtn:hover,
.widget_text #right #bluebtn:hover,
.textwidget #right #bluebtn:hover,
.entry-content #right #bluebtn:hover,
.post-content #right #bluebtn:hover,
.article-content #right #bluebtn:hover {
    background: #444 !important;
    color: #fff !important;
}

/* 搜索结果区域 */
#right #calcSearchOut,
.wp-block-html #right #calcSearchOut,
.wp-block-shortcode #right #calcSearchOut,
.elementor-widget-html #right #calcSearchOut,
.widget_text #right #calcSearchOut,
.textwidget #right #calcSearchOut,
.entry-content #right #calcSearchOut,
.post-content #right #calcSearchOut,
.article-content #right #calcSearchOut {
    padding: 5px !important;
    background: white !important;
    margin: 0 !important;
    display: block !important;
    border: none !important;
}

#right #calcSearchOut div,
.wp-block-html #right #calcSearchOut div,
.wp-block-shortcode #right #calcSearchOut div,
.elementor-widget-html #right #calcSearchOut div,
.widget_text #right #calcSearchOut div,
.textwidget #right #calcSearchOut div,
.entry-content #right #calcSearchOut div,
.post-content #right #calcSearchOut div,
.article-content #right #calcSearchOut div {
    padding: 5px !important;
    text-align: left !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    display: block !important;
}

/* 广告位样式强化 */
#right > div:first-child,
.wp-block-html #right > div:first-child,
.wp-block-shortcode #right > div:first-child,
.elementor-widget-html #right > div:first-child,
.widget_text #right > div:first-child,
.textwidget #right > div:first-child,
.entry-content #right > div:first-child,
.post-content #right > div:first-child,
.article-content #right > div:first-child {
    padding-top: 10px !important;
    min-height: 280px !important;
    text-align: center !important;
    margin: 0 !important;
    display: block !important;
    width: 336px !important;
    box-sizing: border-box !important;
}

#right > div:first-child > div,
.wp-block-html #right > div:first-child > div,
.wp-block-shortcode #right > div:first-child > div,
.elementor-widget-html #right > div:first-child > div,
.widget_text #right > div:first-child > div,
.textwidget #right > div:first-child > div,
.entry-content #right > div:first-child > div,
.post-content #right > div:first-child > div,
.article-content #right > div:first-child > div {
    width: 336px !important;
    height: 280px !important;
    background: #f0f0f0 !important;
    border: 1px solid #ccc !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* 响应式设计强化 */
@media (max-width: 1140px) {
    .single-post #contentout,
    .single #contentout,
    article #contentout,
    .post #contentout {
        width: 1000px !important;
    }
    
    .single-post #content,
    .single #content,
    article #content,
    .post #content {
        width: 640px !important;
        padding-left: 10px !important;
    }
    
    .single-post #right,
    .single #right,
    article #right,
    .post #right {
        width: 320px !important;
    }
    
    #right #othercalc {
        width: 316px !important;
    }
}

@media (max-width: 720px) {
    .single-post #contentout,
    .single #contentout,
    article #contentout,
    .post #contentout {
        width: auto !important;
        padding: 8px !important;
    }
    
    .single-post #content,
    .single #content,
    article #content,
    .post #content {
        float: none !important;
        width: auto !important;
        padding: 0px !important;
    }
    
    .single-post #right,
    .single #right,
    article #right,
    .post #right {
        width: auto !important;
        float: none !important;
        margin-top: 20px !important;
        padding: 0px !important;
    }
    
    #right #othercalc {
        width: 100% !important;
        margin: 10px 0 !important;
    }
    
    #right #searchbox {
        width: 100% !important;
        padding-top: 10px !important;
    }
    
    #right #searchbox input[type="text"],
    #right #searchbox .inlongest {
        width: 100% !important;
        padding: 8px !important;
        font-size: 16px !important;
    }
    
    #right #bluebtn {
        padding: 8px 12px !important;
        font-size: 16px !important;
    }
}

@media (max-width: 650px) {
    #right #othercalc #occontent a {
        width: 100% !important;
        display: block !important;
        padding: 8px 6px !important;
        border-bottom: 1px solid #eee !important;
    }
    
    #right #othercalc #occontent a:last-child {
        border-bottom: none !important;
    }
}

@media (max-width: 490px) {
    .single-post #right,
    .single #right,
    article #right,
    .post #right {
        padding: 0px 5px !important;
    }
    
    #right #othercalc {
        margin: 15px 0 !important;
    }
    
    #right #searchbox {
        padding-top: 15px !important;
    }
    
    #right #searchbox input[type="text"],
    #right #searchbox .inlongest {
        padding: 10px !important;
        font-size: 16px !important;
        border-radius: 3px !important;
    }
    
    #right #bluebtn {
        padding: 10px 15px !important;
        margin-top: 5px !important;
        border-radius: 3px !important;
    }
    
    /* 广告区域在小屏幕的优化 */
    #right > div:first-child {
        padding-top: 5px !important;
        min-height: 200px !important;
    }
    
    #right > div:first-child > div {
        width: 100% !important;
        height: 200px !important;
        max-width: 336px !important;
        margin: 0 auto !important;
    }
}

/* 防止WordPress主题干扰的通用样式 */
#contentout * {
    box-sizing: border-box;
}

/* 确保在任何WordPress容器中都能正确显示 */
.wp-block-html #contentout,
.wp-block-shortcode #contentout,
.elementor-widget-html #contentout {
    width: 1100px !important;
    margin: 0 auto !important;
    overflow: auto !important;
}

/* 修复可能的z-index问题 */
#right {
    z-index: 1 !important;
}

#content {
    z-index: 1 !important;
}
