.highlight .err {
  background-color: transparent !important;
  /* 移除或确认注释是否需要 */
  /* #color: inherit !important; */
}

/* 全局覆盖 blockquote 的默认斜体 */
blockquote {
  font-style: normal;
}

/* 如果主题使用更精细的选择器，例如 blockquote p，加上这一句也可以 */
blockquote p {
  font-style: normal;
}

blockquote {
  background-color: transparent !important;
}

pre, code {
  background-color: transparent !important;
}

code, pre,
blockquote code,
blockquote pre {
  font-style: normal !important;
}

/* CSS 变量定义 */
:root {
  /* 浅色模式变量 */
  --marginalia-bg-light: none;               /* 移除背景色 */
  --marginalia-hover-bg-light: none;         /* 悬停时移除背景色 */
  --marginalia-text-light: #333;             /* 深灰色文本 */

  /* 深色模式变量 */
  --marginalia-bg-dark: none;                /* 移除背景色 */
  --marginalia-hover-bg-dark: none;          /* 悬停时移除背景色 */
  --marginalia-text-dark: #333;              /* 浅灰色文本 */

  /* Tooltip 背景色 */
  --tooltip-bg-light: rgba(0, 0, 0, 0.8);
  --tooltip-text-light: #fff;
  --tooltip-bg-dark: rgba(255, 255, 255, 0.9);
  --tooltip-text-dark: #000;

  /* 箭头颜色 */
  --arrow-bg-light: rgba(0, 0, 0, 0.8);
  --arrow-bg-dark: rgba(255, 255, 255, 0.9);
}

/* 基本旁注样式 */
.marginalia {
  position: relative;
  display: inline;
  color: var(--marginalia-text-light);
  cursor: pointer;
  background-color: var(--marginalia-bg-light); /* 已设置为 none */
  padding: 0; /* 移除内边距，避免占用额外空间 */
  border-radius: 0; /* 移除圆角 */
  text-decoration: underline; /* 添加下划线 */
  text-underline-offset: 6px;
  text-decoration: underline; /* 添加下划线 */
  text-decoration-thickness: 1px; /* 下划线粗细 */
  text-underline-offset: 7px; /* 下划线与文本的间距 */
  
  /* 新增属性 */
  text-decoration-style: wavy; /* 下划线样式：solid, double, dotted, dashed, wavy */
  text-decoration-color: #555; /* 下划线颜色 */
  transition: color 0.3s ease; /* 移除背景色过渡，仅保留颜色过渡 */
  font-weight: normal; /* 保持文本正常粗细 */
}

/* 悬停时改变文本颜色以提供视觉反馈 */
.marginalia:hover {
  color: #555; /* 选择一个稍微深一点的颜色，与你的设计保持一致 */
  /* 移除背景色变化 */
}

/* Tooltip 样式 */
.marginalia::after {
  content: attr(data-note);
  position: absolute;
  left: 50%;
  top: 100%; /* 将提示框放在旁注文本下方 */
  transform: translateX(-50%) translateY(10px); /* 向下移动 */
  white-space: nowrap;
  background-color: var(--tooltip-bg-light);
  color: var(--tooltip-text-light);
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
  z-index: 1000;
  max-width: 300px;
  font-size: 0.9em;
  line-height: 1.4;
}

/* 箭头样式 */
.marginalia::before {
  content: '';
  position: absolute;
  top: 100%; /* 箭头位于提示框上方 */
  left: 50%;
  transform: translateX(-50%) translateY(0);
  border-width: 6px;
  border-style: solid;
  border-color: var(--arrow-bg-light) transparent transparent transparent; /* 箭头朝下 */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
  z-index: 1001;
}

/* 悬停时显示旁注内容和箭头 */
.marginalia:hover::after,
.marginalia:hover::before {
  opacity: 1;
  visibility: visible;
}

/* 浅色模式样式（默认） */
@media (prefers-color-scheme: light) {
  .marginalia {
    color: var(--marginalia-text-light);
  }

  .marginalia:hover {
    color: #555; /* 与上面一致 */
  }

  .marginalia::after {
    background-color: var(--tooltip-bg-light);
    color: var(--tooltip-text-light);
  }

  .marginalia::before {
    border-color: var(--arrow-bg-light) transparent transparent transparent;
  }
}

/* 深色模式样式 */
@media (prefers-color-scheme: dark) {
  .marginalia {
    color: var(--marginalia-text-dark);
  }

  .marginalia:hover {
    color: #ccc; /* 选择一个适合深色模式的颜色 */
  }

  .marginalia::after {
    background-color: var(--tooltip-bg-dark);
    color: var(--tooltip-text-dark);
  }

  .marginalia::before {
    border-color: var(--arrow-bg-dark) transparent transparent transparent;
  }
}

/* 默认（浅色模式）下的 iframe 样式 */
.widgetstore-iframe {
  background-color: white; /* 或其他浅色背景，根据需求调整 */
}

/* 深色模式下移除 iframe 背景色 */
@media (prefers-color-scheme: dark) {
  .widgetstore-iframe {
    background-color: transparent !important; /* 移除背景色 */
  }
}

