/* 进度按钮容器 */
#floating-toc-btn {
    position: fixed;
    right: 30px;
    bottom: 70px; /* 向上提升 15% 屏幕高度 */
    width: 66px; /* 稍微增加宽度以容纳文字 */
    height: 66px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    flex-direction: column; /* 垂直排列图标和文字 */
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: scale(0) rotate(-180deg);
}

#floating-toc-btn.active {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* 按钮内文字样式 */
.toc-btn-text {
    font-size: 11px;
    font-weight: bold;
    color: #555;
    margin-top: 1px;
    line-height: 1;
}

/* 进度圆环 */
.toc-progress-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
}

.toc-progress-circle {
    fill: none;
    stroke: #ff9800;
    stroke-width: 3.5;
    stroke-dasharray: 188.5; /* 2 * PI * R */
    stroke-dashoffset: 188.5;
    transition: stroke-dashoffset 0.1s linear;
}

.floating-toc-icon {
    font-size: 18px;
    z-index: 2;
    line-height: 1;
}

/* 悬浮面板 */
#floating-toc-panel {
    position: fixed;
    right: 40px;
    bottom: 150px; /* 面板位置同步上移 */
    width: 280px;
    max-height: 60vh;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(35px);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    z-index: 9998;
    overflow: hidden;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

#floating-toc-panel #TableOfContents {
    max-height: 55vh;
    overflow-y: auto;
    padding: 20px;
}

#floating-toc-panel #TableOfContents::-webkit-scrollbar {
    width: 4px;
}
#floating-toc-panel #TableOfContents::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

#floating-toc-panel li {
    list-style: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

#floating-toc-panel.show li {
    opacity: 1;
    transform: translateX(0);
}

#floating-toc-panel a {
    display: block;
    padding: 8px 12px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

/* 当前高亮样式 */
#floating-toc-panel a.current-active {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800 !important;
    font-weight: 600;
    padding-left: 18px;
    border-left: 4px solid #ff9800;
}

#floating-toc-btn:hover .toc-btn-text {
    color: #ff9800;
}