/*
Theme Name: 创享子主题Clean版
Theme URI: QQ216398216
Template: zibll
Author: 创享子主题-QQ216398216
Author URI: QQ216398216
Description: 创享子主题精简版，仅包含小工具功能，无美化代码
Version: 1.1.0
Tags: 子比主题、开源版、免费试用、可二开、创享子主题、QQ216398216、子主题、WP子主题、功能化子主题
*/

/* ========== 创享子主题Clean版 - 样式继承声明 ========== */
/*
 * 本子主题通过functions.php中的cxzzt_clean_enqueue_parent_styles()函数
 * 正确加载父主题zibll的所有样式文件，确保完整的样式继承
 *
 * 父主题样式加载顺序：
 * 1. _bootstrap (bootstrap.min.css)
 * 2. _fontawesome (font-awesome.min.css)
 * 3. _main (main.min.css) - 父主题核心样式
 * 4. 本子主题样式 (style.css) - 在父主题样式之后加载
 */

/* ========== 子主题自定义样式区域 ========== */
/* 此主题为精简版，主要功能通过小工具实现，不包含全局美化CSS */

/* ========== 双侧边栏布局样式 ========== */
/* 文章页双侧小工具容器布局系统 */

/* CSS变量定义（默认值，会被内联样式覆盖） */
.site-layout-dual {
    --left-sidebar-width: 250px;
    --right-sidebar-width: 280px;
    --sidebar-gap: 15px;
}

