/* 整体容器样式（模拟Mac窗口） */
.syntaxhighlighter {
  background-color: #fbfbfb !important;
  border: 1px solid #e7e7e7 !important;
  border-radius: 6px !important;
  padding-top: 30px !important; /* 为顶部标题栏留出空间 */
  position: relative !important;
  overflow: hidden !important;
  margin: 1em 0 !important;
}

/* 顶部Mac窗口标题栏 */
.syntaxhighlighter::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background-color: #f0f0f0 !important;
  border-bottom: 1px solid #e1e1e1 !important;
  z-index: 1;
}

/* Mac窗口控制按钮（红/黄/绿圆点） */
.syntaxhighlighter::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
  height: 12px;
  width: 12px;
  background: #e56160;
  border-radius: 50%;
}

.syntaxhighlighter::after span {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.syntaxhighlighter::after span:nth-child(1) {
  background-color: #ff5f58 !important;
}

.syntaxhighlighter::after span:nth-child(2) {
  background-color: #ffbd2e !important;
}

.syntaxhighlighter::after span:nth-child(3) {
  background-color: #18c37d !important;
}

/* 窗口标题（如Yaml/HTML/JS） */
.syntaxhighlighter .toolbar {
  position: absolute !important;
  top: 0 !important;
  left: 48px !important;
  height: 30px !important;
  line-height: 30px !important;
  font-size: 13px !important;
  color: #333 !important;
  z-index: 2;
  text-transform: uppercase;
  font-weight: 500;
}

/* 代码内容区（避开标题栏） */
.syntaxhighlighter .code {
  padding: 16px !important;
  margin-top: 0 !important;
}

/* 行号样式（浅灰色，不可选中） */
.syntaxhighlighter .gutter .line {
  color: #999 !important;
  font-size: 14px !important;
  padding-right: 16px !important;
  user-select: none !important;
}

/* 代码文本基础样式 */
.syntaxhighlighter .line {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  white-space: pre-wrap !important;
}

/* 语法高亮配色（适配YAML/HTML/JS） */
/* 键名/标签名 */
.syntaxhighlighter .keyword,
.syntaxhighlighter .tag {
  color: #0066cc !important;
  font-weight: 500 !important;
}

/* 值/字符串 */
.syntaxhighlighter .string,
.syntaxhighlighter .value {
  color: #c41a16 !important;
}

/* 注释 */
.syntaxhighlighter .comments {
  color: #008000 !important;
}

/* 注释中的关键字 */
.syntaxhighlighter .comments .keyword {
  color: #666 !important;
  font-style: italic !important;
}

/* 移除默认边框和背景 */
.syntaxhighlighter table {
  border: none !important;
  background: transparent !important;
}

.syntaxhighlighter td.code {
  border-left: none !important;
}

/* 右侧操作按钮（复制/下拉） */
.syntaxhighlighter .toolbar a {
  display: none !important; /* 隐藏默认按钮 */
}

.syntaxhighlighter .custom-actions {
  position: absolute !important;
  top: 4px !important;
  right: 12px !important;
  display: flex !important;
  gap: 8px !important;
  z-index: 2 !important;
}

.syntaxhighlighter .custom-actions button {
  width: 22px !important;
  height: 22px !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  opacity: 0.7 !important;
  transition: opacity 0.2s !important;
}

.syntaxhighlighter .custom-actions button:hover {
  opacity: 1 !important;
}

/* 下拉箭头按钮 */
.syntaxhighlighter .custom-actions .dropdown-btn::before {
  content: "▼" !important;
  font-size: 10px !important;
  color: #666 !important;
}

/* 复制按钮 */
.syntaxhighlighter .custom-actions .copy-btn::before {
  content: "📋" !important;
  font-size: 12px !important;
}