/**
 * 推广商品模块样式
 */

.io-promo-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px 15px 40px;
}

.io-promo-page-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 20px;
}

/* ---------------- 筛选栏（平台分类 + 排序） ---------------- */

/* 主体视觉复用父主题 .taxonomy-selects.card.selects-box / .cat-select / .list-select，
   此处只做推广页的间距与兜底处理 */

.io-promo-filter {
	margin: 0 0 20px;
	padding: 14px 16px;
}

.io-promo-filter a.cat-select,
.io-promo-filter a.list-select {
	text-decoration: none;
	white-space: nowrap;
}

.io-promo-filter .cat-selects {
	padding-bottom: 10px;
	margin-bottom: 10px;
	border-bottom: 1px solid rgba(0, 0, 0, .05);
}

/* 子分类行（.cat-selects-sub 内）也是 .cat-selects，但不参与首行的分隔线样式：
   否则灰色子分类条内部会多出一段内边距和一条多余的底线 */
.io-promo-filter .cat-selects-sub .cat-selects {
	padding-bottom: 0;
	border-bottom: 0;
}

.io-promo-filter .list-select-title {
	flex: none;
}

/* 暗色模式兜底（父主题若未覆盖以下类则生效） */

.dark-skin .io-promo-filter,
body.dark-skin .io-promo-filter {
	background: #22252b;
	color: #e5e7eb;
}

.dark-skin .io-promo-filter .cat-selects,
body.dark-skin .io-promo-filter .cat-selects {
	border-bottom-color: rgba(255, 255, 255, .08);
}

/* ---------------- 网格 ---------------- */

.io-promo-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
}

@media (max-width: 1024px) {
	.io-promo-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.io-promo-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
}

@media (max-width: 480px) {
	.io-promo-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------------- 卡片 ---------------- */

.io-promo-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.05);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: transform .25s ease, box-shadow .25s ease;
	display: flex;
	flex-direction: column;
}

.io-promo-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

/* 封面 */

.io-promo-cover {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f3f5f9;
}

.io-promo-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease;
	display: block;
}

.io-promo-card:hover .io-promo-cover img {
	transform: scale(1.04);
}

.io-promo-cover-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #b9c0cc;
	font-size: 14px;
}

.io-promo-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 3px 10px;
	border-radius: 6px;
	font-size: 12px;
	line-height: 1.4;
	color: #fff;
	background: linear-gradient(135deg, #ff6034, #ff3d3d);
	box-shadow: 0 2px 6px rgba(255, 61, 61, .35);
	pointer-events: none;
}

/* 置顶 / 站长推荐 / 平台分类 统一收纳到左上角的标签组，横向排列可换行 */
.io-promo-badges {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 6px;
	max-width: calc(100% - 20px);
	pointer-events: none;
}

/* 标签组内的徽章取消独立绝对定位，随容器流式排列 */
.io-promo-badges .io-promo-badge {
	position: static;
}

.io-promo-badge-recommend {
	position: static;
	background: linear-gradient(135deg, #4a90ff, #2b6de8);
	box-shadow: 0 2px 6px rgba(43, 109, 232, .35);
}

.io-promo-badge-sticky {
	position: static;
	background: linear-gradient(135deg, #ffb020, #ff8a00);
	box-shadow: 0 2px 6px rgba(255, 138, 0, .35);
}

/* 内容 */

.io-promo-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 12px 14px 14px;
}

.io-promo-title {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
}

.io-promo-title a {
	color: #1f2329;
	text-decoration: none;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.io-promo-title a:hover {
	color: #2b6de8;
}

/* 标签 */

.io-promo-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
	margin-top: auto;
}

.io-promo-tag {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 5px;
	font-size: 12px;
	line-height: 1.6;
	text-decoration: none;
	background: #f2f4f7;
	color: #646a73;
}

.io-promo-tag-platform {
	background: #e8f1ff;
	color: #2b6de8;
}

.io-promo-tag-platform:hover {
	background: #d7e7ff;
}

/* 底部 */

.io-promo-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.io-promo-price {
	display: flex;
	align-items: baseline;
	gap: 6px;
	min-width: 0;
	overflow: hidden;
}

.io-promo-price-now {
	color: #ff3d3d;
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
}

.io-promo-price-free {
	color: #ff8a00;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.io-promo-price-old {
	color: #a7aaad;
	font-size: 12px;
	white-space: nowrap;
}

.io-promo-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
}

.io-promo-buy,
.io-promo-qr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px 14px;
	border-radius: 999px;
	font-size: 13px;
	line-height: 1.6;
	cursor: pointer;
	text-decoration: none;
	transition: opacity .2s ease, background .2s ease;
}