.site-layout-dual .content-wrap {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.site-layout-dual .content-layout {
    margin: 0 !important;
    padding: 0 !important;
}

/* 双侧边栏布局容器 */
.dual-sidebar-layout {
    display: flex !important;
    gap: 15px; /* 默认间距，会被内联样式覆盖 */
    width: 100%;
    align-items: flex-start;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 左侧边栏样式 */
.dual-sidebar-layout .left-sidebar {
    flex-shrink: 0;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

/* 主内容区域 */
.dual-sidebar-layout .main-content {
    flex: 1;
    min-width: 0; /* 防止内容溢出 */
    box-sizing: border-box;
    overflow: hidden;
}

/* 右侧边栏样式 */
.dual-sidebar-layout .right-sidebar {
    flex-shrink: 0;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

/* 确保侧边栏内容不会超出容器 */
.dual-sidebar-layout .left-sidebar *,
.dual-sidebar-layout .right-sidebar * {
    max-width: 100%;
    box-sizing: border-box;
}

/* 侧边栏内部小工具样式 */
.dual-sidebar-layout .left-sidebar .zib-widget,
.dual-sidebar-layout .right-sidebar .zib-widget {
    margin-bottom: 20px;
    background: var(--main-bg-color);
    border-radius: var(--main-radius);
    box-shadow: var(--main-shadow);
    padding: 20px;
}

/* 侧边栏小工具标题 */
.dual-sidebar-layout .left-sidebar .zib-widget h3,
.dual-sidebar-layout .right-sidebar .zib-widget h3 {
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid var(--main-border-color);
    font-size: 16px;
    font-weight: bold;
    color: var(--key-color);
}

/* 移动端响应式隐藏双侧边栏 */
@media (max-width: 768px) {
    .dual-sidebar-layout {
        display: block;
    }

    .dual-sidebar-layout .left-sidebar,
    .dual-sidebar-layout .right-sidebar {
        display: none;
    }

    .dual-sidebar-layout .main-content {
        width: 100%;
    }
}

/* 平板端适配 */
@media (max-width: 1024px) and (min-width: 769px) {
    .dual-sidebar-layout {
        gap: 10px !important; /* 平板端减小间距 */
    }

    .dual-sidebar-layout .left-sidebar {
        width: 200px !important; /* 平板端左侧边栏固定宽度 */
    }

    .dual-sidebar-layout .right-sidebar {
        width: 220px !important; /* 平板端右侧边栏固定宽度 */
    }
}



/* 确保双侧布局不受父主题site-layout类影响 */
.site-layout-dual.site-layout-1 .dual-sidebar-layout,
.site-layout-dual.site-layout-2 .dual-sidebar-layout,
.site-layout-dual.site-layout-3 .dual-sidebar-layout {
    display: flex !important;
}

/* ========== 双侧边栏随动效果样式 ========== */
/* 双侧边栏随动容器样式 */
.dual-sidebar-layout .left-sidebar .sidebar-affix,
.dual-sidebar-layout .right-sidebar .sidebar-affix {
    position: fixed;
    z-index: 100;
    transition: opacity 0.3s ease;
}

/* 双侧边栏随动状态控制 */
.dual-sidebar-layout .left-sidebar .sidebar-affix.affix-top,
.dual-sidebar-layout .right-sidebar .sidebar-affix.affix-top {
    opacity: 0;
    z-index: -999;
}

.dual-sidebar-layout .left-sidebar .sidebar-affix.affix,
.dual-sidebar-layout .right-sidebar .sidebar-affix.affix {
    opacity: 1;
    z-index: 100;
}

.dual-sidebar-layout .left-sidebar .sidebar-affix.affix-bottom,
.dual-sidebar-layout .right-sidebar .sidebar-affix.affix-bottom {
    position: absolute;
    opacity: 1;
}

/* 双侧边栏随动时隐藏原始内容 */
.dual-sidebar-layout .left-sidebar .sidebar-affix.affix ~ .zib-widget,
.dual-sidebar-layout .left-sidebar .sidebar-affix.affix-bottom ~ .zib-widget,
.dual-sidebar-layout .right-sidebar .sidebar-affix.affix ~ .zib-widget,
.dual-sidebar-layout .right-sidebar .sidebar-affix.affix-bottom ~ .zib-widget {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 移动端禁用随动效果 */
@media (max-width: 900px) {
    .dual-sidebar-layout .left-sidebar .sidebar-affix,
    .dual-sidebar-layout .right-sidebar .sidebar-affix {
        position: static !important;
        opacity: 1 !important;
        z-index: auto !important;
    }

    .dual-sidebar-layout .left-sidebar .sidebar-affix ~ .zib-widget,
    .dual-sidebar-layout .right-sidebar .sidebar-affix ~ .zib-widget {
        opacity: 1 !important;
    }
}

/* 如需添加其他自定义样式，请在此处添加，确保不会影响父主题的核心功能 */

/* ========== 强制隐藏父主题导航栏 ========== */
/* 完全隐藏父主题的导航栏，避免与子主题导航栏冲突 */
.header,
.mobile-header,
.navbar,
.navbar-top,
.mobile-navbar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
  z-index: -1 !important;
}

/* 【2025-01-30】移除重复的body.nav-fixed设置，复用父主题的间距计算 */
/* 父主题已有相同设置，避免双重padding-top导致额外间距 */
/*
body.nav-fixed {
  padding-top: 88px;
}

@media (max-width: 996px) {
  body.nav-fixed {
    padding-top: 72px;
  }
}
*/

/* ========== 文章页标题栏与内容区域重叠修复 ========== */
/* 注意：间距现在由functions.php中的.container统一规则处理 */

/* ========== 双侧边栏随动位置修复 ========== */
/* 【2025-01-30】优化侧边栏随动位置计算，基于实际导航栏高度动态计算 */
.dual-sidebar-layout .left-sidebar .sidebar-affix.affix {
  left: auto;
  top: calc(88px + 20px); /* 88px导航栏 + 20px间距，与父主题body.nav-fixed保持一致 */
  width: inherit; /* 继承父容器宽度 */
  max-width: var(--left-sidebar-width, 250px); /* 使用变量限制最大宽度 */
}

.dual-sidebar-layout .right-sidebar .sidebar-affix.affix {
  right: auto;
  top: calc(88px + 20px); /* 88px导航栏 + 20px间距，与父主题body.nav-fixed保持一致 */
  width: inherit; /* 继承父容器宽度 */
  max-width: var(--right-sidebar-width, 280px); /* 使用变量限制最大宽度 */
}

/* 移动端侧边栏位置调整 */
@media (max-width: 996px) {
  .dual-sidebar-layout .left-sidebar .sidebar-affix.affix,
  .dual-sidebar-layout .right-sidebar .sidebar-affix.affix {
    top: calc(72px + 20px); /* 72px导航栏 + 20px间距，与父主题移动端保持一致 */
  }
}

/* 确保随动容器不超出视口 */
.dual-sidebar-layout .sidebar-affix {
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

/* 美化滚动条 */
.dual-sidebar-layout .sidebar-affix::-webkit-scrollbar {
  width: 4px;
}

.dual-sidebar-layout .sidebar-affix::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

/* 响应式调整 - 已移除，现在使用body padding-top统一处理 */