/* 有语言类别的代码块 */
pre > code[class] { 
  background-color: #f7f7f7; 
}

/* 无语言类别的代码块 */
code.language-undefined, pre > code:not([class]) {
  background-color: inherit;
  border: 1px solid #eee;  /* 比默认设置稍浅点 */
}

/* 行内代码设置 */
:not(pre) > code {
  background: #eff1f3; /* 设置行内代码的背景色 */
  border-radius: 5px; /* 设置行内代码的圆角 */
  padding: 2px 4px; /* 添加内边距，使内容不贴边 */
}

/* 代码字体大小 */
pre, code {
  font-size: .95em;
}

/* 表格宽度 */
table {
  width: 100%;
}

/* 统一悬停动画 */
a {
  display: inline-block;
  transition: transform 0.2s ease-out;
  will-change: transform;
  border-bottom: 1px solid #d3d3d3; /* 添加灰色实线下划线 */
  padding-bottom: 0; /* 移除默认内边距 */
  position: relative; /* 启用定位微调 */
}

/* 特殊对象去掉下划线 */
.menu a, .tag a, .copyright a, .beian a {
  border-bottom: none !important; /* 去掉下划线并确保优先级 */
}

/* 悬停鞠躬效果 */
a:hover {
  transform: translate(1px, 1px); /* 右下方偏移 */
}

/* 文字两端对齐 */
/*
p {
  text-align: justify;
  text-justify: inter-word;
}
*/

/* 折叠代码按钮 */
#toggle-all {
  font-size: inherit;
  margin-left: 1em;
}

/* 折叠代码横线 */
summary {
  border-bottom: 1px solid #ddd;
}

/* 修饰目录容器 */
#TOC {
  background-color: #f5f5f5;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
}

/* 目录列表项 */
#TOC > ul > li {
  margin-bottom: 12px;
  font-size: 16px;
}

/* 目录列表项中的链接 */
#TOC > ul > li > a {
  display: inline-block;  /* 让文本可以设置内边距 */
  line-height: 1.2;
  padding: 4px 8px;
  margin-left: -4px;  /* 和容器的内边距对齐 */
  font-size: 16px;
  font-weight: bold;
  color: #333;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

/* 提示信息块 */
dl, fieldset {
  background-color: #e5eaef;
  font-size: .9em;  /* 缩小字体 */
  border-width: 1px;
  border: 1px solid #ddd;
}

dt, legend {
  font-weight: bold;  /* 注意行加粗 */
}

/* 文章页面年份 */
.year-group {
  margin-left: 0; /* 移除可能存在的左间距 */
  width: 100%;   /* 确保容器宽度充满 */
}

.year-header {
  text-align: left;
  margin-left: 0;
  padding-left: 0;
  
  /* 增加移动端保障 */
  @media (max-width: 767px) {
    text-align: left !important;
  }
}

/* 标签容器 */
.terms-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px; /* 标签间距 */
  padding: 1rem 0;
}

/* 单个标签样式 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 1rem;
  background: #f5f5f5;
  border-radius: 6px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s ease;
  font-size: 14px;
  border: 1px solid transparent;
}

/* 标签数量 */
.tag .count {
  margin-left: 6px;
  color: #666;
  font-size: 0.9em;
}

/* 标签悬停效果 */
.tag:hover {
  box-shadow: none;
  background: #e0e0e0;
}

/* 标签手机端适配 */
@media (max-width: 768px) {
  .terms-container {
    gap: 7px;
  }
  
  .tag {
    padding: 0.25rem 0.8rem;
    font-size: 13px;
    border-width: 0.5px;
  }
}
