/*!
 * XT Post Cards — 52xt 风格文章卡片
 * 金色描边封面 / VIP 胶囊角标 / 推荐飘带 / 紫环分类 / 价格・VIP 章
 * 所有规则均以 .xtpc- 前缀命名，避免与主题样式冲突。
 */

.xtpc-wrap {
	--xtpc-gold-1: #ffe96b;
	--xtpc-gold-2: #ffc800;
	--xtpc-gold-3: #f5ae00;
	--xtpc-pink: #f70083;
	--xtpc-ink: #17181c;
	--xtpc-muted: #9aa0a8;
	--xtpc-cat: #6b7280;
	--xtpc-ring: #4b3ac7;
	--xtpc-radius: 14px;
	--xtpc-gap: 20px;
	--xtpc-ratio: 16/10;

	box-sizing: border-box;
	color: var(--xtpc-ink);
	font-family: inherit;
	text-align: left;
}

.xtpc-wrap *,
.xtpc-wrap *::before,
.xtpc-wrap *::after {
	box-sizing: border-box;
}

.xtpc-wrap img {
	max-width: 100%;
}

/* ---------- 栅格 ---------- */

.xtpc-grid {
	display: grid;
	gap: var(--xtpc-gap);
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: stretch;
	margin: 0;
	padding: 0;
	list-style: none;
}

.xtpc-cols-1 .xtpc-grid { grid-template-columns: minmax(0, 1fr); }
.xtpc-cols-2 .xtpc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xtpc-cols-4 .xtpc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 卡片 ---------- */

.xtpc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #eef0f4;
	border-radius: var(--xtpc-radius);
	padding: 6px;
	box-shadow:
		0 1px 2px rgba(16, 24, 40, 0.04),
		0 10px 24px -12px rgba(16, 24, 40, 0.18);
	transition:
		transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
		box-shadow 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.xtpc-card:hover {
	transform: translateY(-4px);
	box-shadow:
		0 2px 4px rgba(16, 24, 40, 0.06),
		0 18px 34px -16px rgba(16, 24, 40, 0.26);
}

/* ---------- 封面（金色描边） ---------- */

