/* 新版 / 旧版切换按钮（两个版本都加载） */
html.page--codenote .codenote-ui-switch {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
}

html.page--codenote .codenote-ui-switch-btn {
  padding: 3px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

html.page--codenote .codenote-ui-switch-btn:hover {
  color: #374151;
}

html.page--codenote .codenote-ui-switch-btn[aria-pressed='true'] {
  background: #ffffff;
  color: #2563eb;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

html.page--codenote .codenote-ui-switch-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

/* 仅新版 / 仅旧版展示的节点 */
html.page--codenote:not(.codenote-v2) .codenote-v2-only,
html.page--codenote.codenote-v2 .codenote-legacy-only {
  display: none !important;
}

html.page--codenote.theme--dark .codenote-ui-switch {
  background: #161b22;
  border-color: #30363d;
}

html.page--codenote.theme--dark .codenote-ui-switch-btn {
  color: #8b949e;
}

html.page--codenote.theme--dark .codenote-ui-switch-btn:hover {
  color: #c9d1d9;
}

html.page--codenote.theme--dark .codenote-ui-switch-btn[aria-pressed='true'] {
  background: #21262d;
  color: #58a6ff;
  box-shadow: none;
}
