.post-toc {
    position: sticky;
    top: 135px;
    width: 260px;
    background: #ffffff;
    padding: 16px;
    border-radius: 4px;
    max-height: calc(80vh - 140px);
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: toc-fade-in 0.5s ease-out;
}

@keyframes toc-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.post-toc::-webkit-scrollbar {
    width: 4px;
}

.post-toc::-webkit-scrollbar-thumb {
    background-color: #e4e4e7;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.post-toc:hover::-webkit-scrollbar-thumb {
    background-color: #d4d4d8;
}

.post-toc .toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list-item {
    padding: 6px 30px 6px 0;
    position: relative;
    transition: padding 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.toc-indicator {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: rgba(17, 49, 75, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: right center;
}

.is-active-li .toc-indicator {
    background-color: #11314B;
    animation: pulse-indicator 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) 1;
}

@keyframes pulse-indicator {
    0% { transform: scaleX(1); }
    50% { transform: scaleX(1.5); }
    100% { transform: scaleX(1); }
}

.toc-link {
    display: block;
    text-decoration: none;
    color: #446685;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    padding-left: 0;
}

.toc-link.node-name--H2 {
    color: #11314B;
    font-weight: 600;
    font-size: 15px;
}

.toc-link.node-name--H3 {
    color: #2a4b6a;
    font-size: 14px;
}

.toc-list .toc-list {
    padding-left: 16px;
    margin: 0;
    animation: slide-in 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}

.toc-list .toc-list .toc-list-item {
    padding-top: 4px;
    padding-bottom: 4px;
}

.is-active-link {
    color: #11314B;
    font-weight: 500;
    transform: translateX(3px);
}

.toc-link:hover {
    color: #11314B;
    transform: translateX(2px);
}

.toc-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #11314B;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.toc-link:hover::after {
    width: 100%;
}

@keyframes highlight-pulse {
    0% { background-color: rgba(17, 49, 75, 0.05); }
    50% { background-color: rgba(17, 49, 75, 0.15); }
    100% { background-color: rgba(17, 49, 75, 0); }
}

.toc-target-highlight {
    animation: highlight-pulse 1.5s ease-out;
    border-radius: 4px;
    padding: 2px 5px;
    margin: -2px -5px;
}

@media (max-width: 768px) {
    #toc-sidebar, 
    .toc-container {
        display: none;
    }
}