.article-content .xw-code-shell,
.entry-content .xw-code-shell,
.post-content .xw-code-shell {
  position: relative;
  margin: 22px 0;
  border: 1px solid #2d333b;
  border-radius: 8px;
  background: #0d1117;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  isolation: isolate;
}

.article-content .xw-code-header,
.entry-content .xw-code-header,
.post-content .xw-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid #2d333b;
  background: linear-gradient(180deg, #161b22 0%, #111820 100%);
}

.article-content .xw-code-lang,
.entry-content .xw-code-lang,
.post-content .xw-code-lang {
  color: #9da7b3;
  font: 600 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-transform: uppercase;
}

.article-content .xw-code-copy,
.entry-content .xw-code-copy,
.post-content .xw-code-copy {
  appearance: none;
  border: 1px solid #3f4752;
  border-radius: 5px;
  background: #21262d;
  color: #c9d1d9;
  cursor: pointer;
  font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 6px 9px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.article-content .xw-code-copy:hover,
.entry-content .xw-code-copy:hover,
.post-content .xw-code-copy:hover {
  background: #30363d;
  border-color: #58a6ff;
  color: #fff;
}

.article-content .xw-code-copy.is-copied,
.entry-content .xw-code-copy.is-copied,
.post-content .xw-code-copy.is-copied {
  border-color: #3fb950;
  color: #7ee787;
}

.article-content .precopy,
.entry-content .precopy,
.post-content .precopy {
  display: none !important;
}

.article-content pre.xw-code-block,
.entry-content pre.xw-code-block,
.post-content pre.xw-code-block {
  margin: 0;
  padding: 18px 20px;
  border: 0;
  border-radius: 0;
  background: #0d1117;
  color: #c9d1d9;
  font: 13px/1.75 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Monaco, "Courier New", monospace;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-color: #4f5b68 #111820;
  scrollbar-width: thin;
  white-space: pre;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}

.article-content pre.xw-code-block code,
.entry-content pre.xw-code-block code,
.post-content pre.xw-code-block code,
.article-content pre.xw-code-block code.hljs,
.entry-content pre.xw-code-block code.hljs,
.post-content pre.xw-code-block code.hljs {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: inherit;
}

.article-content pre.xw-code-block::-webkit-scrollbar,
.entry-content pre.xw-code-block::-webkit-scrollbar,
.post-content pre.xw-code-block::-webkit-scrollbar {
  width: 0;
  height: 12px;
}

.article-content pre.xw-code-block::-webkit-scrollbar-track,
.entry-content pre.xw-code-block::-webkit-scrollbar-track,
.post-content pre.xw-code-block::-webkit-scrollbar-track {
  border-top: 1px solid #1f2933;
  background: #111820;
}

.article-content pre.xw-code-block::-webkit-scrollbar-thumb,
.entry-content pre.xw-code-block::-webkit-scrollbar-thumb,
.post-content pre.xw-code-block::-webkit-scrollbar-thumb {
  min-width: 42px;
  border: 3px solid #111820;
  border-radius: 999px;
  background: linear-gradient(90deg, #3f4752, #64748b);
}

.article-content pre.xw-code-block::-webkit-scrollbar-thumb:hover,
.entry-content pre.xw-code-block::-webkit-scrollbar-thumb:hover,
.post-content pre.xw-code-block::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #5f6b7a, #8aa0b8);
}

.article-content pre.xw-code-block::-webkit-scrollbar-corner,
.entry-content pre.xw-code-block::-webkit-scrollbar-corner,
.post-content pre.xw-code-block::-webkit-scrollbar-corner {
  background: #111820;
}

.article-content :not(pre) > code,
.entry-content :not(pre) > code,
.post-content :not(pre) > code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef2f7;
  color: #cf222e;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Monaco, "Courier New", monospace;
  font-size: 0.92em;
}

@media (max-width: 640px) {
  .article-content .xw-code-shell,
  .entry-content .xw-code-shell,
  .post-content .xw-code-shell {
    margin: 18px -2px;
    border-radius: 6px;
  }

  .article-content pre.xw-code-block,
  .entry-content pre.xw-code-block,
  .post-content pre.xw-code-block {
    padding: 15px 14px;
    font-size: 12px;
  }
}
