.sticky-toc {
position: fixed;
top: 120px;
right: 30px;
width: 280px;
max-height: calc(100vh - 160px);
background: #ffffff;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
z-index: 999;
transition: all 0.3s ease;
overflow: hidden;
} .sticky-toc.collapsed .sticky-toc-list {
display: none;
} .sticky-toc-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 12px 12px 0 0;
cursor: pointer;
user-select: none;
}
.sticky-toc-title {
margin: 0;
font-size: 15px;
font-weight: 600;
color: #ffffff;
letter-spacing: 0.3px;
}
.sticky-toc-toggle {
background: rgba(255, 255, 255, 0.2);
border: none;
width: 28px;
height: 28px;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
}
.sticky-toc-toggle:hover {
background: rgba(255, 255, 255, 0.3);
transform: scale(1.05);
}
.toggle-icon {
color: #ffffff;
font-size: 20px;
font-weight: 300;
line-height: 1;
} .sticky-toc-list {
list-style: none;
margin: 0;
padding: 12px 0;
max-height: calc(100vh - 220px);
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: #e0e0e0 #f5f5f5;
} .sticky-toc-list::-webkit-scrollbar {
width: 6px;
}
.sticky-toc-list::-webkit-scrollbar-track {
background: #f5f5f5;
border-radius: 0 0 12px 0;
}
.sticky-toc-list::-webkit-scrollbar-thumb {
background: #e0e0e0;
border-radius: 3px;
}
.sticky-toc-list::-webkit-scrollbar-thumb:hover {
background: #d0d0d0;
} .sticky-toc-item {
margin: 0;
padding: 0;
}
.sticky-toc-link {
display: flex;
align-items: flex-start;
gap: 10px;
padding: 10px 20px;
text-decoration: none;
color: #4a5568;
font-size: 14px;
line-height: 1.5;
transition: all 0.2s ease;
border-left: 3px solid transparent;
position: relative;
}
.sticky-toc-link:hover {
background: #f7fafc;
color: #667eea;
border-left-color: #667eea;
} .sticky-toc-link.active {
background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
color: #667eea;
font-weight: 600;
border-left-color: #667eea;
}
.sticky-toc-link.active .toc-number {
color: #667eea;
} .toc-number {
flex-shrink: 0;
color: #a0aec0;
font-weight: 600;
font-size: 13px;
min-width: 22px;
}
.toc-text {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
} @keyframes slideInRight {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
.sticky-toc {
animation: slideInRight 0.4s ease-out;
}  @media (max-width: 1024px) {
.sticky-toc {
width: 240px;
right: 20px;
top: 100px;
}
.sticky-toc-link {
font-size: 13px;
padding: 8px 16px;
}
} @media (max-width: 768px) {
.sticky-toc {
display: none;
}
} @media (max-width: 480px) {
.sticky-toc {
display: none !important;
}
} @media print {
.sticky-toc {
display: none !important;
}
}  .sticky-toc-link:focus {
outline: 2px solid #667eea;
outline-offset: -2px;
}
.sticky-toc-toggle:focus {
outline: 2px solid #ffffff;
outline-offset: 2px;
} @media (prefers-reduced-motion: reduce) {
.sticky-toc,
.sticky-toc-link,
.sticky-toc-toggle {
animation: none;
transition: none;
}
}  .sticky-toc.theme-bleupiment .sticky-toc-header {
background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
}
.sticky-toc.theme-bleupiment .sticky-toc-link:hover,
.sticky-toc.theme-bleupiment .sticky-toc-link.active {
color: #4F46E5;
border-left-color: #4F46E5;
} .sticky-toc.theme-dark {
background: #1a202c;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.sticky-toc.theme-dark .sticky-toc-link {
color: #e2e8f0;
}
.sticky-toc.theme-dark .sticky-toc-link:hover {
background: #2d3748;
color: #667eea;
}  .no-js .sticky-toc {
display: none;
}