/* ---------- 1. 抹平粘贴带来的行内样式 ---------- */
.art-content :where(p, span, font, div, li, td, th, strong, b, em, i, u, a, h1, h2, h3, h4, h5, h6, blockquote) {
	font-family: inherit !important;
	background-color: transparent !important;
	line-height: inherit !important;
	letter-spacing: normal !important;
}
.art-content :where(span, font, strong, b, em, i, u) {
	font-size: inherit !important;
	color: inherit !important;
}
.art-content :where(p, li, td, th, div) {
	color: inherit !important;
	text-indent: 0 !important;
	text-align: inherit !important;
	margin-left: 0 !important;
}

/* ---------- 2. 基础 ---------- */
.art-content {
	font-size: 17px;
	line-height: 1.85;
	color: var(--k700);
	overflow-wrap: anywhere;
	text-align: left;
}
.art-content > :first-child {
	margin-top: 0 !important;
}
.art-content > :last-child {
	margin-bottom: 0 !important;
}
.art-content p,
.art-content ul,
.art-content ol,
.art-content table,
.art-content figure,
.art-content pre,
.art-content blockquote {
	margin: 0 0 1.25em;
}
.art-content strong,
.art-content b {
	font-weight: 600;
	color: var(--ink) !important;
}
.art-content em,
.art-content i {
	font-style: italic;
}
.art-content u {
	text-decoration: none;
}

/* ---------- 3. 标题 ---------- */
/* scroll-margin-top：锚点跳转时停在吸顶页头下方，不被挡住 */
.art-content :is(h1, h2, h3, h4, h5, h6) {
	scroll-margin-top: calc(var(--hdr-offset, 88px) + 20px);
	margin: 2em 0 0.75em;
	color: var(--ink) !important;
	font-weight: 700;
	line-height: 1.4 !important;
	letter-spacing: -0.01em !important;
	text-align: left !important;
	text-wrap: balance;
}
/* 标题里常被再包一层 <strong>，不要叠加字重 */
.art-content :is(h1, h2, h3, h4, h5, h6) :is(strong, b) {
	font-weight: inherit;
}
.art-content :is(h1, h2) {
	font-size: clamp(23px, 2.1vw, 27px) !important;
}
.art-content h3 {
	font-size: clamp(19px, 1.7vw, 21px) !important;
	margin-top: 1.7em;
}
.art-content :is(h4, h5, h6) {
	font-size: 17px !important;
	margin-top: 1.5em;
}
/* 标题紧跟标题时间距收小 */
.art-content :is(h1, h2, h3, h4) + :is(h2, h3, h4, h5) {
	margin-top: 0.6em;
}

/* ---------- 4. 链接 ---------- */
.art-content a {
	color: var(--o700) !important;
	text-decoration: underline;
	text-decoration-color: rgba(180, 83, 9, 0.35);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: text-decoration-color 0.2s;
}
.art-content a:hover {
	text-decoration-color: currentColor;
}
.art-content a :is(span, strong, u) {
	color: inherit !important;
}

/* ---------- 5. 列表 ---------- */
.art-content ul,
.art-content ol {
	padding-left: 1.5em;
}
.art-content li {
	padding-left: 0.2em;
}
.art-content li + li {
	margin-top: 0.45em;
}
.art-content li > :is(ul, ol) {
	margin: 0.45em 0 0;
}
.art-content ul > li::marker {
	color: var(--o500);
}
.art-content ol > li::marker {
	color: var(--k500);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.art-content li > p {
	margin: 0;
}

/* ---------- 6. 图片与媒体 ---------- */
/* 编辑器写死的 width / height 会把图片拉变形，统一按比例缩放 */
.art-content img {
	display: block;
	max-width: 100% !important;
	height: auto !important;
	margin: 1.6em auto;
	border-radius: 12px;
}
.art-content p > img:only-child {
	margin-block: 0.4em;
}
.art-content video,
.art-content iframe {
	display: block;
	max-width: 100%;
	margin: 1.6em 0;
	border: 0;
	border-radius: 12px;
}
.art-content iframe {
	width: 100%;
	aspect-ratio: 16/9;
	height: auto;
}
.art-content figure {
	margin-inline: 0;
}
.art-content figcaption {
	margin-top: 8px;
	font-size: 14px;
	color: var(--k500);
	text-align: center;
}

/* ---------- 7. 引用块：做成「小贴士」提示框 ---------- */
.art-content blockquote {
	position: relative;
	margin-inline: 0;
	padding: 18px 22px 18px 54px;
	border: 1px solid var(--o100);
	border-radius: 14px;
	background: var(--o50) !important;
	color: var(--k700);
	font-size: 15px;
	line-height: 1.75;
}
.art-content blockquote::before {
	content: '';
	position: absolute;
	left: 22px;
	top: 21px;
	width: 20px;
	height: 20px;
	background: var(--o500);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7c.6.5 1 1.2 1 2V17h6v-.3c0-.8.4-1.5 1-2A7 7 0 0 0 12 2z'/%3E%3C/svg%3E")
		center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7c.6.5 1 1.2 1 2V17h6v-.3c0-.8.4-1.5 1-2A7 7 0 0 0 12 2z'/%3E%3C/svg%3E")
		center / contain no-repeat;
}
.art-content blockquote > :last-child {
	margin-bottom: 0;
}
.art-content blockquote strong:first-child {
	color: var(--o700) !important;
}

/* ---------- 8. 表格 ---------- */
/* 表格外包一层横向滚动：窄屏下不撑破版面 */
.art-content table {
	display: block;
	width: 100% !important;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--k200);
	border-radius: 12px;
	font-size: 15px;
	line-height: 1.6;
}
.art-content table :is(th, td) {
	min-width: 120px;
	padding: 12px 16px;
	border: 0;
	border-bottom: 1px solid var(--k200);
	vertical-align: top;
	text-align: left !important;
	width: auto !important;
}
.art-content table :is(th, td) + :is(th, td) {
	border-left: 1px solid var(--k200);
}
.art-content table tr:last-child > :is(th, td) {
	border-bottom: 0;
}
.art-content table :is(thead th, thead td, tr:first-child > th) {
	background: var(--k50) !important;
	color: var(--ink) !important;
	font-weight: 600;
	white-space: nowrap;
}
.art-content table tbody tr:nth-child(even) > td {
	background: #fbfbfc !important;
}
.art-content table :is(td, th) p {
	margin: 0;
}

/* ---------- 9. 其它 ---------- */
.art-content hr {
	height: 1px;
	margin: 2.4em 0;
	border: 0;
	background: var(--k200);
}
.art-content code {
	padding: 0.15em 0.4em;
	border-radius: 6px;
	background: var(--k100) !important;
	font-size: 0.9em;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
}
.art-content pre {
	padding: 16px 20px;
	border-radius: 12px;
	background: var(--ink) !important;
	color: #e6e8eb;
	overflow-x: auto;
	font-size: 14px;
	line-height: 1.7;
}
.art-content pre code {
	padding: 0;
	background: none !important;
	color: inherit !important;
}

@media (max-width: 640px) {
	.art-content {
		font-size: 16px;
		line-height: 1.8;
	}
	.art-content blockquote {
		padding: 16px 18px 16px 48px;
	}
	.art-content blockquote::before {
		left: 18px;
		top: 19px;
	}
}