.io-promo-buy {
	color: #fff;
	background: linear-gradient(135deg, #3d8bff, #2b6de8);
	border: none;
}

.io-promo-buy:hover {
	opacity: .88;
	color: #fff;
	text-decoration: none;
}

.io-promo-qr-btn {
	color: #2b6de8;
	background: #e8f1ff;
	border: none;
}

.io-promo-qr-btn:hover {
	background: #d7e7ff;
}

/* ---------------- 骨架占位（AJAX 切换时，仅商品卡片区域） ---------------- */
/* 与 .io-promo-card 各区域一一对应：封面 4:3、标题两行、价格+按钮 */

.io-promo-card-skel {
	pointer-events: none;
	user-select: none;
}

.io-promo-skel {
	position: relative;
	overflow: hidden;
	background: #eef0f4;
	border-radius: 6px;
}

.io-promo-skel::after {
	content: '';
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .65) 50%, rgba(255, 255, 255, 0) 100%);
	animation: ioPromoSkeleton 1.2s ease-in-out infinite;
}

@keyframes ioPromoSkeleton {
	100% {
		transform: translateX(100%);
	}
}

.io-promo-skel-cover {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 0;
}

.io-promo-skel-line {
	height: 14px;
	margin-bottom: 10px;
}

.io-promo-skel-w70 { width: 70%; }
.io-promo-skel-w45 { width: 45%; }

.io-promo-skel-price {
	width: 64px;
	height: 18px;
}

.io-promo-skel-btn {
	width: 72px;
	height: 28px;
	border-radius: 999px;
}

/* 暗色模式 */
.dark-skin .io-promo-skel,
body.dark-skin .io-promo-skel {
	background: rgba(255, 255, 255, .08);
}

.dark-skin .io-promo-skel::after,
body.dark-skin .io-promo-skel::after {
	background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .12) 50%, rgba(255, 255, 255, 0) 100%);
}

/* ---------------- 空状态 / 分页 ---------------- */

.io-promo-empty {
	padding: 60px 0;
	text-align: center;
	color: #8a9099;
	font-size: 15px;
}

.io-promo-pagination {
	margin-top: 24px;
	text-align: center;
}

.io-promo-pagination ul,
.io-promo-pagination .page-numbers {
	list-style: none;
	margin: 0;
	padding: 0;
}

.io-promo-pagination .page-numbers {
	display: inline-block;
	min-width: 34px;
	height: 34px;
	line-height: 32px;
	padding: 0 8px;
	margin: 0 3px;
	border: 1px solid #e5e8ee;
	border-radius: 6px;
	color: #4e5969;
	text-decoration: none;
	background: #fff;
}

.io-promo-pagination .page-numbers.current {
	color: #fff;
	background: #2b6de8;
	border-color: #2b6de8;
}

.io-promo-pagination .page-numbers:hover:not(.current) {
	color: #2b6de8;
	border-color: #2b6de8;
}

/* ---------------- 二维码弹窗 ---------------- */

.io-promo-modal-mask {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .55);
	padding: 20px;
}

.io-promo-modal-mask.is-open {
	display: flex;
}

.io-promo-modal {
	position: relative;
	width: 320px;
	max-width: 100%;
	background: #fff;
	border-radius: 14px;
	padding: 22px 20px 20px;
	text-align: center;
}

.io-promo-modal-close {
	position: absolute;
	top: 8px;
	right: 10px;
	border: none;
	background: none;
	font-size: 22px;
	line-height: 1;
	color: #a7aaad;
	cursor: pointer;
}

.io-promo-modal-close:hover {
	color: #4e5969;
}

.io-promo-modal-title {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 600;
	color: #1f2329;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.io-promo-modal-qrcode {
	width: 200px;
	height: 200px;
	margin: 0 auto 12px;
	border-radius: 10px;
	border: 1px solid #eef0f3;
	overflow: hidden;
}

.io-promo-modal-qrcode img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.io-promo-modal-link {
	margin-bottom: 14px;
	font-size: 12px;
	color: #8a9099;
	word-break: break-all;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.io-promo-modal-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
}

.io-promo-modal-actions button {
	flex: 1;
	padding: 8px 0;
	border-radius: 999px;
	font-size: 13px;
	cursor: pointer;
	border: 1px solid #dcdfe6;
	background: #f5f6f8;
	color: #4e5969;
}

.io-promo-modal-actions .io-promo-modal-go {
	border: none;
	color: #fff;
	background: linear-gradient(135deg, #3d8bff, #2b6de8);
}

/* 暗色模式简单适配（跟随父主题 .dark-skin） */

.dark-skin .io-promo-card,
body.dark-skin .io-promo-card {
	background: #22252b;
	border-color: rgba(255, 255, 255, .08);
}

.dark-skin .io-promo-title a,
body.dark-skin .io-promo-title a {
	color: #e5e7eb;
}

.dark-skin .io-promo-tag,
body.dark-skin .io-promo-tag {
	background: rgba(255, 255, 255, .08);
	color: #b6bcc6;
}

.dark-skin .io-promo-modal,
body.dark-skin .io-promo-modal {
	background: #22252b;
}

.dark-skin .io-promo-modal-title,
body.dark-skin .io-promo-modal-title {
	color: #e5e7eb;
}
