.post-content pre {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 20px;
    overflow-x: scroll;
    color: #e6edf3;
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 15px;
    font-variant-ligatures: none;
    line-height: 1.65;
    tab-size: 4;
    white-space: pre;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 12px;
    scrollbar-color: #6e7681 #0d1117;
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    overscroll-behavior-x: contain;
}

.post-content pre > code {
    display: block;
    min-width: max-content;
    padding: 0;
    color: inherit;
    font: inherit;
    white-space: inherit;
    background: transparent;
    border: 0;
}

.post-content pre::-webkit-scrollbar {
    height: 12px;
}

.post-content pre::-webkit-scrollbar-track {
    background: #0d1117;
}

.post-content pre::-webkit-scrollbar-thumb {
    background: #6e7681;
    border: 3px solid #0d1117;
    border-radius: 999px;
}

.post-content .tdc-code-card {
    --code-background: #0d1117;
    --code-border: #30363d;
    --code-control-background: #21262d;
    --code-control-hover: #30363d;
    --code-muted: #aeb8c6;
    --code-text: #e6edf3;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    color: var(--code-text);
    background: var(--code-background);
    border: 1px solid var(--code-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
}

.post-content .tdc-code-card-toolbar {
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 4px 16px;
    color: var(--code-muted);
    background: #161b22;
    border-bottom: 1px solid var(--code-border);
}

.post-content .tdc-code-card-language {
    min-width: 0;
    margin-right: auto;
    overflow-wrap: anywhere;
    font-family: var(--font1), sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-transform: uppercase;
}

.post-content .tdc-code-controls {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
}

.post-content .tdc-code-action {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--code-text);
    font-family: var(--font1), sans-serif;
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    transition:
        background-color 120ms ease,
        border-color 120ms ease;
}

.post-content .tdc-code-action:hover {
    background: var(--code-control-background);
    border-color: var(--code-border);
}

.post-content .tdc-code-action:disabled {
    cursor: wait;
    opacity: 0.7;
}

.post-content .tdc-code-action[data-copy-state="success"] {
    color: #aff5b4;
}

.post-content .tdc-code-action[data-copy-state="error"] {
    color: #ffb4ab;
}

.post-content .tdc-code-action:focus-visible {
    outline: 2px solid #79c0ff;
    outline-offset: 2px;
}

.post-content .tdc-code-card-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
}

.post-content .tdc-code-card-viewport {
    position: relative;
    max-width: 100%;
    overflow-x: scroll;
    scrollbar-color: #6e7681 var(--code-background);
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    overscroll-behavior-x: contain;
}

.post-content .tdc-code-card-viewport:focus-visible {
    z-index: 1;
    outline: 2px solid #79c0ff;
    outline-offset: -3px;
}

.post-content .tdc-code-card-viewport::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 12px;
    width: 28px;
    pointer-events: none;
    content: "";
    background: linear-gradient(90deg, transparent, var(--code-background));
}

.post-content .tdc-code-card-viewport::-webkit-scrollbar {
    height: 12px;
}

.post-content .tdc-code-card-viewport::-webkit-scrollbar-track {
    background: var(--code-background);
}

.post-content .tdc-code-card-viewport::-webkit-scrollbar-thumb {
    background: #6e7681;
    border: 3px solid var(--code-background);
    border-radius: 999px;
}

.post-content .tdc-code-card pre {
    width: max-content;
    max-width: none;
    min-width: 100%;
    margin: 0;
    padding: 20px;
    overflow: visible;
    color: var(--code-text);
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 15px;
    font-variant-ligatures: none;
    line-height: 1.65;
    tab-size: 4;
    white-space: pre;
    background: var(--code-background);
    border: 0;
    border-radius: 0;
}

.post-content .tdc-code-card code {
    display: block;
    min-width: max-content;
    padding: 0;
    color: inherit;
    font: inherit;
    white-space: inherit;
    background: transparent;
    border: 0;
}

