/* 网格视图样式 - 参考档案站设计 */

/* 懒加载提示样式 */
#lazy-loading {
	padding: 30px 20px;
	text-align: center;
	color: var(--text-muted);
}

#lazy-loading .spinner-border {
	width: 2rem;
	height: 2rem;
	border-width: 0.2rem;
}

#lazy-loading p {
	margin-top: 15px;
	font-size: 0.95rem;
}

/* 列表视图和网格视图统一基础样式 */
.threadlist .thread {
	border: 1px solid var(--border);
	background-color: var(--bg-card) !important;
	padding: 15px;
	border-radius: 6px;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.threadlist .thread:hover {
	border-color: var(--bg-elevated);
	background-color: var(--bg-hover) !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 默认列表视图 */
.threadlist.list-view .thread {
	margin-bottom: 15px;
	cursor: pointer;
}

/* 网格视图样式 - 论坛3列布局 */
.threadlist.grid-view {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	width: 100%;
	max-width: 100%;
}

/* 限制最大3列 */
@media (min-width: 1200px) {
	.threadlist.grid-view {
		grid-template-columns: repeat(3, 1fr);
	}
}

.threadlist.grid-view .thread {
	margin-bottom: 0;
}

/* 移动端1列 */
@media (max-width: 767px) {
	.threadlist.grid-view {
		grid-template-columns: 1fr;
		gap: 15px;
	}
}

/* 列表视图隐藏封面 */
.threadlist.list-view .thread-cover {
	display: none;
}

/* 网格卡片布局 - 参考manbo固定高度 */
.threadlist.grid-view .thread {
	display: flex;
	flex-direction: column;
	height: 200px;
	min-height: 200px;
	overflow: hidden;
	position: relative;
	cursor: pointer;
}

/* 网格视图封面图 - 占据整个卡片 */
.threadlist.grid-view .thread-cover {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-color: var(--bg-hover);
	z-index: 0;
}

/* 懒加载占位效果 */
.threadlist.grid-view .thread-cover.lazy-bg {
	background-image: none;
	background-color: var(--bg-hover);
}

/* 内容层固定在底部 */
.threadlist.grid-view .thread .media-body {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 1;
	background: linear-gradient(to top, rgba(39, 39, 39, 0.98) 0%, rgba(39, 39, 39, 0.92) 70%, transparent 100%);
	padding: 12px 15px;
	margin: 0;
}

/* 标题样式 - 图标和文字并排 */
.threadlist.grid-view .thread .subject {
	font-size: 1rem;
	font-weight: 500;
	height: auto;
	margin-bottom: 6px;
	line-height: 1.4;
	display: flex !important;
	flex-direction: row !important;
	align-items: flex-start !important;
	gap: 4px !important;
	overflow: visible !important;
	flex-wrap: nowrap !important;
	word-break: normal !important;
}

/* 标题图标（置顶、精华等） - 强制内联 */
.threadlist.grid-view .thread .subject > i {
	flex-shrink: 0 !important;
	font-size: 0.85rem;
	line-height: 1.4;
	display: inline-block !important;
	margin-right: 0 !important;
}

/* 隐藏checkbox */
.threadlist.grid-view .thread .subject input[type="checkbox"] {
	display: none;
}

/* 标题链接限制2行 */
.threadlist.grid-view .thread .subject > a {
	display: -webkit-box !important;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--text);
	flex: 1;
	min-width: 0;
	word-break: break-all;
}

.threadlist.grid-view .thread .subject a:hover {
	color: var(--text-secondary);
}

/* fox_tags 标签容器 - 绝对定位到底部和头像并排 */
.threadlist.grid-view .thread .thread-tags {
	position: absolute;
	bottom: 12px;
	left: 60px; /* 头像右侧，留足间距 */
	z-index: 2;
	margin: 0 !important;
	display: flex;
	gap: 4px;
	align-items: center;
}

/* fox_tags 标签样式 */
.threadlist.grid-view .thread .thread-tags .badge {
	font-size: 0.65rem;
	padding: 1px 5px;
	line-height: 1.3;
	white-space: nowrap;
	margin: 0 !important;
}

/* 隐藏大头像，显示小头像 */
.threadlist.grid-view .thread .avatar-3 {
	display: none;
}

.threadlist.grid-view .thread .hidden-md.hidden-lg {
	display: inline-flex !important;
	align-items: center;
}

.threadlist.grid-view .thread .avatar-1 {
	margin-right: 6px;
}

/* 隐藏最后回复人信息 */
.threadlist.grid-view .thread .hidden-sm {
	display: none !important;
}

/* 隐藏用户名，只显示头像 */
.threadlist.grid-view .thread .username {
	display: none !important;
}

/* 隐藏分隔符 */
.threadlist.grid-view .thread .text-grey {
	display: none !important;
}

/* 底部信息区域样式 */
.threadlist.grid-view .thread .d-flex.justify-content-between {
	margin-top: 8px;
	font-size: 0.85rem;
}

/* 视图切换按钮样式 - 极简无背景 */
.view-toggle-btn {
	padding: 4px 8px;
	background-color: transparent;
	border: none;
	border-radius: 4px;
	color: var(--text-secondary);
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	transition: all 0.2s ease;
	vertical-align: middle;
	display: inline-flex;
	align-items: center;
	margin-top: 2px;
}

.view-toggle-btn:hover {
	background-color: transparent;
	color: var(--text);
}

.view-toggle-btn:focus {
	outline: none;
}

/* 移动端侧边栏处理 */
@media (max-width: 768px) {
	body:has(.threadlist) .aside {
		display: none !important;
	}
	
	body:has(.threadlist) .main {
		flex: 1;
		max-width: 100%;
		padding-right: 0;
	}
}

