/* -------------------单页配置（极简风格）---------------------- */
.singleArticle {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border: none;
  transition: none;
}

.singleArticle:hover {
  box-shadow: none;
}

.singleArticle a {
  color: var(--maincolor);
  text-decoration: none;
  position: relative;
  transition: color 0.15s ease;
}

.singleArticle a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--maincolor);
  transition: width 0.2s ease;
}

.singleArticle a:hover {
  color: var(--maincolor);
}

.singleArticle a:hover::after {
  width: 100%;
}

.singleArticle .footerMenu a {
  color: inherit;
}

.singleArticle .footerMenu a::after {
  display: none;
}

/* -------------------标题区域配置（极简）---------------------- */
.singleArticle .titleSection {
  margin-bottom: 1.2em;
  padding-bottom: 0.6em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  text-align: center;
}

.singleArticle .titleSection::after {
  display: none;
}

.singleArticle .titleSection .backToHome {
  display: inline-block;
  color: #999;
  font-size: 13px;
  font-weight: 300;
  text-decoration: none;
  margin-top: 4px;
  transition: color 0.15s ease, transform 0.15s ease;
  letter-spacing: 0.02em;
}

.singleArticle .titleSection .backToHome:hover {
  color: var(--maincolor);
  transform: translateX(-4px);
}

.singleArticle .titleSection .backToHome::after {
  display: none;
}

.singleArticle .titleSection .title {
  margin-bottom: 0;
  margin-top: 0;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--fontColor);
  letter-spacing: 0.02em;
}

/* -------------------内容区域配置（极简）---------------------- */
.singleArticle .content {
  min-height: 10vh;
  font-size: 14px;
  line-height: 1.65;
  color: var(--fontColor);
}

.singleArticle .content h2 {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--fontColor);
  margin-top: 1.5em;
  margin-bottom: 0.6em;
  padding-left: 0;
  border-left: none;
  background: transparent;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: 1px solid rgba(199, 37, 78, 0.1);
  border-radius: 0;
}

.singleArticle .content h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: #555;
  margin-top: 1.2em;
  margin-bottom: 0.4em;
}

.singleArticle .content p {
  margin-bottom: 0.75em;
  text-align: left;
}

.singleArticle .placeholder {
  min-height: 60vh;
}

/* -------------------目录配置（极简）---------------------- */
.singleRightSide {
  background: transparent;
  padding: 0;
  padding-top: 3em;
  box-shadow: none;
  border: none;
  transition: none;
}

.singleRightSide:hover {
  box-shadow: none;
  transform: none;
}

.tocContainer {
  max-height: 76vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tocContainer::-webkit-scrollbar {
  display: none;
}

.tocContainer ul {
  margin: unset;
  padding: 0;
}

/* 嵌套列表默认显示（用户手动控制展开/收缩） */
.tocContainer ul ul {
  display: block;
  padding-left: 16px; /* 子级目录缩进 */
}

/* 收缩状态 */
.tocContainer li:not(.expanded) > ul {
  display: none;
}

.tocContainer li.expanded > ul {
  display: block;
  animation: slideDown 0.3s ease;
}

.tocContainer li.collapsing > ul {
  animation: slideUp 0.3s ease forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
}

.tocContainer li {
  font-size: 12px;
  line-height: 1.3;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: 1px 6px;
  margin: 0;
  border-radius: 0;
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}

/* 有子级的项显示箭头指示器（确保 ul 中有实际的 li 子元素） */
.tocContainer li:has(> ul > li) > a:first-child::before {
  content: '▸';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  transition: transform 0.3s ease, color 0.3s ease;
  color: #999;
}

/* 展开状态的箭头旋转 */
.tocContainer li.expanded:has(> ul > li) > a:first-child::before {
  content: '▾';
  color: var(--maincolor);
}

.tocContainer li::before{
  content: none;
}

.tocContainer li:hover {
  background: linear-gradient(90deg, rgba(199, 37, 78, 0.03), transparent);
  transform: translateX(2px);
}

.tocContainer a {
  color: #555;
  text-decoration: none;
  display: block;
  transition: color 0.15s ease;
  position: relative;
  padding-left: 18px;
  background: transparent;
}

.tocContainer a:hover {
  color: var(--maincolor);
  background: transparent;
}

.tocContainer a:hover::before {
  background: transparent;
}

.tocContainer a.active {
  font-weight: 500;
  color: var(--maincolor);
  background: transparent;
  border-radius: 0;
}

.tocContainer a.active::before {
  background: transparent;
  box-shadow: none;
}

/* -------------------返回顶部按钮配置---------------------- */
.backToTopBtn {
  position: fixed;
  bottom: 10vh;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(199, 37, 78, 0.12);
  color: var(--maincolor);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  border: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease,
              background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(199, 37, 78, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.backToTopBtn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.backToTopBtn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.backToTopBtn:hover {
  background-color: #c7254e;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(199, 37, 78, 0.3);
  transform: translateY(-2px);
}

.backToTopBtn:active {
  transform: translateY(0) scale(0.95);
}

/* -------------------响应式优化---------------------- */
@media (max-width: 1024px) {
  .commonMain {
    padding: 1.2em 0 0 0;
  }

  .singleArticle {
    padding: 0;
  }

  .singleArticle .titleSection .title {
    font-size: 1.5rem;
  }

  .singleRightSide {
    display: none !important;
  }

  .singleMain .commonArticle {
    width: 85%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .commonMain {
    padding: 1em 0 0 0;
  }

  .singleArticle {
    padding: 0;
    border-radius: 0;
  }

  .singleArticle .titleSection .title {
    font-size: 1.3rem;
  }

  .singleArticle .content h2 {
    font-size: 1.15rem;
    padding-left: 0;
  }

  .singleMain .commonArticle {
    width: 92%;
    max-width: none;
  }
}

/* -------------------返回顶部按钮响应式---------------------- */
@media (max-width: 1024px) {
  .backToTopBtn {
    bottom: 1.5em;
    right: 1.5em;
    left: auto !important;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .backToTopBtn {
    bottom: 1em;
    right: 1em;
    left: auto !important;
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}