body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
}

.sidebar {
  padding: 20px;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px; /* 固定宽度 */
  overflow-y: auto;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1); /* 添加阴影效果 */
  transform: translateX(100%); /* 默认隐藏侧边栏 */
}

.sidebar.open {
  transform: translateX(0); /* 显示侧边栏 */
}

.sidebar.hidden {
  transform: translateX(100%); /* 隐藏侧边栏 */
}

#floatingToggleSidebar, .scroll-to-top, .scroll-to-bottom {
  z-index: 1002; /* 确保浮动按钮在侧边栏上方 */
  opacity: 0.8; /* 半透明效果 */
  transition: opacity 0.3s ease; /* 添加过渡效果 */
}

#floatingToggleSidebar:hover, .scroll-to-top:hover, .scroll-to-bottom:hover {
  opacity: 1; /* 鼠标悬停时完全不透明 */
}

/* 代码高亮样式 */
pre {
  display: block;
  padding: 15px; /* 增加内边距 */
  border-radius: 5px; /* 圆角效果 */
  font-family: 'Courier New', monospace; /* 字体 */
  font-size: 14px; /* 字体大小 */
  white-space: pre; /* 保留换行 */
  word-wrap: normal; /* 禁用自动换行 */
  overflow-x: auto; /* 允许水平滚动 */
  -webkit-overflow-scrolling: touch; /* 优化移动端的滚动体验 */
  margin: 1rem 0; /* 增加上下边距 */
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* 添加阴影效果 */
}

pre code {
  display: inline-block; /* 让代码块可以水平滚动 */
  white-space: pre; /* 保留换行 */
  word-wrap: normal; /* 禁用自动换行 */
}

/* 自定义 highlight.js 主题样式 */
.hljs-comment,
.hljs-quote {
  color: #4a86e8;
  font-style: italic;
}

/* 下面根本没用,因为没有生成对应的html类名
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
  color: #569cd6;
  font-weight: bold;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
  color: #b5cea8;
}

.hljs-string,
.hljs-doctag {
  color: #ce9178;
}

.hljs-title,
.hljs-section,
.hljs-selector-id {
  color: #d7ba7d;
}

.hljs-built_in,
.hljs-builtin-name {
  color: #4ec9b0;
}

.language-bash .hljs-keyword {
  color: #569cd6;
  font-weight: bold;
}

.language-bash .hljs-built_in {
  color: #4ec9b0;
}

.language-bash .hljs-string {
  color: #ce9178;
}

.language-bash .hljs-comment {
  color: #ffa500;
  font-style: italic;
}
*/

/* 表格样式 */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
  border: 1px solid #ddd;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border-radius: 4px;
  overflow: visible; /* 修改为visible，避免内容被截断 */
  display: table; /* 确保表格正确显示 */
}

/* Markdown表格特定样式 */
.markdown-table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
  border: 2px solid #4a86e8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.95em;
  line-height: 1.5;
}

.markdown-table th {
  background-color: #4a86e8;
  color: white;
  font-weight: 600;
  padding: 12px 15px;
  text-align: center;
}

.markdown-table td {
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
}

.markdown-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.markdown-table tr:hover {
  background-color: #f1f7ff;
}

.table-container {
  overflow-x: auto;
  display: block;
  width: 100%;
  margin-bottom: 1.5rem;
  border-radius: 4px;
  border: 1px solid #eee;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  padding: 0.5rem;
  max-width: 100%;
}

table th {
  background-color: #f2f2f2;
  font-weight: bold;
  text-align: center;
  padding: 12px 15px;
  border: 1px solid #ddd;
  color: #333;
}

table td {
  padding: 10px 15px;
  border: 1px solid #ddd;
  vertical-align: middle;
  text-align: left;
}

table tr:nth-child(even) {
  background-color: #f9f9f9;
}

table tr:hover {
  background-color: #f1f1f1;
}

/* 图片样式 */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 调整置尾按钮位置 */
.scroll-to-bottom {
  bottom: 10px;
}

/* 优化正文布局，使其居中且有适当留白 */
main {
  text-align: left;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  transition: all 0.3s ease;
}

#root {
  padding: 0 2rem;
  line-height: 1.8;
}

/* blockquote样式 */
blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #4a86e8;
  background-color: #f8f9fa;
  color: #555;
  font-style: italic;
  border-radius: 4px;
}

blockquote p {
  margin: 0;
}

/* 响应式设计 */
@media only screen and (max-width: 992px) {
  .sidebar {
    width: 250px;
    transform: translateX(100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  
  /* 调整置尾按钮在小屏幕设备上的位置 */
  .scroll-to-bottom {
    bottom: 10px;
    right: 10px;
  }
  
  pre {
    white-space: pre; /* 保留换行 */
    word-wrap: normal; /* 禁用自动换行 */
    overflow-x: auto; /* 允许水平滚动 */
  }
  
  /* 内容靠左对齐但保持适当留白 */
  .content {
    margin-left: 0 !important;
    text-align: left !important;
  }
  
  /* 调整内容区域的宽度和留白 */
  main {
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
  }
  
  #root {
    padding: 0 1rem;
  }
  
  /* 确保表格在小屏幕上正确显示 */
  .table-container {
    max-width: 100%;
    overflow-x: auto;
  }
  
  table {
    min-width: 500px;
  }
}

