/* 悬浮导航目录的 CSS 样式 */
.toc-container {
    position: fixed;
    right: 10px;
    top: 150px;
    width: 40px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: width 0.3s ease-in-out;
    overflow: hidden;
    padding: 0;
}
/* 鼠标悬停时展开目录 */
.toc-container:hover {
    width: auto;
}

/* 通过JS添加的类，阻止悬停效果 */
.toc-container.is-hovering-on-button {
    width: 40px !important;
}

.toc-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc-container li {
    position: relative;
    cursor: pointer;
    padding-left: 1px;
    height: 40px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}
/* 鼠标悬停在 li 上时改变背景色 */
.toc-container li:hover {
    background-color: #e9ecef;
}
/* 高亮当前滚动到的 li 元素 */
.toc-container li.active {
    background-color: #007BFF;
}
/* 高亮状态下的文字颜色 */
.toc-container li.active .toc-link {
    color: #fff;
}

.toc-container .toc-link {
    text-decoration: none;
    color: #555;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 10px;
    white-space: nowrap;
    transition: color 0.2s;
}

/* 隐藏文字，只在悬停时显示 */
.toc-container .toc-text {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s linear;
}
/* 悬停时显示文字 */
.toc-container:hover .toc-text {
    visibility: visible;
    opacity: 1;
    margin-left: 8px;
}
/* 确保在鼠标悬停在按钮上时文字也保持隐藏状态 */
.toc-container.is-hovering-on-button .toc-text {
    visibility: hidden;
    opacity: 0;
}

/* 目录中的图标样式 */
.toc-container .toc-icon {
    display: inline-block;
    text-align: left;
    font-size: 1.1em;
}

/* 向上/向下箭头按钮样式 */
.page-nav-btn {
    position: relative; /* 为提示框定位提供上下文 */
    width: 100%;
    background-color: #ffffff;
    border: none;
    border-radius: 5px;
    margin: 5px 0;
    cursor: pointer;
    font-size: 1.5em;
    color: #555;
    text-align: center;
}

.page-nav-btn:hover {
    background-color: #e0e0e0;
}

.page-nav-btn.hidden {
    display: none;
}

/* 提示框样式 */
.tooltip {
    width: 16px;
    position: fixed;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    /* 增加左右内边距，让文字不挤压 */
    padding: 8px 10px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1002;
}

/* 悬停时显示提示框，通过JS添加的类来控制 */
.tooltip.is-active {
    opacity: 1;
    visibility: visible;
}
