/* 目录样式优化 */
.toc {
  margin: 1.5rem 0 2rem 0 !important;
  padding: 1.2rem 1.5rem !important;
  border-radius: 10px !important;
  background-color: rgba(80, 80, 80, 0.08) !important;
  border-left: 4px solid #3a7bd5 !important;
  position: relative;
  transition: all 0.3s ease;
}

.toc:hover {
  background-color: rgba(80, 80, 80, 0.12) !important;
}

.toc summary {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  outline: none;
  color: #3a7bd5;
  position: relative;
  padding-left: 1.8rem;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc summary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233a7bd5'%3E%3Cpath d='M3 9h18v2H3V9zm0 4h18v2H3v-2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.3s ease;
}

details[open] > summary::before {
  transform: translateY(-50%) rotate(90deg);
}

.toc ul {
  padding-top: 1rem !important;
  margin-left: 0 !important;
  padding-left: 1.2rem !important;
  list-style-type: none !important;
}

.toc ul li {
  margin-bottom: 0.7rem !important;
  line-height: 1.5 !important;
  position: relative;
}

.toc ul li::before {
  content: "";
  position: absolute;
  left: -1.2rem;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #3a7bd5;
}

.toc ul li a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
  display: inline-block;
  border-bottom: 1px solid transparent;
}

.toc ul li a:hover {
  color: #3a7bd5;
  border-bottom-color: #3a7bd5;
}

/* 嵌套列表样式 */
.toc ul ul {
  padding-top: 0.5rem !important;
  padding-left: 1.5rem !important;
}

.toc ul ul li::before {
  width: 5px;
  height: 5px;
  background-color: #698cca;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .toc {
    padding: 1rem !important;
    margin: 1.2rem 0 1.8rem 0 !important;
  }
  
  .toc summary {
    font-size: 1rem;
  }
}