/**
 * crimson · Prism 代码高亮主题
 * 暗色代码块，日/夜模式通用；仅作用于文章正文（.article-body）
 */

.article-body pre[class*="language-"],
.article-body code[class*="language-"] {
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Monaco, monospace;
	font-size: 13.5px;
	line-height: 1.75;
	text-shadow: none;
	tab-size: 4;
	hyphens: none;
}

.article-body pre[class*="language-"] {
	background: #14161b;
	color: #e6e9ef;
	border: 1px solid rgba(255, 255, 255, .05);
	border-radius: 8px;
	padding: 18px;
	overflow: auto;
}

.article-body pre[class*="language-"] code {
	background: transparent;
	color: inherit;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
}

/* 行内高亮代码 */
.article-body :not(pre) > code[class*="language-"] {
	background: var(--cr-soft);
	color: var(--cr-dark);
	padding: 2px 6px;
	border-radius: 4px;
	white-space: normal;
	font-size: .9em;
}

/* ===== 令牌配色 ===== */
.article-body .token.comment,
.article-body .token.prolog,
.article-body .token.doctype,
.article-body .token.cdata { color: #7d8794; font-style: italic; }

.article-body .token.punctuation { color: #8b949e; }

.article-body .token.namespace { opacity: .75; }

.article-body .token.property,
.article-body .token.tag,
.article-body .token.constant,
.article-body .token.symbol,
.article-body .token.deleted { color: #79c0ff; }

.article-body .token.boolean,
.article-body .token.number { color: #ffa657; }

.article-body .token.selector,
.article-body .token.attr-name,
.article-body .token.string,
.article-body .token.char,
.article-body .token.builtin,
.article-body .token.inserted { color: #7ee787; }

.article-body .token.operator,
.article-body .token.entity,
.article-body .token.url,
.article-body .token.atrule,
.article-body .token.attr-value,
.article-body .token.keyword { color: #ff7b72; }

.article-body .token.function { color: #d2a8ff; }

.article-body .token.regex,
.article-body .token.important,
.article-body .token.variable { color: #ffa657; }

.article-body .token.important,
.article-body .token.bold { font-weight: 700; }
.article-body .token.italic { font-style: italic; }

.article-body .token.entity { cursor: help; }

/* ===== 代码块一键复制（P5 收尾） ===== */
.article-body pre[class*="language-"] {
    position: relative;
}

.cr-code-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: none;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .07);
    color: #cfd3da;
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 12px;
    line-height: 1.6;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s ease, color .15s ease;
}

.article-body pre[class*="language-"]:hover .cr-code-copy {
    display: inline-flex;
}

.cr-code-copy:hover {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.cr-code-copy.copied {
    color: #7ee787;
    border-color: rgba(126, 231, 135, .45);
}

/* 触屏设备常显复制按钮，便于点击 */
@media (pointer: coarse) {
    .cr-code-copy {
        display: inline-flex;
    }
}
