/**
 * 产品/课程网格（Product Grid）
 * 对应 meizhuan/courses.html 列表页
 */

.gt-pg {
	width: 100%;
	box-sizing: border-box;
}

.gt-pg-serif {
	font-family: 'Noto Serif SC', serif;
}

/* ---------- 分类筛选条 ---------- */
.gt-pg-filter {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem 2rem;
	font-size: 0.875rem;
	color: #6b7280;
	letter-spacing: 0.15em;
	margin: 0 0 2.5rem;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.gt-pg-filter {
		gap: 1rem 2.5rem;
		margin-bottom: 4rem;
	}
}

/* 手机端筛选条：横向滚动 */
@media (max-width: 767.98px) {
	.gt-pg-filter {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		overflow-y: hidden;
		gap: 1.5rem;
		padding: 0 1rem 0.5rem;
		margin: 0 -1rem 2rem;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.gt-pg-filter::-webkit-scrollbar {
		display: none;
	}

	.gt-pg-filter a {
		flex: 0 0 auto;
		white-space: nowrap;
	}
}

.gt-pg-filter a {
	color: #6b7280;
	text-decoration: none;
	padding-bottom: 0.25rem;
	border-bottom: 1px solid transparent;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.gt-pg-filter a:hover {
	color: #000;
}

.gt-pg-filter a.is-active {
	color: #000;
	font-weight: 500;
	border-bottom-color: #000;
}

/* ---------- 网格 ---------- */
.gt-pg-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem 1.5rem;
}

/* 手机端：横向滚动卡片（<768px） */
@media (max-width: 767.98px) {
	.gt-pg-grid {
		display: flex;
		grid-template-columns: none;
		gap: 1rem;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scroll-padding-left: 1rem;
		/* 内边距让两端卡片不贴边 */
		padding: 0 1rem 0.5rem;
		margin: 0 -1rem; /* 抵消外层容器内边距，让滚动到屏幕边缘 */
		scrollbar-width: none; /* Firefox */
	}

	.gt-pg-grid::-webkit-scrollbar {
		display: none; /* Chrome / Safari */
	}

	.gt-pg-grid > .gt-pg-item {
		flex: 0 0 78%;
		max-width: 320px;
		min-width: 240px;
		scroll-snap-align: start;
	}
}

@media (min-width: 768px) {
	.gt-pg-grid.cols-md-2 { grid-template-columns: repeat(2, 1fr); }
	.gt-pg-grid.cols-md-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
	.gt-pg-grid.cols-lg-2 { grid-template-columns: repeat(2, 1fr); }
	.gt-pg-grid.cols-lg-3 { grid-template-columns: repeat(3, 1fr); }
	.gt-pg-grid.cols-lg-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
	.gt-pg-grid {
		gap: 4rem 2rem;
	}
}

/* ---------- 卡片 ---------- */
.gt-pg-item {
	display: block;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}

.gt-pg-img {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #f3f4f6;
	overflow: hidden;
	margin-bottom: 1.5rem;
	display: block;
}

.gt-pg .gt-pg-img > img {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	display: block;
	transition: transform 0.7s ease;
}

.gt-pg-item:hover .gt-pg-img > img {
	transform: scale(1.05);
}

.gt-pg-badge {
	position: absolute;
	top: 1rem;
	left: 1rem;
	background: #000;
	color: #fff;
	font-size: 10px;
	line-height: 1;
	padding: 0.35rem 0.75rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	z-index: 10;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	white-space: nowrap;
}

/* ---------- 卡片文字 ---------- */
.gt-pg-body {
	padding-bottom: 1rem;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease;
}

.gt-pg-item:hover .gt-pg-body {
	border-bottom-color: #e5e7eb;
}

.gt-pg-meta {
	font-size: 10px;
	color: #9ca3af;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	margin: 0 0 0.75rem;
	line-height: 1.4;
}

.gt-pg-title {
	font-family: 'Noto Serif SC', serif;
	font-size: 1.125rem;
	line-height: 1.4;
	color: #000;
	letter-spacing: 0.1em;
	margin: 0 0 0.75rem;
	font-weight: 500;
	transition: color 0.2s ease;
	word-break: break-word;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (min-width: 768px) {
	.gt-pg-title {
		font-size: 1.25rem;
		letter-spacing: 0.12em;
	}
}

.gt-pg-item:hover .gt-pg-title {
	color: #4b5563;
}

.gt-pg-desc {
	color: #6b7280;
	font-size: 0.875rem;
	line-height: 1.65;
	letter-spacing: 0.025em;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
}

/* ---------- 分页（与博客网格统一的方框样式） ---------- */
.gt-pg-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	margin-top: 3rem;
	flex-wrap: wrap;
}

@media (min-width: 768px) {
	.gt-pg-pagination {
		margin-top: 4rem;
	}
}

.gt-pg-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.75rem;
	color: #6b7280;
	font-size: 0.875rem;
	letter-spacing: 0.1em;
	text-decoration: none;
	border: 1px solid #e5e7eb;
	transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.gt-pg-pagination .page-numbers.current {
	background: #000;
	color: #fff;
	border-color: #000;
}

.gt-pg-pagination a.page-numbers:hover {
	color: #000;
	border-color: #000;
}

/* ---------- 空状态 ---------- */
.gt-pg-empty {
	text-align: center;
	color: #9ca3af;
	padding: 3rem 0;
	font-size: 0.875rem;
	letter-spacing: 0.1em;
}
