/* MCPAI theme — 自研样式，桌面 + 平板 + 移动端 */

:root {
	--accent: #fb6c28;
	--accent-soft: rgba(251, 108, 40, 0.1);
	--bg: #f4f5f7;
	--card: #fff;
	--text: #1f2328;
	--text-2: #5b6570;
	--text-3: #98a1ab;
	--line: #e8eaed;
	--radius: 8px;
	--wrap: 1140px;
	--header-h: 60px;
	--font: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

body.drawer-open { overflow: hidden; }

img { max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 16px;
}

/* ---------- header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 60;
	background: #fff;
	border-bottom: 1px solid var(--line);
}

.header-inner {
	display: flex;
	align-items: center;
	height: var(--header-h);
	gap: 20px;
}

.logo {
	flex: none;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: var(--text);
}

.logo:hover { color: var(--accent); }

.nav { flex: 1; min-width: 0; }

.nav-list {
	display: flex;
	align-items: center;
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav-list li { margin: 0; }

.nav-list a {
	display: block;
	font-size: 14.5px;
	color: var(--text-2);
	white-space: nowrap;
	transition: color 0.15s;
}

.nav-list a:hover,
.nav-list .current-menu-item > a { color: var(--accent); }

.cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	padding: 9px 18px;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: 0 4px 12px rgba(251, 108, 40, 0.22);
	transition: opacity 0.15s;
}

.cta:hover { color: #fff; opacity: 0.88; }

.cta-block { display: flex; width: 100%; margin-top: 12px; }

.burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	margin-left: auto;
	padding: 0 8px;
	border: 0;
	background: none;
	cursor: pointer;
}

.burger span {
	display: block;
	height: 2px;
	border-radius: 2px;
	background: var(--text);
}

/* ---------- drawer ---------- */

.overlay {
	position: fixed;
	inset: 0;
	z-index: 70;
	background: rgba(15, 20, 25, 0.45);
}

.drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 80;
	display: flex;
	flex-direction: column;
	width: min(82vw, 320px);
	padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
	background: #fff;
	transform: translateX(102%);
	transition: transform 0.25s ease;
	overflow-y: auto;
}

.drawer.open { transform: translateX(0); }

.drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line);
}

.drawer-title { font-size: 16px; font-weight: 700; }

.drawer-close {
	width: 34px;
	height: 34px;
	border: 0;
	background: none;
	color: var(--text-3);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.drawer-list {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.drawer-list li { margin: 0; }

.drawer-list a {
	display: flex;
	align-items: center;
	min-height: 46px;
	border-bottom: 1px solid var(--line);
	font-size: 15.5px;
	color: var(--text);
}

.drawer-nav { flex: 1; }

/* ---------- layout ---------- */

.site-body { min-height: 40vh; }

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 260px;
	gap: 22px;
	padding-top: 22px;
	padding-bottom: 40px;
	align-items: start;
}

.layout-single { grid-template-columns: minmax(0, 1fr); }

.main-col { min-width: 0; }

.section-head {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 14px;
}

.section-title {
	position: relative;
	margin: 0;
	padding-left: 12px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
}

.section-title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 4px;
	bottom: 4px;
	width: 3px;
	border-radius: 2px;
	background: var(--accent);
}

.section-note { font-size: 12.5px; color: var(--text-3); }

.section-desc {
	margin-bottom: 14px;
	color: var(--text-2);
	font-size: 14px;
}

/* ---------- post list ---------- */

.post-list { display: flex; flex-direction: column; gap: 12px; }

.card {
	display: flex;
	gap: 16px;
	padding: 12px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
	border-color: #dfe3e8;
	box-shadow: 0 6px 18px rgba(16, 24, 40, 0.05);
}

.thumb {
	position: relative;
	flex: 0 0 216px;
	width: 216px;
	aspect-ratio: 16 / 10;
	border-radius: 6px;
	overflow: hidden;
	background: #eceff2;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumb-empty {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #eef1f4, #e2e6ea);
}

