@charset "UTF-8";
.toc-article {
  position: fixed;
  top: 100px;
  right: 20px;
  width: 280px;
  max-height: calc(100vh - 200px);
  background: #fff;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px;
  overflow-y: auto;
  z-index: 1000;
  transition: all 0.3s ease;
}
.toc-article::-webkit-scrollbar {
  width: 6px;
}
.toc-article::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.toc-article::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}
.toc-article::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
.toc-article .toc-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e1e8ed;
  cursor: pointer;
  position: relative;
  user-select: none;
}
.toc-article .toc-title::after {
  content: "−";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 18px;
  font-weight: bold;
  color: #666;
  transition: transform 0.3s ease;
}
.toc-article .toc-title:hover {
  color: #333;
}
.toc-article .toc-title:hover::after {
  color: #333;
}
.toc-article.toc-collapsed {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: #f8f9fa;
  border: 1px solid #e1e8ed;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  cursor: pointer;
  top: 120px;
  right: 20px;
}
.toc-article.toc-collapsed .toc-title {
  display: none;
}
.toc-article.toc-collapsed .toc {
  display: none;
}
.toc-article.toc-collapsed::before {
  content: "≡";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 300;
  color: #666;
  line-height: 1;
}
.toc-article.toc-collapsed:hover {
  background: #f0f0f0;
  border-color: #d0d0d0;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}
.toc-article.toc-collapsed:hover::before {
  color: #333;
}
.toc-article .toc {
  margin: 0;
  padding: 0;
  list-style: none;
}
.toc-article .toc .toc-item {
  margin: 0;
  padding: 0;
}
.toc-article .toc .toc-item .toc-link {
  display: block;
  padding: 6px 0;
  color: #666;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  transition: all 0.2s ease;
  border-radius: 4px;
  padding-left: 8px;
  margin-left: -8px;
}
.toc-article .toc .toc-item .toc-link:hover {
  color: #333;
  background: #f8f9fa;
}
.toc-article .toc .toc-item .toc-link.active {
  color: #333;
  background: #f0f0f0;
  font-weight: 500;
}
.toc-article .toc .toc-item .toc-link .toc-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc-article .toc .toc-item.toc-level-2 {
  margin-left: 0;
}
.toc-article .toc .toc-item.toc-level-3 {
  margin-left: 16px;
}
.toc-article .toc .toc-item.toc-level-3 .toc-link {
  font-size: 13px;
  color: #888;
}
.toc-article .toc .toc-item.toc-level-4 {
  margin-left: 32px;
}
.toc-article .toc .toc-item.toc-level-4 .toc-link {
  font-size: 12px;
  color: #999;
}
@media (max-width: 1200px) {
  .toc-article {
    position: static;
    width: 100%;
    max-height: none;
    margin: 20px 0;
    border-radius: 6px;
  }
  .toc-article.toc-collapsed {
    width: 100%;
    height: auto;
    border-radius: 6px;
    padding: 15px;
    position: static;
  }
  .toc-article.toc-collapsed .toc-title {
    display: block;
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    border-bottom: 2px solid #e1e8ed;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }
  .toc-article.toc-collapsed .toc-title::after {
    display: block;
  }
  .toc-article.toc-collapsed::before {
    display: none;
  }
}
[data-dark=true] .toc-article {
  background: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}
[data-dark=true] .toc-article .toc-title {
  color: #e2e8f0;
  border-bottom-color: #4a5568;
}
[data-dark=true] .toc-article .toc-title:hover {
  color: #e2e8f0;
}
[data-dark=true] .toc-article .toc .toc-item .toc-link {
  color: #a0aec0;
}
[data-dark=true] .toc-article .toc .toc-item .toc-link:hover {
  color: #e2e8f0;
  background: #4a5568;
}
[data-dark=true] .toc-article .toc .toc-item .toc-link.active {
  color: #e2e8f0;
  background: #2c5282;
}
[data-dark=true] .toc-article.toc-collapsed {
  background: #4a5568;
  border-color: #718096;
}
[data-dark=true] .toc-article.toc-collapsed::before {
  color: #a0aec0;
}
[data-dark=true] .toc-article.toc-collapsed:hover {
  background: #2d3748;
  border-color: #a0aec0;
}
[data-dark=true] .toc-article.toc-collapsed:hover::before {
  color: #e2e8f0;
}

.toc-hint {
  position: fixed;
  top: 80px;
  right: 20px;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 1001;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.toc-hint.show {
  opacity: 1;
  transform: translateY(0);
}
.toc-hint::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 20px;
  border: 6px solid transparent;
  border-top-color: #333;
}

.toc-toggle-btn {
  position: fixed;
  top: 120px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #f8f9fa;
  color: #666;
  border: 1px solid #e1e8ed;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
.toc-toggle-btn:hover {
  background: #f0f0f0;
  border-color: #d0d0d0;
  color: #333;
  transform: scale(1.05);
}
.toc-toggle-btn.hidden {
  opacity: 0;
  pointer-events: none;
}
[data-dark=true] .toc-toggle-btn {
  background: #4a5568;
  border-color: #718096;
  color: #a0aec0;
}
[data-dark=true] .toc-toggle-btn:hover {
  background: #2d3748;
  border-color: #a0aec0;
  color: #e2e8f0;
}

@media (max-width: 768px) {
  .toc-article {
    position: static;
    width: 100%;
    margin: 20px 0;
    border-radius: 6px;
  }
  .toc-toggle-btn {
    display: none;
  }
  .toc-hint {
    display: none;
  }
}