/* ==========================================================
   文章访问统计与排行 v1.4 —— 缩略图网格样式
   v1.4 重点：
   - 图片 100% 宽度 + object-fit + decoding="async" 保证高清锐利
   - 支持 3:4 / 16:9 / 1:1 / auto 四种比例
   ========================================================== */

/* ---------- 容器 ---------- */
.pvc-thumb-grid {
	margin: 1em 0;
	--pvc-accent: #e74c3c;
}

/* 标题栏 */
.pvc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.pvc-title {
	margin: 0;
	font-size: 1.25em;
	font-weight: 700;
	position: relative;
	padding-left: 12px;
}

.pvc-title::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 4px;
	height: 1em;
	background: var(--pvc-accent);
	border-radius: 2px;
}

/* ---------- 网格 ---------- */
.pvc-grid {
	display: grid;
	gap: 18px;
	grid-template-columns: repeat(4, 1fr);
}

.pvc-cols-2 .pvc-grid { grid-template-columns: repeat(2, 1fr); }
.pvc-cols-3 .pvc-grid { grid-template-columns: repeat(3, 1fr); }
.pvc-cols-4 .pvc-grid { grid-template-columns: repeat(4, 1fr); }
.pvc-cols-5 .pvc-grid { grid-template-columns: repeat(5, 1fr); }
.pvc-cols-6 .pvc-grid { grid-template-columns: repeat(6, 1fr); gap: 12px; }

/* ---------- 卡片 ---------- */
.pvc-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
	transition: transform .25s ease, box-shadow .25s ease;
}

.pvc-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.pvc-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* ---------- 封面图 ---------- */
.pvc-card-figure {
	position: relative;
	width: 100%;
	background: #eef1f6;
	overflow: hidden;
}

/* padding-top 由内联样式按 ratio 设置，形成固定比例容器 */
.pvc-card-figure img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	/* v1.4：保证高清渲染 */
	object-fit: cover;
	object-position: center;
	image-rendering: auto;
	transform: translateZ(0); /* 触发 GPU 合成，避免缩放模糊 */
	transition: transform .4s ease;
}

.pvc-card:hover .pvc-card-figure img {
	transform: scale(1.06);
}

/* 阅读量角标（浮在图片右上角） */
.pvc-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	padding: 3px 9px;
	font-size: .72em;
	font-weight: 600;
	color: #fff;
	background: rgba(231, 76, 60, 0.92);
	border-radius: 20px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
	backdrop-filter: blur(2px);
}

/* 渐变遮罩（悬停氛围） */
.pvc-card-figure::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 30%;
	background: linear-gradient(to top, rgba(0,0,0,0.22), transparent);
	opacity: 0;
	transition: opacity .3s ease;
	pointer-events: none;
}
.pvc-card:hover .pvc-card-figure::after {
	opacity: 1;
}

/* 无特色图占位 */
.pvc-no-thumb {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	font-size: 2.5em;
	font-weight: 700;
}

/* ---------- 元信息区 ---------- */
.pvc-card-body {
	padding: 11px 13px 13px;
}

.pvc-cat {
	display: inline-block;
	font-size: .72em;
	color: var(--pvc-accent);
	background: rgba(231, 76, 60, 0.08);
	padding: 2px 8px;
	border-radius: 4px;
	margin-bottom: 6px;
	font-weight: 600;
}

.pvc-card-title {
	margin: 0 0 6px;
	font-size: .95em;
	line-height: 1.45;
	font-weight: 600;
	color: #222;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pvc-card-link:hover .pvc-card-title {
	color: var(--pvc-accent);
}

.pvc-date {
	display: block;
	font-size: .76em;
	color: #999;
	margin-bottom: 4px;
}

.pvc-excerpt {
	margin: 6px 0 0;
	font-size: .8em;
	line-height: 1.6;
	color: #777;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pvc-views-inline {
	display: block;
	margin-top: 8px;
	font-size: .78em;
	color: var(--pvc-accent);
	font-weight: 600;
}

/* ---------- 空状态 ---------- */
.pvc-empty {
	color: #999;
	font-size: .9em;
	grid-column: 1 / -1;
}

/* ---------- 传统文字列表（兼容） ---------- */
.pvc-popular-posts .pvc-title {
	padding-left: 12px;
}
.pvc-popular-posts .pvc-title::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 4px;
	height: 1em;
	background: var(--pvc-accent);
	border-radius: 2px;
}

.pvc-list {
	list-style: none;
	padding: 0;
	margin: 0;
	counter-reset: pvc-item;
}

.pvc-list li {
	position: relative;
	padding: 8px 0 8px 28px;
	border-bottom: 1px dashed #eee;
	counter-increment: pvc-item;
}

.pvc-list li::before {
	content: counter(pvc-item);
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	line-height: 20px;
	text-align: center;
	font-size: .75em;
	font-weight: 700;
	color: #fff;
	background: #d0d0d0;
	border-radius: 50%;
}

.pvc-list li:nth-child(1)::before { background: #e74c3c; }
.pvc-list li:nth-child(2)::before { background: #f39c12; }
.pvc-list li:nth-child(3)::before { background: #f1c40f; }

.pvc-list li:last-child {
	border-bottom: none;
}

.pvc-list a {
	text-decoration: none;
	color: #333;
	transition: color .2s;
}

.pvc-list li:hover a {
	color: var(--pvc-accent);
}

.pvc-list .pvc-views {
	color: #bbb;
	font-size: .82em;
	float: right;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
	.pvc-cols-5 .pvc-grid,
	.pvc-cols-6 .pvc-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 768px) {
	.pvc-grid,
	.pvc-cols-4 .pvc-grid,
	.pvc-cols-5 .pvc-grid,
	.pvc-cols-6 .pvc-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
	.pvc-card-title { font-size: .88em; }
	.pvc-excerpt { display: none; }
}

@media (max-width: 480px) {
	.pvc-cols-3 .pvc-grid { grid-template-columns: repeat(2, 1fr); }
	.pvc-card-body { padding: 8px 10px 10px; }
	.pvc-badge { font-size: .68em; padding: 2px 7px; }
	.pvc-date { display: none; }
}
