/* layout-content-doc.css */
:root {
    --top-nav-height: 61px;
    --side-bar-width: 300px;
    --side-bar-padding-top: 61px;
    --side-bar-margin-top: 20px;
    --float-bar-bottom: 60px;
    --content-width: 1300px;
    --content-padding-right: 30px;
    --content-padding-left: 30px;
    --content-top-btn-right: 5px;
    --content-top-btn-top: 150px;
    --sidebar-transition: 50ms linear;
}

/* 移除隐藏侧边栏的样式 */
.wy-nav-side {
    background-color: #474444 !important;
    left: 0;
    position: fixed;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    bottom: 0;
    width: var(--side-bar-width);;
    flex: 0 0 var(--side-bar-width);; /* 固定宽度 */
    z-index: 2000; /* 确保侧边栏在内容之上 */
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.wy-nav-content {
    min-height: 100vh;
    margin-left: 0 !important; /* 从最左侧开始 */
    padding-bottom: 10px !important;
    padding-left: var(--content-padding-left) !important;
    padding-right: var(--content-padding-right) !important;
    background-color: white !important;
    transition: padding-left var(--sidebar-transition);
    padding-top: var(--top-nav-height) !important;

    max-width: auto;
    width: auto;
}

/* 1. 给内容区域设置为相对定位，作为“把手”的定位参考 */
.wy-nav-content {
    position: relative;
    will-change: width;
    /* 初始宽度由主题控制，拖动时JS会覆盖它 */
    /* 保留您之前的css，但 position 是必须的 */
}

/* 2. 定义拖动“把手”的样式 */
.resize-handle-right {
    position: fixed; /* 改为固定定位，使其不随页面滚动 */
    top: 0;
    /* 'left' 属性由 JS 动态设置 */
    width: 6px;  /* “把手”的宽度，决定了可拖动区域的大小 */
    height: 100vh; /* 高度占满整个视口 */
    cursor: col-resize; /* 鼠标悬停时显示列拖动光标 */
    z-index: 1000; /* 确保“把手”在顶层 */
    
    /* background: rgba(0, 0, 255, 0.1); */ /* 取消注释此行以调试“把手”的位置 */
}

/* 两条竖条的通用样式 */
.resize-handle-right::before,
.resize-handle-right::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%); /* 垂直居中 */
    width: 2px; /* 每条竖条的宽度 */
    height: 48px; /*【修改】竖条更长 */
    background-color: #bbbbbb; /*【修改】默认颜色更清晰 */
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

/* 定位第一条竖条 (左侧) */
.resize-handle-right::before {
    left: 0px;
}

/* 定位第二条竖条 (右侧) */
.resize-handle-right::after {
    right: 0px;
}

/* 鼠标悬停时，两条竖条同时变色 */
.resize-handle-right:hover::before,
.resize-handle-right:hover::after {
    background-color: #666666; /*【修改】悬停颜色更深 */
}

/* 为内容包装器添加上边距 */
.custom-content-wrapper {
    margin-top: 5px;
    position: relative;
}

/* 调整面包屑的位置 */
.wy-breadcrumbs-aside {
    border-bottom: none !important;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1000;
}

/* 为面包屑添加样式 */
.wy-breadcrumbs {
    border-bottom: none !important;
    padding: 15px 0 0 0; /* 調整上下內邊距 */
    margin-bottom: 0; /* 移除底部外邊距 */
}

.rst-content [role="navigation"] hr {
    display: none !important; /* 面包屑下面内容之上的横线去掉 */
}

.wy-grid-for-nav {
    position: relative;
    width: 100%;
    left: 0;
    display: block;
    flex-direction: row;
}

@media screen and (max-width: 768px) {
    :root {
        --content-padding-right: 10px;
        --content-padding-left: 10px;
    }

    .wy-nav-content {
        padding-top: calc(var(--top-nav-height) * 2) !important;
    }

    .resize-handle-right {
        display: none;
    }

    .rst-content {
        max-width: 100%;
        overflow-x: hidden;
        padding-left: 10px;
        padding-right: 10px;
    }

    .rst-content figure.align-center {
        overflow-x: auto; /* 當內部圖片寬度超過容器時，顯示水平捲軸 */
        -webkit-overflow-scrolling: touch; /* 在 iOS 上提供更流暢的滾動體驗 */
    }
}