.xtpc-thumb {
	position: relative;
	border-radius: 11px;
	padding: 3px;
	background: linear-gradient(150deg, var(--xtpc-gold-1) 0%, var(--xtpc-gold-2) 48%, var(--xtpc-gold-3) 100%);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.xtpc-style-plain .xtpc-thumb {
	padding: 0;
	background: none;
	box-shadow: none;
}

.xtpc-thumb .xtpc-link {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 8px;
	aspect-ratio: var(--xtpc-ratio, 16/10);
	background: #f1f3f5;
	line-height: 0;
}

.xtpc-style-plain .xtpc-thumb .xtpc-link {
	border-radius: 9px;
}

.xtpc-thumb .xtpc-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	border-radius: 0;
	transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.xtpc-card:hover .xtpc-thumb .xtpc-img {
	transform: scale(1.045);
}

.xtpc-noimg {
	display: block;
	width: 100%;
	height: 100%;
	background:
		radial-gradient(120% 90% at 15% 10%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 55%),
		linear-gradient(135deg, #eef1f6 0%, #dfe4ec 60%, #cdd5e2 100%);
}

/* ---------- 左上 VIP 胶囊 ---------- */

.xtpc-flag-vip {
	position: absolute;
	z-index: 6;
	top: 10px;
	left: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 21px;
	padding: 0 9px;
	border-radius: 999px;
	background: linear-gradient(135deg, #ffd75e 0%, #f2ab20 46%, #d1850f 100%);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	font-style: italic;
	letter-spacing: 0.5px;
	line-height: 1;
	text-shadow: 0 1px 2px rgba(122, 78, 6, 0.5);
	box-shadow:
		0 2px 8px rgba(160, 110, 10, 0.35),
		inset 0 0 0 1px rgba(255, 255, 255, 0.5);
	pointer-events: none;
}

/* ---------- 右上「推荐」飘带 ---------- */

.xtpc-flag-rec {
	position: absolute;
	z-index: 7;
	top: -7px;
	right: 3px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 21px;
	padding: 0 9px;
	border-radius: 4px;
	background: linear-gradient(90deg, #ff3d9a 0%, var(--xtpc-pink) 100%);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.5px;
	line-height: 1;
	box-shadow: 0 2px 8px rgba(247, 0, 131, 0.35);
	pointer-events: none;
}

/* ---------- 底部右下：价格章 ---------- */

.xtpc-chip-price {
	display: inline-flex;
	align-items: baseline;
	gap: 1px;
	padding: 1px 8px;
	border-radius: 4px;
	background: linear-gradient(90deg, #4f8bff 0%, #2563eb 100%);
	color: #fff !important;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.3px;
	line-height: 18px;
	text-shadow: 0 1px 2px rgba(18, 55, 140, 0.35);
	box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35);
	white-space: nowrap;
}

.xtpc-chip-price i {
	font-style: normal;
	font-size: 10px;
	opacity: 0.95;
}

/* ---------- 文案区 ---------- */

.xtpc-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 2px 4px 10px;
}

.xtpc-cat {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 10px 2px 7px;
	color: var(--xtpc-cat);
	font-size: 13px;
	line-height: 1;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.xtpc-cat a {
	color: var(--xtpc-cat) !important;
	text-decoration: none !important;
	transition: color 0.2s ease;
}

.xtpc-cat a:hover {
	color: var(--xtpc-ink) !important;
}

.xtpc-cat-sep {
	margin: 0 4px;
	opacity: 0.55;
}

.xtpc-dot {
	display: inline-block;
	flex: 0 0 auto;
	width: 11px;
	height: 11px;
	border: 3px solid var(--xtpc-ring);
	border-radius: 50%;
	background: transparent;
}

.xtpc-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	min-height: 3em;
	margin: 0 2px 10px;
	color: var(--xtpc-ink);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.55;
	letter-spacing: 0.1px;
	word-break: break-word;
}

.xtpc-title a {
	color: var(--xtpc-ink) !important;
	text-decoration: none !important;
	transition: color 0.2s ease;
}

.xtpc-title a:hover {
	color: #0b63d6 !important;
}

.xtpc-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: auto 2px 0;
	padding-top: 2px;
	color: var(--xtpc-muted);
	font-size: 12.5px;
	line-height: 1.2;
}

.xtpc-time {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

.xtpc-ico {
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
	opacity: 0.85;
}

.xtpc-meta-right {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.xtpc-price {
	display: inline-flex;
	align-items: center;
	gap: 1px;
	color: #ff5a1f;
	font-size: 13.5px;
	font-weight: 700;
	white-space: nowrap;
}

.xtpc-price .xtpc-cur {
	font-size: 12px;
	font-weight: 700;
	opacity: 0.92;
}

.xtpc-chip-vip {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 4px;
	background: linear-gradient(90deg, #f7ce5b 0%, #d9a32e 100%);
	color: #fff;
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: 0.4px;
	line-height: 18px;
	box-shadow: 0 1px 3px rgba(190, 140, 40, 0.35);
}

/* ---------- 标题栏 ---------- */

.xtpc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 16px;
}

.xtpc-head-title {
	margin: 0;
	color: #111318;
	font-size: 22px;
	font-weight: 800;
	line-height: 1.3;
}

/* ---------- 空状态 ---------- */

.xtpc-empty {
	padding: 18px 20px;
	border: 1px dashed #d8dde6;
	border-radius: 10px;
	background: #fafbfc;
	color: #8792a2;
	font-size: 13px;
	line-height: 1.7;
}

.xtpc-empty code {
	padding: 1px 5px;
	border-radius: 3px;
	background: #eef1f6;
	color: #4b5563;
	font-size: 12px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1024px) {
	.xtpc-cols-4 .xtpc-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.xtpc-wrap {
		--xtpc-gap: 16px;
	}

	.xtpc-cols-3 .xtpc-grid,
	.xtpc-cols-4 .xtpc-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.xtpc-title {
		font-size: 16px;
	}
}

@media (max-width: 560px) {
	.xtpc-wrap {
		--xtpc-gap: 14px;
	}

	.xtpc-cols-2 .xtpc-grid,
	.xtpc-cols-3 .xtpc-grid,
	.xtpc-cols-4 .xtpc-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.xtpc-cols-1 .xtpc-card .xtpc-link {
		aspect-ratio: 16/9;
	}

	.xtpc-title {
		font-size: 16px;
		min-height: 3em;
	}

	.xtpc-flag-vip {
		top: 9px;
		left: 9px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.xtpc-card,
	.xtpc-thumb .xtpc-img {
		transition: none;
	}

	.xtpc-card:hover {
		transform: none;
	}
}

/* ============================================================
   主题隔离层
   短代码常被放进页面正文，主题的 .entry-content h3 / a 等规则
   会污染卡片排版（标题变蓝、上下间距变大）。这里统一提权覆盖。
   ============================================================ */

.xtpc-wrap .xtpc-title {
	display: -webkit-box !important;
	-webkit-box-orient: vertical !important;
	-webkit-line-clamp: 2 !important;
	overflow: hidden !important;
	min-height: 3em !important;
	max-height: none !important;
	margin: 0 2px 10px !important;
	padding: 0 !important;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	color: var(--xtpc-ink) !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	line-height: 1.55 !important;
	letter-spacing: 0.1px !important;
	text-align: left !important;
	text-transform: none !important;
}

.xtpc-wrap .xtpc-title::before,
.xtpc-wrap .xtpc-title::after {
	content: none !important;
	display: none !important;
}

.xtpc-wrap .xtpc-title a {
	display: inline !important;
	margin: 0 !important;
	padding: 0 !important;
	background: none !important;
	border: 0 !important;
	color: var(--xtpc-ink) !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	line-height: inherit !important;
	text-decoration: none !important;
}

.xtpc-wrap .xtpc-title a:hover {
	color: #0b63d6 !important;
}

.xtpc-wrap .xtpc-cat {
	display: flex !important;
	align-items: center !important;
	gap: 7px !important;
	margin: 10px 2px 8px !important;
	padding: 0 !important;
	color: #6b7280 !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	text-align: left !important;
}

.xtpc-wrap .xtpc-cat a {
	color: #6b7280 !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	text-decoration: none !important;
	background: none !important;
}

.xtpc-wrap .xtpc-cat a:hover {
	color: var(--xtpc-ink) !important;
}

.xtpc-wrap .xtpc-time {
	color: #9aa0a8 !important;
	font-size: 12.5px !important;
	text-decoration: none !important;
}

.xtpc-wrap .xtpc-time span {
	color: inherit !important;
	font-size: inherit !important;
}

.xtpc-wrap .xtpc-chip-vip,
.xtpc-wrap .xtpc-chip-price,
.xtpc-wrap .xtpc-price {
	text-decoration: none !important;
}

.xtpc-wrap .xtpc-chip-price {
	font-size: 12px !important;
	font-weight: 800 !important;
	line-height: 18px !important;
	color: #fff !important;
}

.xtpc-wrap .xtpc-flag-vip,
.xtpc-wrap .xtpc-flag-rec {
	text-indent: 0 !important;
	text-shadow: 0 1px 2px rgba(122, 78, 6, 0.55);
}