.card-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 2px 4px 2px 0;
}

.card-title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.5;
}

.card-title a { display: block; }

.card-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: auto;
	color: var(--text-2);
	font-size: 13.5px;
	line-height: 1.7;
}

.card-excerpt:hover { color: var(--text-2); }

.card-meta {
	margin-top: 10px;
	color: var(--text-3);
	font-size: 12.5px;
}

.card-meta .dot { margin: 0 6px; }

.empty { color: var(--text-3); }

/* ---------- pager ---------- */

.pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 22px;
}

.pager .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 6px;
	color: var(--text-2);
	font-size: 13.5px;
}

.pager .page-numbers.current {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.pager .page-numbers.dots { border: 0; background: none; }

/* ---------- aside ---------- */

.aside-card {
	margin-bottom: 14px;
	padding: 16px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.aside-card:last-child { margin-bottom: 0; }

.site-card-logo { font-size: 18px; font-weight: 700; }

.site-card-desc {
	margin: 6px 0 0;
	color: var(--text-3);
	font-size: 13px;
}

.aside-title {
	margin: 0 0 10px;
	padding-left: 9px;
	border-left: 3px solid var(--accent);
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.3;
}

.aside-cats,
.aside-posts {
	margin: 0;
	padding: 0;
	list-style: none;
}

.aside-cats li,
.aside-posts li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 0;
	border-bottom: 1px dashed var(--line);
	font-size: 14px;
}

.aside-cats li:last-child,
.aside-posts li:last-child { border-bottom: 0; }

.aside-cats .count { color: var(--text-3); font-size: 12.5px; }

.aside-posts li {
	display: block;
	line-height: 1.55;
	color: var(--text-2);
}

/* ---------- article ---------- */

.crumb {
	margin-bottom: 10px;
	color: var(--text-3);
	font-size: 13px;
}

.crumb a { color: var(--text-3); }
.crumb span { margin: 0 6px; }

.article {
	padding: 30px 34px 34px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.chip {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 12.5px;
}

.entry-title {
	margin: 0 0 12px;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.45;
	letter-spacing: 0.2px;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--line);
	color: var(--text-3);
	font-size: 13px;
}

.entry-meta .dot { margin: 0 8px; }

.entry-cover {
	margin: 20px 0 0;
}

.entry-cover img {
	display: block;
	width: 100%;
	border-radius: 6px;
}

.content {
	font-size: 17px;
	line-height: 1.95;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.content > *:first-child { margin-top: 18px; }

.content p { margin: 0 0 16px; }

.content h2,
.content h3,
.content h4 {
	margin: 34px 0 14px;
	font-weight: 700;
	line-height: 1.5;
	scroll-margin-top: calc(var(--header-h) + 12px);
}

.content h2 { font-size: 21px; }
.content h3 { font-size: 18px; }
.content h4 { font-size: 16.5px; }

.content img { border-radius: 6px; }

.content ul,
.content ol { margin: 0 0 16px; padding-left: 22px; }

.content li { margin-bottom: 6px; }

.content blockquote {
	margin: 20px 0;
	padding: 12px 16px;
	border-left: 3px solid var(--accent);
	border-radius: 0 6px 6px 0;
	background: #fafafa;
	color: var(--text-2);
}

.content hr {
	height: 1px;
	margin: 26px 0;
	border: 0;
	background: var(--line);
}

.content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.content table { width: 100%; border-collapse: collapse; font-size: 14.5px; }

.content th,
.content td { padding: 8px 10px; border: 1px solid var(--line); }

.content code {
	padding: 2px 5px;
	border-radius: 4px;
	background: #f2f4f6;
	font-size: 0.92em;
}

.content pre {
	overflow-x: auto;
	padding: 14px 16px;
	border-radius: 6px;
	background: #f6f7f9;
}

.content pre code { padding: 0; background: none; }

.post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 14px;
}

.post-nav-item {
	padding: 14px 16px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.post-nav-item.next { text-align: right; }

.post-nav-label {
	display: block;
	margin-bottom: 4px;
	color: var(--text-3);
	font-size: 12.5px;
}

.post-nav-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14.5px;
}

.notfound p { color: var(--text-2); }

/* ---------- footer ---------- */

.site-footer {
	padding: 20px 0 30px;
	color: var(--text-3);
	font-size: 12.5px;
	text-align: center;
}

.site-footer p { margin: 0; }

.mobile-cta { display: none; }

/* ---------- tablet ---------- */

@media (max-width: 1080px) {
	.layout { grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; }
	.thumb { flex-basis: 190px; width: 190px; }
	.nav-list { gap: 16px; }
	.article { padding: 26px 24px 30px; }
}

/* ---------- mobile ---------- */

@media (max-width: 860px) {
	:root { --header-h: 56px; }

	.wrap { padding: 0 14px; }

	.nav,
	.header-inner > .cta { display: none; }

	.burger { display: flex; }

	.layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
		padding-top: 14px;
		padding-bottom: 24px;
	}

	.aside { display: none; }

	.section-head { margin-bottom: 10px; }
	.section-title { font-size: 16.5px; }
	.section-note { font-size: 12px; }

	.post-list { gap: 10px; }

	.card {
		flex-direction: column;
		gap: 0;
		padding: 0;
		overflow: hidden;
	}

	.thumb {
		width: 100%;
		flex: none;
		aspect-ratio: 16 / 9;
		border-radius: 0;
	}

	.card-body { padding: 12px 14px 14px; }

	.card-title { font-size: 16.5px; line-height: 1.5; margin-bottom: 6px; }

	.card-title a {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.card-excerpt { font-size: 13px; -webkit-line-clamp: 2; }
	.card-meta { margin-top: 8px; font-size: 12px; }

	.pager { gap: 8px; margin-top: 18px; }
	.pager .page-numbers { min-width: 40px; height: 40px; font-size: 14px; }

	.crumb { margin-bottom: 8px; font-size: 12.5px; }

	.article {
		padding: 18px 16px 22px;
		border-radius: var(--radius);
	}

	.chips { margin-bottom: 10px; gap: 6px; }
	.chip { font-size: 12px; padding: 3px 9px; }

	.entry-title { font-size: 21px; line-height: 1.45; margin-bottom: 10px; }

	.entry-meta {
		padding-bottom: 14px;
		font-size: 12.5px;
	}

	.entry-meta .dot { margin: 0 6px; }

	.entry-cover { margin-top: 16px; }

	.content {
		font-size: 16.5px;
		line-height: 1.9;
	}

	.content p { margin-bottom: 15px; }
	.content h2 { font-size: 19px; margin: 28px 0 12px; }
	.content h3 { font-size: 17px; margin: 26px 0 10px; }
	.content img { width: 100%; height: auto; }
	.content ul,
	.content ol { padding-left: 20px; }

	.content table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.post-nav { grid-template-columns: 1fr; gap: 10px; }
	.post-nav-item.next { text-align: left; }

	.site-footer { padding: 18px 0 84px; }

	.mobile-cta {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 55;
		display: block;
		padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
		background: rgba(255, 255, 255, 0.96);
		border-top: 1px solid var(--line);
		backdrop-filter: blur(8px);
	}

	.mobile-cta a {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 46px;
		border-radius: 999px;
		background: var(--accent);
		color: #fff;
		font-size: 15px;
		font-weight: 600;
		box-shadow: 0 6px 16px rgba(251, 108, 40, 0.28);
	}

	.mobile-cta a:hover { color: #fff; }
}

@media (max-width: 380px) {
	.logo { font-size: 18px; }
	.entry-title { font-size: 19.5px; }
	.content { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
