/* 仙侠风格代码块美化 - 米黄色调 */

/* 整体代码块容器 */
.markdown-body pre {
  border-radius: 10px !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
  overflow: hidden !important;
  border: 1px solid rgba(184, 134, 11, 0.4) !important;
  background-color: #fdfaf2 !important;
}

/* 带有语言标识的代码块主容器 */
.markdown-body pre > div {
  background-color: #fcfcf5 !important;
  border-radius: 10px !important;
}

/* 头部栏（语言标识和复制按钮所在行） */
.markdown-body pre > div > div.flex.justify-between.h-8 {
  background: linear-gradient(to right, #f8f6ed, #f3f1e9) !important;
  border-bottom: 2px solid #d4af37 !important;
  padding: 10px 15px !important;
  height: auto !important;
  position: relative !important;
}

/* 语言标签文字 */
.markdown-body pre > div > div.flex.justify-between > div.text-\[13px\] {
  color: #8c7b6d !important;
  font-weight: bold !important;
  font-size: 14px !important;
  text-shadow: 0 0 4px rgba(184, 134, 11, 0.3) !important;
}

/* 复制图标默认颜色 */
.markdown-body pre div[data-tooltip-id^="copy-tooltip"] > svg {
  color: #8c7b6d !important;
  transform: none !important;
  transition: all 0.2s ease-out !important;
}

/* 复制图标悬停颜色 */
.markdown-body pre div[data-tooltip-id^="copy-tooltip"]:hover > svg {
  color: #b8860b !important;
  transform: scale(1.1) !important;
}

/* 代码内容区域（带语言标识的代码块） */
.markdown-body pre > div > div[node] {
  background-color: #fdfaf2 !important;
  color: #3d342f !important;
  padding: 1.2em 1.5em !important;
  font-size: 0.9em !important;
  line-height: 1.7 !important;
  white-space: pre-wrap !important;
  word-break: break-all !important;
}

/* 代码元素中的文字颜色 */
.markdown-body pre code[class^="language-"] {
  color: #3d342f !important;
}

/* 纯代码块（无语言标识） */
.markdown-body pre > code[node] {
  background-color: #fdfaf2 !important;
  color: #3d342f !important;
  padding: 1.2em 1.5em !important;
  font-size: 0.9em !important;
  line-height: 1.7 !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
  border: 1px solid rgba(184, 134, 11, 0.4) !important;
  white-space: pre-wrap !important;
  word-break: break-all !important;
}

/* 语法高亮颜色调整 */
.markdown-body pre code .token.comment {
  color: #a0938b !important;
}
.markdown-body pre code .token.string {
  color: #b8860b !important;
}
.markdown-body pre code .token.keyword {
  color: #8e44ad !important;
  font-weight: bold !important;
}
.markdown-body pre code .token.function {
  color: #d4af37 !important;
}
.markdown-body pre code .token.operator,
.markdown-body pre code .token.punctuation {
  color: #6d5b4f !important;
}
.markdown-body pre code .token.number {
  color: #a3472c !important;
}
/* 仙侠风格侧边栏美化 - 米黄色调 */

/* 侧边栏容器 */
.markdown-body .sidebar-container {
  position: fixed !important; /* 固定定位，让侧边栏始终可见 */
  top: 0 !important;
  left: 0 !important; /* 默认靠左，可根据需求改为 right: 0 */
  width: 250px !important; /* 侧边栏宽度 */
  height: 100vh !important; /* 全屏高度 */
  background: linear-gradient(to bottom, rgba(253, 250, 242, 0.98), rgba(250, 245, 230, 0.95)) !important; /* 柔和的米黄色渐变背景 */
  backdrop-filter: blur(5px) !important; /* 轻微的背景模糊效果 */
  box-shadow: 5px 0 20px rgba(0, 0, 0, 0.15) !important; /* 侧边栏阴影，增加层次感 */
  border-right: 1px solid rgba(184, 134, 11, 0.3) !important; /* 细微的金色边框 */
  padding: 20px 0 !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 990 !important; /* 确保侧边栏在大部分内容之上 */
  overflow-y: auto !important; /* 内容过多时可滚动 */
  transition: transform 0.3s ease-out !important; /* 平滑的出现/隐藏动画 */
}

/* 侧边栏头部 */
.markdown-body .sidebar-header {
  text-align: center !important;
  padding: 15px 10px !important;
  margin-bottom: 20px !important;
  border-bottom: 2px dashed rgba(212, 175, 55, 0.4) !important; /* 虚线分隔，古风韵味 */
}
.markdown-body .sidebar-header h3 {
  font-family: "KaiTi", serif !important; /* 楷体字，仙侠风 */
  font-size: 1.5rem !important;
  color: var(--primary) !important; /* 主色调紫色 */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1) !important;
  letter-spacing: 1px !important;
}

/* 侧边栏导航 */
.markdown-body .sidebar-nav {
  flex-grow: 1 !important; /* 占据剩余空间 */
  padding: 0 15px !important;
}

/* 导航项 */
.markdown-body .sidebar-item {
  display: block !important;
  padding: 12px 15px !important;
  margin-bottom: 8px !important;
  color: var(--text) !important; /* 默认文字颜色 */
  text-decoration: none !important;
  font-size: 1.05rem !important;
  border-radius: 6px !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: hidden !important; /* 隐藏伪元素超出部分 */
}

/* 导航项悬停效果 */
.markdown-body .sidebar-item:hover {
  background-color: rgba(212, 175, 55, 0.1) !important; /* 悬停时浅金色背景 */
  color: var(--primary) !important; /* 文字变为主题色 */
  transform: translateX(5px) !important; /* 轻微右移，动态感 */
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* 导航项激活状态 */
.markdown-body .sidebar-item.active {
  background: linear-gradient(to right, rgba(142, 68, 173, 0.1), rgba(142, 68, 173, 0.05)) !important; /* 激活时主题色渐变背景 */
  color: var(--primary) !important;
  font-weight: bold !important;
  border-left: 3px solid var(--primary) !important; /* 左侧主题色边框 */
  box-shadow: inset 2px 0 8px rgba(142, 68, 173, 0.2) !important;
}
.markdown-body .sidebar-item.active::after {
  content: "✨" !important; /* 激活时添加一个小图标 */
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  opacity: 0.8 !important;
}


/* 侧边栏底部 */
.markdown-body .sidebar-footer {
  text-align: center !important;
  padding: 15px 10px !important;
  margin-top: 20px !important;
  border-top: 1px solid rgba(184, 134, 11, 0.2) !important; /* 顶部细线分隔 */
  font-size: 0.85rem !important;
  color: #777 !important;
}

/* 移动端适配：在小屏幕上隐藏侧边栏 */
@media (max-width: 768px) {
  .markdown-body .sidebar-container {
    transform: translateX(-100%) !important; /* 默认隐藏在屏幕左侧 */
    /* 如果需要通过按钮显示，需要JS控制toggleClass */
    /* 例如：.markdown-body .sidebar-container.open { transform: translateX(0) !important; } */
  }
}
