/**
 * 分类列表页：紧凑列表布局（xd-list）
 *
 * 版式参考 xdgame 的列表页：一条一行，依次是分类标签、图标、标题、评分、文件大小、
 * 更新时间、查看按钮；整块内容装在一张白色卡片里，行与行之间用细线分隔。
 * 只在这个布局下生效（.archive-layout-xd-list），不影响其它列表风格。
 */

/* ---------- 外层卡片 ---------- */
.archive-layout-xd-list .posts-warp {
	padding: 0.375rem;
	background: #fff;
	border: 1px solid var(--ri-border-color, rgba(0, 0, 0, 0.08));
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* 行与行之间的分隔线（用行自身底边，避免再套一层 DOM） */
.archive-layout-xd-list .posts-warp > [class*="col"] {
	border-bottom: 1px solid var(--ri-border-color, rgba(0, 0, 0, 0.06));
}

.archive-layout-xd-list .posts-warp > [class*="col"]:last-child {
	border-bottom: 0;
}

/* ---------- 单行 ---------- */
.post-item.item-xd-list {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 0.75rem;
	background: transparent;
	border: 0;
	border-radius: 0.5rem;
	box-shadow: none;
	transform: none;
	overflow: visible;
	transition: background-color 0.2s ease;
}

.post-item.item-xd-list:hover {
	background: var(--ri-tertiary-bg, #f8f9fb);
	box-shadow: none;
	transform: none;
}

/* 分类标签 */
.item-xd-list .xd-cat {
	flex: 0 0 auto;
	min-width: 76px;
	padding: 0.25rem 0.5rem;
	border-radius: 0.375rem;
	background: rgba(59, 111, 245, 0.1);
	color: var(--ri-primary, #3b6ff5);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.item-xd-list .xd-cat.is-empty {
	background: transparent;
}

.item-xd-list a.xd-cat:hover {
	background: rgba(59, 111, 245, 0.18);
	color: var(--ri-primary, #3b6ff5);
}

/* 图标 */
.item-xd-list .xd-icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 0.5rem;
	background: var(--ri-tertiary-bg, #f8f9fb);
	color: var(--ri-tertiary-color, #9499a5);
	overflow: hidden;
	text-decoration: none;
}

.item-xd-list .xd-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.item-xd-list .xd-icon i {
	font-size: 1rem;
}

/* 标题区 */
.item-xd-list .xd-main {
	flex: 1 1 auto;
	min-width: 0;
}

.item-xd-list .xd-title {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	margin: 0;
	min-width: 0;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
}

.item-xd-list .xd-title > a {
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--ri-emphasis-color, #1b2432);
	text-decoration: none;
	transition: color 0.2s ease;
}

.item-xd-list:hover .xd-title > a {
	color: var(--ri-primary, #3b6ff5);
}

.item-xd-list .xd-desc {
	margin-top: 0.125rem;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 0.75rem;
	color: var(--ri-secondary-color, #9aa6b8);
}

.item-xd-list .xd-version {
	flex: 0 0 auto;
	padding: 0.0625rem 0.375rem;
	border-radius: 0.25rem;
	background: var(--ri-tertiary-bg, #f8f9fb);
	color: var(--ri-secondary-color, #9aa6b8);
	font-size: 0.6875rem;
	font-weight: 500;
	line-height: 1.5;
}

.item-xd-list .xd-badge {
	flex: 0 0 auto;
	padding: 0.0625rem 0.375rem;
	border-radius: 0.25rem;
	background: rgba(25, 135, 84, 0.12);
	color: #198754;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.5;
}

.item-xd-list .xd-badge.is-vip {
	background: rgba(245, 158, 11, 0.14);
	color: #b45309;
}

/* 评分 / 大小 / 日期 */
.item-xd-list .xd-rating,
.item-xd-list .xd-size,
.item-xd-list .xd-date {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.3125rem;
	font-size: 0.8125rem;
	line-height: 1.2;
	color: var(--ri-body-color, #5d616e);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.item-xd-list .xd-rating {
	min-width: 62px;
	justify-content: center;
}

.item-xd-list .xd-rating i {
	color: var(--ri-primary, #3b6ff5);
	font-size: 0.75rem;
}

.item-xd-list .xd-rating b {
	font-weight: 600;
	color: var(--ri-emphasis-color, #1b2432);
}

.item-xd-list .xd-size {
	min-width: 96px;
}

.item-xd-list .xd-size i {
	color: var(--ri-tertiary-color, #9499a5);
	font-size: 0.75rem;
}

.item-xd-list .xd-date {
	min-width: 88px;
	color: var(--ri-secondary-color, #9aa6b8);
}

.item-xd-list .xd-empty {
	color: var(--ri-tertiary-color, #9499a5);
}

/* 查看按钮 */
.item-xd-list .xd-more {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	min-width: 56px;
	padding: 0 0.75rem;
	border: 1px solid rgba(59, 111, 245, 0.35);
	border-radius: 0.375rem;
	background: transparent;
	color: var(--ri-primary, #3b6ff5);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.item-xd-list .xd-more:hover {
	background: var(--ri-primary, #3b6ff5);
	border-color: var(--ri-primary, #3b6ff5);
	color: #fff;
	text-decoration: none;
}

/* ---------- 顶部筛选项改成胶囊标签（参考 xdgame） ---------- */
.archive-layout-xd-list .filter-warp {
	background: transparent;
	border: 0;
	box-shadow: none;
}

.archive-layout-xd-list .filter-warp .filter-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.375rem;
	border-bottom: 0;
	padding: 0.25rem 0;
}

.archive-layout-xd-list .filter-warp .filter-item .filter-name {
	margin: 0 0.25rem 0 0;
	padding: 0.25rem 0;
	min-width: auto;
	color: var(--ri-secondary-color, #9aa6b8);
	font-size: 0.75rem;
	font-weight: 600;
}

.archive-layout-xd-list .filter-warp .filter-item .filter-link {
	margin: 0;
}

.archive-layout-xd-list .filter-warp .filter-item .filter-link a {
	display: inline-flex;
	align-items: center;
	padding: 0.375rem 0.75rem;
	border: 1px solid var(--ri-border-color, rgba(0, 0, 0, 0.08));
	border-radius: 999px;
	background: #fff;
	color: var(--ri-body-color, #4a4d59);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.archive-layout-xd-list .filter-warp .filter-item .filter-link a .badge {
	display: none;
}

.archive-layout-xd-list .filter-warp .filter-item .filter-link a:hover {
	border-color: var(--ri-primary, #3b6ff5);
	color: var(--ri-primary, #3b6ff5);
}

.archive-layout-xd-list .filter-warp .filter-item .filter-link.active a {
	background: var(--ri-primary, #3b6ff5);
	border-color: var(--ri-primary, #3b6ff5);
	color: #fff;
}

/* ---------- 深色模式 ---------- */
[data-bs-theme=dark] .archive-layout-xd-list .posts-warp {
	background: var(--ri-secondary-bg, #1a1c23);
}

[data-bs-theme=dark] .archive-layout-xd-list .filter-warp .filter-item .filter-link a {
	background: var(--ri-secondary-bg, #1a1c23);
}

[data-bs-theme=dark] .item-xd-list .xd-cat {
	background: rgba(59, 111, 245, 0.2);
	color: var(--ri-primary-text, #89a9f9);
}

[data-bs-theme=dark] .item-xd-list .xd-badge {
	background: rgba(25, 135, 84, 0.2);
	color: #70d5b3;
}

[data-bs-theme=dark] .item-xd-list .xd-badge.is-vip {
	background: rgba(245, 158, 11, 0.18);
	color: #f9c56d;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1199.98px) {
	.item-xd-list .xd-date {
		display: none;
	}
}

@media (max-width: 991.98px) {
	.item-xd-list {
		gap: 0.625rem;
	}

	.item-xd-list .xd-cat {
		display: none;
	}

	.item-xd-list .xd-desc {
		display: none;
	}
}

@media (max-width: 767.98px) {
	.item-xd-list .xd-size {
		display: none;
	}

	.item-xd-list .xd-rating {
		min-width: 48px;
	}

	.item-xd-list .xd-icon {
		width: 36px;
		height: 36px;
		border-radius: 0.375rem;
	}

	.item-xd-list .xd-title {
		font-size: 0.875rem;
	}

	.archive-layout-xd-list .posts-warp {
		padding: 0.25rem;
	}
}

@media (max-width: 575.98px) {
	.item-xd-list .xd-rating {
		display: none;
	}

	.item-xd-list .xd-more {
		min-width: 48px;
		padding: 0 0.5rem;
	}
}

/* ============================================================
   新闻卡片布局（news）：左图 + 右文，参考 ourplay 新闻列表
   ============================================================ */
.post-item.item-news {
	display: flex;
	gap: 16px;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--ri-border-color, rgba(0, 0, 0, 0.06));
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
	transform: none;
}

.post-item.item-news:hover {
	transform: none;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.item-news .news-thumb {
	flex: 0 0 224px;
	max-width: 224px;
	align-self: flex-start;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 10px;
	background: var(--ri-tertiary-bg, #eef0f5);
}

.item-news .news-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.item-news:hover .news-thumb img {
	transform: scale(1.04);
}

.item-news .news-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.item-news .news-tag {
	color: #16a34a;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
}

.item-news .news-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
}

.item-news .news-title a {
	color: var(--ri-primary, #3b6ff5);
	text-decoration: none;
}

.item-news .news-title a:hover {
	color: var(--ri-primary-text, #2f59c4);
	text-decoration: underline;
}

.item-news .news-desc {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	color: var(--ri-secondary-color, #8a97ac);
	font-size: 12.5px;
	line-height: 1.6;
}

.item-news .news-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	padding-top: 2px;
	color: var(--ri-tertiary-color, #aeb6c2);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

[data-bs-theme=dark] .post-item.item-news {
	background: var(--ri-secondary-bg, #1a1c23);
	border-color: var(--ri-border-color, rgba(255, 255, 255, 0.08));
	box-shadow: none;
}

[data-bs-theme=dark] .item-news .news-thumb {
	background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme=dark] .item-news .news-tag {
	color: #4ade80;
}

[data-bs-theme=dark] .item-news .news-title a {
	color: #89a9f9;
}

@media (max-width: 767.98px) {
	.post-item.item-news {
		flex-direction: column;
		gap: 10px;
		padding: 10px;
	}

	.item-news .news-thumb {
		flex-basis: auto;
		max-width: none;
		width: 100%;
	}
}
