.content {
    position: relative;
    line-height: 1.7;
}
.toc-ultimate {
    position: sticky;
    top: 0px;
    float: right;                /* 靠右浮动 */
    margin-left: 20px;
    margin-bottom: 10px;
    margin-right: -8px;           /* 向右突出，更贴边 */
    z-index: 99;
    width: 24px;                  /* 微缩点容器宽度 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (max-width: 1024px) {
    .toc-ultimate { top: 20px; }
}

/* 微缩点容器 */
.toc-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-top: 10px;   /* 微缩点容器与文章区顶部的距离设置 */
    background: transparent;
}

/* 单个微缩点 */
.toc-dot {
    display: inline-block;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    transform: scale(1);
}
.toc-dot.active {
    font-weight: 800;
    color: #f58d8d;
    transform: scale(1.2);
}
.toc-dot:hover {
    color: #f58d8d;
    font-weight: 600;
    transform: scale(1.1);
}

/* 悬浮卡片 */
.toc-hover-card {
    position: absolute;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    padding: 8px 0;
    min-width: 180px;
    max-width: 220px;
    z-index: 1000;
    border: 1px solid rgba(0,0,0,0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.98);
    animation: cardFade 0.2s ease;
}
@keyframes cardFade {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 卡片中的条目 - 固定高度确保对齐 */
.toc-hover-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 30px;                /* 固定高度 */
    line-height: 30px;            /* 垂直居中 */
    padding: 0 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
    box-sizing: border-box;
}
.toc-hover-item:hover {
    background: #f5f5f5;
}
.toc-hover-item-active {
    background: #f8f9fa;
}
.toc-hover-item-active .toc-hover-text {
    color: #f58d8d;
    font-weight: 500;
}
.toc-hover-item-active .toc-hover-dash {
    color: #f58d8d;
    font-weight: 800;
}

.toc-hover-text {
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}
.toc-hover-dash {
    font-size: 18px;
    color: #aaa;
    font-weight: 300;
    line-height: 1;
    width: 12px;                  /* 固定宽度，便于对齐 */
    text-align: center;
}

/* 清除浮动 */
.content::after {
    content: "";
    display: table;
    clear: both;
}

/* 移动端隐藏 */
@media (max-width:991px) {
    .toc-ultimate { display: none !important; }
}

/* 标题锚点偏移 */
h2[id], h3[id], h4[id] {
    scroll-margin-top: 0px;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .toc-dot {
        color: #666;
    }
    .toc-dot.active {
        color: #4d9eff;
    }
    .toc-dot:hover {
        color: #4d9eff;
    }
    .toc-hover-card {
        background: rgba(30,30,30,0.98);
        border-color: #444;
    }
    .toc-hover-item:hover {
        background: #333;
    }
    .toc-hover-item-active {
        border-left-color: #4d9eff;
        background: #1e2a3a;
    }
    .toc-hover-item-active .toc-hover-text {
        color: #4d9eff;
    }
    .toc-hover-item-active .toc-hover-dash {
        color: #4d9eff;
    }
    .toc-hover-text {
        color: #ddd;
    }
    .toc-hover-dash {
        color: #777;
    }
}