/* 网格视图样式 - 参考档案站设计 */

/* 懒加载提示样式 */
#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.top_1::before,
.threadlist.grid-view .thread.top_2::before,
.threadlist.grid-view .thread.top_3::before {
	content: '';
	position: absolute;
	top: -3px;
	left: -4px;
	width: 24px;
	height: 24px;
	background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M170.666667 128h682.666666v758.528l-333.738666-87.466667L170.666667 886.528z" fill="%23e8989a"/><path d="M464.597333 320.469333H691.2V366.08h-97.962667l-6.656 35.541333h94.293334v169.258667h-49.664v-124.8h-114.432v127.402667H467.2V401.578667h63.701333l6.656-35.541334h-72.96V320.469333z m-136.32 4.096h130.773334v50.730667h-32.981334v228.522667c0 15.061333-2.602667 26.965333-7.850666 35.754666a33.877333 33.877333 0 0 1-21.418667 16.469334c-8.96 2.218667-29.226667 3.328-60.714667 3.328-1.706667-14.805333-4.565333-30.848-8.533333-48.128 11.349333 1.194667 22.485333 1.834667 33.322667 1.834666 9.898667 0 14.848-5.418667 14.848-16.298666V375.296H328.277333v-50.773333z m221.866667 144.426667h48.896c0 36.181333-2.901333 66.261333-8.704 90.197333a2042.709333 2042.709333 0 0 1 107.221333 72.789334l-31.488 39.978666a1645.056 1645.056 0 0 0-92.757333-70.570666c-16.682667 27.818667-51.328 51.797333-103.893333 72.064a475.733333 475.733333 0 0 0-29.653334-48.170667c26.666667-7.253333 48.853333-16.768 66.56-28.501333 17.749333-11.733333 29.44-27.818667 35.2-48.213334 5.76-20.48 8.618667-46.933333 8.618667-79.573333z" fill="%23FFFFFF"/></svg>');
	background-size: contain;
	background-repeat: no-repeat;
	z-index: 11;
	border-radius: 6px 0 4px 0;
}

/* 网格视图精华图标 - 右上角弧形 */
/* 精华1 - 精华（绿色） */
.threadlist.grid-view .thread.digest_1::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 34px;
	height: 34px;
	background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M 0 0 L 100 0 L 100 100 A 141.42 141.42 0 0 1 0 0 Z" fill="%2307c160"/><text x="54" y="42" fill="white" font-size="34" font-weight="bold" text-anchor="middle" transform="rotate(45 54 42)">精华</text></svg>');
	background-size: contain;
	background-repeat: no-repeat;
	z-index: 11;
}

/* 精华2 - 推荐（粉色） */
.threadlist.grid-view .thread.digest_2::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 34px;
	height: 34px;
	background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M 0 0 L 100 0 L 100 100 A 141.42 141.42 0 0 1 0 0 Z" fill="%23e8989a"/><text x="54" y="42" fill="white" font-size="34" font-weight="bold" text-anchor="middle" transform="rotate(45 54 42)">推荐</text></svg>');
	background-size: contain;
	background-repeat: no-repeat;
	z-index: 11;
}

/* 精华3 - 优质（蓝色） */
.threadlist.grid-view .thread.digest_3::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 34px;
	height: 34px;
	background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M 0 0 L 100 0 L 100 100 A 141.42 141.42 0 0 1 0 0 Z" fill="%2333CEFF"/><text x="54" y="42" fill="white" font-size="34" font-weight="bold" text-anchor="middle" transform="rotate(45 54 42)">优质</text></svg>');
	background-size: contain;
	background-repeat: no-repeat;
	z-index: 11;
}

/* 网格视图封面图 - 占据整个卡片 */
.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: #a2a7ae;
	flex: 1;
	min-width: 0;
	word-break: break-all;
}

.threadlist.grid-view .thread .subject a:hover {
	color: #c0c5cd;
}

/* 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;
	}
}

