/* ==========================================================
   文章访问统计与排行 v1.5 —— 样式
   v1.5 重点：
   - 深色半透明圆角 Tab 导航栏（24小时/总榜/日榜/周榜/月榜）
   - 亮粉色高亮选中态 + 图标
   - 缩略图高清渲染
   ========================================================== */

/* ---------- 容器 ---------- */
.pvc-thumb-grid {
	margin: 1em 0;
	--pvc-accent: #e74c3c;
	/* v1.5：Tab 高亮色 */
	--pvc-tab-active: #ff3b8b;
}

/* 标题栏 */
.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;
}

/* ==========================================================
   v1.5 —— Tabs 导航（深色半透明圆角胶囊）
   ========================================================== */
.pvc-tabs {
	margin: 1em 0;
}

.pvc-tab-nav {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px;
	background: rgba(18, 22, 38, 0.72);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 999px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.pvc-tab-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 20px;
	border: none;
	background: transparent;
	color: #c9cdd8;
	font-size: 0.92em;
	font-weight: 600;
	cursor: pointer;
	border-radius: 999px;
	transition: background .25s ease, color .25s ease, box-shadow .25s ease, transform .15s ease;
	font-family: inherit;
	white-space: nowrap;
}

.pvc-tab-btn:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.pvc-tab-btn:active {
	transform: scale(0.96);
}

.pvc-tab-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	line-height: 1;
	font-size: 1em;
}

/* 选中态：亮粉色高亮 */
.pvc-tab-btn.is-active {
	color: #fff;
	background: linear-gradient(135deg, #ff3b8b 0%, #ff6b6b 100%);
	box-shadow: 0 4px 14px rgba(255, 59, 139, 0.45);
}

.pvc-tab-btn.is-active .pvc-tab-icon {
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.pvc-tab-btn.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

/* 面板 */
.pvc-tab-panel {
	display: none;
}

.pvc-tab-panel.is-active {
	display: block;
	animation: pvcFadeIn .3s ease;
}

@keyframes pvcFadeIn {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* 加载占位动画 */
.pvc-tab-placeholder {
	min-height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pvc-loading {
	display: inline-flex;
	gap: 6px;
}

.pvc-loading span {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--pvc-accent);
	opacity: 0.4;
	animation: pvcBounce 1.2s infinite ease-in-out;
}

.pvc-loading span:nth-child(2) { animation-delay: 0.15s; }
.pvc-loading span:nth-child(3) { animation-delay: 0.3s; }

@keyframes pvcBounce {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
	40% { transform: scale(1); opacity: 1; }
}

/* ---------- 网格 ---------- */
.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;
}

.pvc-card-figure img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	image-rendering: auto;
	transform: translateZ(0);
	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;
	text-align: center;
	padding: 20px;
}

/* ---------- 传统文字列表 ---------- */
.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-tab-nav {
		width: 100%;
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
	}
	.pvc-tab-btn {
		flex: 0 0 auto;
		padding: 8px 14px;
		font-size: .85em;
	}
	.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; }
}
