.toc {
  max-width: 700px;
  margin: 0 auto 30px auto;
  background: linear-gradient(
    135deg,
    rgba(240, 244, 250, 0.95) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
  border-left: 5px solid var(--color-active);
  padding: 20px 24px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);

  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.1s;
}

.toc-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-main);
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);

  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
  animation-delay: 0.3s;
}

.toc-icon {
  font-size: 26px;
  animation: bounce 2s infinite;
}

.toc-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-item {
  position: relative;
  opacity: 0;
  transform: translateX(-10px);
  animation: slideIn 0.4s ease-out forwards;
}

.toc-item:nth-child(1) {
  animation-delay: 0.4s;
}
.toc-item:nth-child(2) {
  animation-delay: 0.5s;
}
.toc-item:nth-child(3) {
  animation-delay: 0.6s;
}
.toc-item:nth-child(4) {
  animation-delay: 0.7s;
}
.toc-item:nth-child(5) {
  animation-delay: 0.8s;
}
.toc-item:nth-child(6) {
  animation-delay: 0.9s;
}
.toc-item:nth-child(7) {
  animation-delay: 1s;
}

.toc-link {
  color: var(--color-main);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.toc-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--color-active);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.toc-link:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--color-active);
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.toc-link:hover::before {
  transform: scaleY(1);
}

.toc-link:hover .toc-emoji {
  transform: scale(1.3) rotate(10deg);
}

.toc-emoji {
  font-size: 20px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.toc-text {
  line-height: 1.4;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .toc {
    margin: 0 15px 25px 15px;
    padding: 16px 18px;
  }

  .toc-title {
    font-size: 19px;
  }

  .toc-link {
    padding: 10px 12px;
    gap: 10px;
    font-size: 15px;
  }

  .toc-emoji {
    font-size: 18px;
  }
}
h2[id],
h3[id],
section[id] {
  scroll-margin-top: 100px;
}
