/* =========================
 * 社区首页 — 三栏布局
 * ========================= */

.langyu-forum-mode .site-footer {
	display: none;
}

.langyu-forum-container {
	margin-top: 20px;
	margin-bottom: 40px;
	padding: 0 20px;
}

.langyu-forum-layout {
	display: grid;
	grid-template-columns: 164px 520px 164px;
	gap: 20px;
	justify-content: space-between;
	width: 100%;
	align-items: start;
}

.langyu-forum-left-placeholder {
	width: 164px;
}

/* =========================
 * 左侧栏 — 固定导航
 * ========================= */
.langyu-forum-left {
	position: fixed;
	top: 80px;
	display: flex;
	flex-direction: column;
	width: 164px;
	height: calc(100vh - 100px);
	z-index: 10;
}

.langyu-forum-card {
	background: var(--langyu-surface, #fff);
	border-radius: 8px;
	overflow: hidden;
}

.langyu-forum-right .widget_langyu_home_author_badge {
	display: none;
}

/* =========================
 * 社区推荐列表 Widget
 * ========================= */
.langyu-forum-recommend-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.langyu-forum-recommend-item {
	padding: 0;
	border-bottom: 1px solid var(--langyu-border, rgba(0,0,0,0.05));
}

.langyu-forum-recommend-item:last-child {
	border-bottom: none;
}

.langyu-forum-recommend-item a {
	display: block;
	padding: 10px 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--langyu-text, #222);
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: color 0.12s ease;
}

.langyu-forum-recommend-item a:hover {
	color: var(--langyu-primary, #e45c3a);
}

.langyu-forum-card-title {
	padding: 12px 16px 0;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--langyu-text, #222);
}

.langyu-forum-card .widget-content {
	padding: 0 16px 12px;
}

.langyu-forum-left-nav {
	display: flex;
	flex-direction: column;
	gap: 2px;
	background: var(--langyu-surface, #fff);
	border-radius: 8px;
	padding: 4px;
	margin-bottom: 12px;
}

.langyu-forum-left-nav-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	font-size: 17px;
	color: var(--langyu-secondary, #666);
	text-decoration: none;
	border-radius: 6px;
	transition: all 0.15s ease;
}

.langyu-forum-left-nav-item:hover {
	background: var(--langyu-soft-bg, #f5f5f5);
	color: var(--langyu-text, #222);
}

.langyu-forum-left-nav-item.is-active {
	color: var(--langyu-primary, #111);
	font-weight: 600;
}

.langyu-forum-left-nav-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

.langyu-forum-left-nav-label {
	flex: 1;
}

.langyu-forum-left-section {
	background: var(--langyu-surface, #fff);
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 12px;
}

.langyu-forum-left-section-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 12px 16px;
	border: 0;
	background: transparent;
	color: var(--langyu-secondary, #666);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: color 0.15s;
}

.langyu-forum-left-section-toggle:hover {
	color: var(--langyu-text, #222);
}

.langyu-forum-left-section-icon {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.langyu-forum-left-section-label {
	flex: 1;
	text-align: left;
}

.langyu-forum-left-section-arrow {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.langyu-forum-left-section.is-open .langyu-forum-left-section-arrow {
	transform: rotate(180deg);
}

.langyu-forum-left-section-body {
	display: none;
	padding: 0 16px 10px;
}

.langyu-forum-left-section:last-child .langyu-forum-left-section-body {
	padding-bottom: 0;
}

.langyu-forum-left-section.is-open .langyu-forum-left-section-body {
	display: block;
}

.langyu-forum-left-cat-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.langyu-forum-left-cat-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.langyu-forum-left-cat-list li a {
	display: block;
	padding: 6px 0;
	font-size: 13px;
	color: var(--langyu-secondary, #666);
	text-decoration: none;
	transition: color 0.15s;
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.langyu-forum-left-cat-list li a:hover {
	color: var(--langyu-primary, #111);
}

.langyu-forum-left-cat-count {
	flex-shrink: 0;
	font-size: 11px;
	color: var(--langyu-muted, #7a7a7a);
	margin-left: 8px;
}

.langyu-forum-left-tags {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.langyu-forum-left-tag {
	display: block;
	padding: 8px 0;
	font-size: 13px;
	color: var(--langyu-secondary, #666);
	text-decoration: none;
	border-bottom: 1px solid var(--langyu-border, #d9d9d9);
	transition: color 0.15s;
}

.langyu-forum-left-tag:hover {
	color: var(--langyu-primary, #111);
}

.langyu-forum-left-tag:last-child {
	border-bottom: 0;
}

.langyu-forum-empty-sidebar {
	padding: 28px 16px;
	text-align: center;
	color: var(--langyu-muted, #7a7a7a);
	font-size: 13px;
	line-height: 1.6;
}

.langyu-forum-board-list {
	margin: 0;
	padding: 4px 0;
	list-style: none;
}

.langyu-forum-board-item {
	margin: 0;
}

.langyu-forum-board-item a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 16px;
	font-size: 13px;
	color: var(--langyu-secondary, #666);
	text-decoration: none;
	transition: all 0.15s ease;
}

.langyu-forum-board-item a:hover {
	background: var(--langyu-soft-bg, #f5f5f5);
	color: var(--langyu-text, #222);
}

.langyu-forum-board-item.is-active a {
	background: var(--langyu-soft-bg, #f5f5f5);
	color: var(--langyu-primary, #111);
	font-weight: 600;
}

.board-icon {
	flex-shrink: 0;
	color: var(--langyu-muted, #7a7a7a);
}

.langyu-forum-board-item.is-active .board-icon {
	color: var(--langyu-primary, #111);
}

.board-name {
	flex: 1;
}

.board-count {
	flex-shrink: 0;
	font-size: 11px;
	background: var(--langyu-soft-bg, #f5f5f5);
	padding: 1px 7px;
	border-radius: 10px;
	color: var(--langyu-muted, #7a7a7a);
	font-variant-numeric: tabular-nums;
}

/* 站点统计 */
.langyu-forum-stats-list {
	margin: 0;
	padding: 6px 16px 14px;
	list-style: none;
	display: flex;
	gap: 12px;
}

.langyu-forum-stats-list li {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
}

.stats-label {
	font-size: 11px;
	color: var(--langyu-muted, #7a7a7a);
	margin-bottom: 2px;
}

.stats-value {
	font-size: 16px;
	font-weight: 700;
	color: var(--langyu-text, #222);
	font-variant-numeric: tabular-nums;
}

/* =========================
 * 中间栏 — 帖子列表
 * ========================= */
.langyu-forum-main {
	min-width: 0;
	align-self: start;
}

.langyu-forum-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--langyu-border, #d9d9d9);
}

.langyu-forum-tabs {
	display: flex;
	gap: 4px;
}

.langyu-forum-tab {
	display: inline-block;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 500;
	color: var(--langyu-secondary, #666);
	text-decoration: none;
	border-radius: 6px;
	transition: all 0.15s ease;
}

.langyu-forum-tab:hover {
	background: var(--langyu-soft-bg, #f5f5f5);
	color: var(--langyu-text, #222);
}

.langyu-forum-tab.is-active {
	background: var(--langyu-button-bg, #111);
	color: var(--langyu-button-text, #fff);
}

.langyu-forum-post-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 16px;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: var(--langyu-button-bg, #111);
	border-radius: 6px;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.langyu-forum-post-btn:hover {
	opacity: 0.88;
	color: #fff;
}

/* 帖子列表 */
.langyu-forum-topic-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.langyu-forum-topic-row {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	height: 188px;
	padding: 32px 0;
	border-bottom: 1px solid var(--langyu-border, #d9d9d9);
	box-sizing: border-box;
	cursor: pointer;
}

.langyu-forum-topic-cover {
	flex-shrink: 0;
	width: 166px;
	height: 124px;
}

.langyu-forum-topic-cover a {
	display: block;
	width: 100%;
	height: 100%;
}

.langyu-forum-topic-cover img {
	display: block;
	width: 166px;
	height: 124px;
	object-fit: cover;
	border-radius: 4px;
}

.langyu-forum-topic-featured {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	height: auto;
	padding: 32px 0;
	border-bottom: 1px solid var(--langyu-border, #d9d9d9);
	overflow: hidden;
	margin-bottom: 0;
}

.langyu-forum-topic-featured .langyu-forum-topic-cover {
	width: 100%;
	height: 220px;
}

.langyu-forum-topic-featured .langyu-forum-topic-cover img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
}

.langyu-forum-topic-featured-body {
	padding: 18px;
	background: var(--featured-card-bg, var(--langyu-surface, #fff));
}

.langyu-forum-topic-featured .langyu-forum-topic-title {
	font-size: 20px;
	line-height: 1.35;
	-webkit-line-clamp: 2;
	margin-bottom: 10px;
}

.langyu-forum-topic-featured .langyu-forum-topic-title a {
	color: var(--featured-card-fg, var(--langyu-text, #222));
}

.langyu-forum-topic-featured-excerpt {
	margin-bottom: 14px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--featured-card-muted, var(--langyu-secondary, #666));
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.langyu-forum-topic-featured .langyu-forum-topic-meta {
	margin-top: 0;
	color: var(--featured-card-meta, var(--langyu-secondary, #666));
}

.langyu-forum-topic-featured .langyu-forum-topic-meta .topic-author-name,
.langyu-forum-topic-featured .langyu-forum-topic-meta .topic-time {
	color: var(--featured-card-meta, var(--langyu-secondary, #666));
}

.langyu-forum-topic-featured + .langyu-forum-topic-row {
	border-top: none;
}

.langyu-forum-topic-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 124px;
}

.langyu-forum-topic-title {
	margin: 0;
	font-size: 20px;
	font-weight: 400;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.langyu-forum-topic-title a {
	color: var(--langyu-text, #222);
	text-decoration: none;
}

.langyu-forum-topic-title a:hover {
	color: var(--langyu-primary, #111);
}

.langyu-forum-topic-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 12px;
	color: var(--langyu-muted, #7a7a7a);
	flex-wrap: wrap;
}

.langyu-forum-topic-author {
	display: flex;
	align-items: center;
	gap: 6px;
}

.topic-author-avatar {
	flex-shrink: 0;
	line-height: 0;
	width: 16px;
	height: 16px;
}

.topic-author-avatar .topic-avatar-img {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	object-fit: cover;
}

.topic-author-name {
	color: var(--langyu-secondary, #666);
	font-weight: 500;
	text-decoration: none;
}

.topic-author-name:hover {
	color: var(--langyu-primary, #111);
}

.topic-time {
	white-space: nowrap;
	color: var(--langyu-muted, #7a7a7a);
}

.topic-cat {
	display: inline-block;
	padding: 1px 8px;
	font-size: 11px;
	background: var(--langyu-soft-bg, #f5f5f5);
	border-radius: 10px;
	color: var(--langyu-muted, #7a7a7a);
	text-decoration: none;
}

.topic-cat:hover {
	background: var(--langyu-border, #d9d9d9);
	color: var(--langyu-text, #222);
}

.topic-column {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: var(--langyu-secondary, #666);
}

.topic-column:hover {
	color: var(--langyu-primary, #111);
}

.topic-column-cover {
	width: 20px;
	height: 20px;
	border-radius: 4px;
	object-fit: cover;
	flex-shrink: 0;
}

.topic-column-name {
	font-size: 12px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100px;
}

.langyu-forum-empty {
	padding: 48px 0;
	text-align: center;
	color: var(--langyu-muted, #7a7a7a);
}

/* =========================
 * 右侧栏 — 热门帖子 & 最新回复
 * ========================= */
.langyu-forum-right {
	position: sticky;
	top: 80px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	align-self: start;
	max-height: calc(100vh - 100px);
	overflow: visible;
}

.langyu-forum-hot-list {
	margin: 0;
	padding: 4px 0;
	list-style: none;
}

.langyu-forum-hot-item a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 9px 16px;
	text-decoration: none;
	transition: background 0.12s ease;
}

.langyu-forum-hot-item a:hover {
	background: var(--langyu-soft-bg, #f5f5f5);
}

.hot-title {
	flex: 1;
	font-size: 13px;
	color: var(--langyu-text, #222);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hot-comments {
	flex-shrink: 0;
	font-size: 11px;
	color: var(--langyu-muted, #7a7a7a);
	font-variant-numeric: tabular-nums;
}

/* 最新回复列表 */
.langyu-forum-comment-list {
	margin: 0;
	padding: 4px 0;
	list-style: none;
}

.langyu-forum-comment-item {
	margin: 0;
}

.comment-item-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 16px;
	text-decoration: none;
	transition: background 0.12s ease;
}

.comment-item-link:hover {
	background: var(--langyu-soft-bg, #f5f5f5);
}

.comment-item-avatar {
	flex-shrink: 0;
}

.comment-item-avatar .comment-avatar-img {
	border-radius: 50%;
	object-fit: cover;
}

.comment-item-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.comment-item-author {
	font-size: 12px;
	font-weight: 600;
	color: var(--langyu-secondary, #666);
}

.comment-item-excerpt {
	font-size: 12px;
	color: var(--langyu-muted, #7a7a7a);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* =========================
 * 暗黑模式
 * ========================= */
html.is-dark-mode .langyu-forum-card {
	background: transparent;
}

html.is-dark-mode .langyu-forum-left-nav {
	background: transparent;
}

html.is-dark-mode .langyu-forum-left-nav-item:hover {
	background: #222228;
}

html.is-dark-mode .langyu-forum-left-nav-item.is-active {
	color: #e6eaf0;
}

html.is-dark-mode .langyu-forum-left-section {
	background: transparent;
}

html.is-dark-mode .langyu-forum-left-tag {
	border-color: #2a2a2e;
}

html.is-dark-mode .langyu-forum-topic-row {
	border-color: #2a2a2e;
}

html.is-dark-mode .langyu-forum-hot-item a:hover,
html.is-dark-mode .comment-item-link:hover {
	background: #222228;
}

html.is-dark-mode .topic-cat {
	background: #222228;
}

html.is-dark-mode .topic-cat:hover {
	background: #333;
}

/* =========================
 * 论坛内嵌图文卡片
 * ========================= */
.langyu-forum-gallery-card {
	margin-bottom: 24px;
}

.langyu-forum-gallery-card .langyu-gallery-archive-card {
	border-radius: 12px;
}

/* =========================
 * 响应式
 * ========================= */
@media (max-width: 1050px) {
	.langyu-forum-layout {
		grid-template-columns: 164px 1fr;
		gap: 16px;
	}

	.langyu-forum-right {
		display: none;
	}

	.langyu-forum-topic-last {
		display: none;
	}
}

@media (max-width: 860px) {
	.langyu-forum-layout {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.langyu-forum-left,
	.langyu-forum-left-placeholder,
	.langyu-forum-right {
		display: none;
	}

	.langyu-forum-stats-list {
		flex-wrap: wrap;
	}

	.langyu-forum-topic-row {
		height: auto;
		padding: 32px 0;
		gap: 14px;
	}

	.langyu-forum-topic-row.langyu-forum-topic-featured {
		gap: 0;
		padding: 32px 0;
		height: auto;
	}

	.langyu-forum-topic-featured .langyu-forum-topic-cover {
		height: 200px;
	}

	.langyu-forum-topic-cover {
		width: 127px;
		height: 96px;
		flex-shrink: 0;
	}

	.langyu-forum-topic-cover img {
		width: 127px;
		height: 96px;
	}

	.langyu-forum-topic-body {
		height: auto;
		min-height: 96px;
	}

	.langyu-forum-topic-title {
		font-size: 17px;
	}

	.langyu-forum-topic-featured .langyu-forum-topic-title {
		font-size: 17px;
	}

	.langyu-forum-post-btn span {
		display: none;
	}

	.langyu-forum-post-btn {
		padding: 7px 12px;
	}
}

@media (max-width: 520px) {
	.langyu-forum-container {
		padding: 0 14px;
		margin-top: 14px;
	}

	.langyu-forum-layout {
		gap: 12px;
	}

	.langyu-forum-topic-row {
		padding: 32px 0;
		gap: 10px;
	}

	.langyu-forum-topic-row.langyu-forum-topic-featured {
		gap: 0;
		padding: 32px 0;
	}

	.langyu-forum-topic-featured .langyu-forum-topic-cover {
		height: 160px;
	}

	.langyu-forum-topic-cover {
		width: 127px;
		height: 96px;
	}

	.langyu-forum-topic-cover img {
		width: 127px;
		height: 96px;
	}

	.langyu-forum-topic-title {
		font-size: 17px;
	}

	.langyu-forum-topic-featured .langyu-forum-topic-title {
		font-size: 17px;
	}

	.topic-column-name {
		max-width: 60px;
	}
}

/* =========================
 * 侧栏底部信息
 * ========================= */
.langyu-forum-footer-meta {
	margin-top: auto;
	padding: 14px 16px;
	font-size: 12px;
	color: var(--langyu-muted, #7a7a7a);
	line-height: 1.6;
}

.langyu-forum-footer-meta .site-footer-copyright {
	margin-bottom: 2px;
}

.langyu-forum-footer-meta .site-footer-icp {
	color: var(--langyu-muted, #7a7a7a);
	text-decoration: none;
	font-size: 12px;
}

.langyu-forum-footer-meta .site-footer-icp:hover {
	color: var(--langyu-primary, #111);
	text-decoration: underline;
}

.langyu-forum-footer-link-list {
	margin: 0;
	padding: 10px 16px;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
}

.langyu-forum-footer-link-list li {
	margin: 0;
}

.langyu-forum-footer-link-list a {
	font-size: 13px;
	color: var(--langyu-secondary, #666);
	text-decoration: none;
}

.langyu-forum-footer-link-list a:hover {
	color: var(--langyu-primary, #111);
}

.langyu-forum-footer-social {
	overflow: visible;
}

.langyu-forum-social-list {
	margin: 0;
	padding: 10px 16px;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.langyu-forum-social-item {
	position: relative;
	display: flex;
	align-items: center;
	cursor: pointer;
}

.langyu-forum-social-link {
	color: var(--langyu-secondary, #666);
	display: flex;
	transition: color 0.15s;
}

.langyu-forum-social-item:hover .langyu-forum-social-link {
	color: var(--langyu-primary, #111);
}

.langyu-forum-social-qr {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 14px);
	transform: translateX(-50%);
	padding: 12px;
	background: var(--langyu-surface, #fff);
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
	display: none;
	z-index: 10;
}

.langyu-forum-social-qr::after {
	content: '';
	position: absolute;
	bottom: -6px;
	left: 50%;
	transform: translateX(-50%);
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 6px solid var(--langyu-surface, #fff);
}

.langyu-forum-social-qr img {
	width: 140px;
	height: 140px;
	display: block;
	border-radius: 4px;
	margin-bottom: 8px;
}

.forum-social-qr-text {
	font-size: 14px;
	color: var(--langyu-muted, #7a7a7a);
	text-align: center;
	font-weight: 500;
}

.langyu-forum-social-item:hover .langyu-forum-social-qr {
	display: block;
}

html.is-dark-mode .langyu-forum-footer-meta .site-footer-icp:hover {
	color: var(--langyu-accent, #e1e1e1);
}

html.is-dark-mode .langyu-forum-footer-link-list a:hover {
	color: var(--langyu-accent, #e1e1e1);
}

html.is-dark-mode .langyu-forum-social-qr {
	background: #1a1a1c;
}

html.is-dark-mode .langyu-forum-social-qr::after {
	border-top-color: #1a1a1c;
}