.post-content .tdc-code-card.is-wrapped pre,
.post-content .tdc-code-card.is-wrapped code {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.post-content .tdc-code-card.is-wrapped .tdc-code-card-viewport {
    overflow-x: hidden;
}

.post-content .tdc-code-card.is-wrapped .tdc-code-card-viewport::after {
    display: none;
}

.post-content .tdc-code-card-host > figcaption {
    margin-top: 10px;
}

.post-content :not(pre) > code {
    padding: 0.12em 0.34em;
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    overflow-wrap: anywhere;
    background: color-mix(in srgb, currentColor 10%, transparent);
    border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    border-radius: 0.3em;
}

.post-content .tdc-code-card .token.comment,
.post-content .tdc-code-card .token.prolog,
.post-content .tdc-code-card .token.doctype,
.post-content .tdc-code-card .token.cdata {
    color: #a5adba;
}

.post-content .tdc-code-card .token.punctuation {
    color: #c9d1d9;
}

.post-content .tdc-code-card .token.property,
.post-content .tdc-code-card .token.tag,
.post-content .tdc-code-card .token.constant,
.post-content .tdc-code-card .token.symbol,
.post-content .tdc-code-card .token.deleted,
.post-content .tdc-code-card .token.keyword {
    color: #ff7b72;
}

.post-content .tdc-code-card .token.boolean,
.post-content .tdc-code-card .token.number,
.post-content .tdc-code-card .token.function,
.post-content .tdc-code-card .token.class-name {
    color: #d2a8ff;
}

.post-content .tdc-code-card .token.selector,
.post-content .tdc-code-card .token.attr-name,
.post-content .tdc-code-card .token.string,
.post-content .tdc-code-card .token.char,
.post-content .tdc-code-card .token.builtin,
.post-content .tdc-code-card .token.inserted {
    color: #a5d6ff;
}

.post-content .tdc-code-card .token.operator,
.post-content .tdc-code-card .token.entity,
.post-content .tdc-code-card .token.url,
.post-content .tdc-code-card .token.variable {
    color: #79c0ff;
}

.post-content .tdc-code-card .token.atrule,
.post-content .tdc-code-card .token.attr-value {
    color: #7ee787;
}

.post-content .tdc-code-card .token.regex,
.post-content .tdc-code-card .token.important {
    color: #ffa657;
}

.post-content .tdc-code-card ::selection {
    color: #fff;
    background: #264f78;
}

@media (max-width: 479px) {
    .post-content .tdc-code-card-toolbar {
        gap: 6px;
        padding-left: 12px;
    }

    .post-content .tdc-code-card-language {
        font-size: 12px;
    }

    .post-content .tdc-code-action {
        padding-right: 9px;
        padding-left: 9px;
    }

    .post-content .tdc-code-card pre {
        padding: 16px;
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .post-content .tdc-code-action {
        transition: none;
    }
}

@media (forced-colors: active) {
    .post-content pre,
    .post-content .tdc-code-card,
    .post-content .tdc-code-card-toolbar,
    .post-content .tdc-code-card pre {
        color: CanvasText;
        background: Canvas;
        border-color: CanvasText;
        forced-color-adjust: auto;
    }

    .post-content .tdc-code-card-viewport::after {
        display: none;
    }

    .post-content .tdc-code-action {
        color: ButtonText;
        border-color: ButtonText;
    }
}

@media print {
    .post-content .tdc-code-card {
        color: #000;
        background: #fff;
        border: 1px solid #777;
        box-shadow: none;
        break-inside: avoid;
    }

    .post-content .tdc-code-card-toolbar,
    .post-content .tdc-code-card-viewport::after {
        display: none;
    }

    .post-content .tdc-code-card-viewport {
        overflow: visible;
    }

    .post-content pre,
    .post-content pre > code,
    .post-content .tdc-code-card pre,
    .post-content .tdc-code-card code {
        width: auto;
        max-width: 100%;
        min-width: 0;
        overflow: visible;
        color: #000;
        white-space: pre-wrap;
        background: #fff;
    }
}
