/* 社区页 — 对齐设计稿三栏布局 */
.yw-community-page {
	background: linear-gradient(180deg, #f8f9fb 0%, var(--yw-bg) 200px);
	padding-bottom: 48px;
}

.yw-community-layout {
	display: grid;
	grid-template-columns: 268px minmax(0, 1fr) 300px;
	gap: 24px;
	align-items: start;
}

.yw-community-center {
	min-width: 0;
}

.yw-community-sidebar__post {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-weight: 700;
}

.yw-community-nav__list {
	list-style: none;
	margin: 0 0 18px;
	padding: 4px;
	display: grid;
	gap: 4px;
	background: #f8fafc;
	border-radius: 12px;
}

.yw-community-nav__link {
	display: block;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	color: #64748b;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.yw-community-nav__link:hover {
	background: #eef2ff;
	color: var(--yw-primary);
	text-decoration: none;
}

.yw-community-nav__link.is-active {
	background: #fff;
	color: var(--yw-primary);
	box-shadow: 0 1px 4px rgba(79, 70, 229, 0.12);
}

.yw-community-boards__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 2px;
}

.yw-community-boards__link {
	display: grid;
	grid-template-columns: 28px 1fr auto;
	gap: 8px;
	align-items: center;
	padding: 9px 10px;
	border-radius: 10px;
	font-size: 13px;
	color: inherit;
	text-decoration: none;
	transition: background 0.15s ease;
}

.yw-community-boards__link:hover,
.yw-community-boards__link.is-active {
	background: #eef2ff;
	text-decoration: none;
}

.yw-community-boards__link.is-active .yw-community-boards__name {
	color: var(--yw-primary);
	font-weight: 700;
}

.yw-community-boards__icon {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: #f1f5f9;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
}

.yw-community-boards__count {
	font-size: 12px;
	color: #94a3b8;
	font-weight: 600;
}

.yw-community-boards__all {
	display: inline-block;
	margin-top: 10px;
	font-size: 12px;
	font-weight: 600;
	color: var(--yw-primary);
	text-decoration: none;
}

.yw-community-tags__cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.yw-community-tags__item {
	display: inline-block;
	padding: 5px 11px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: #475569;
	background: #f8fafc;
	border: 1px solid #e8edf3;
	text-decoration: none;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.yw-community-tags__item:hover {
	background: #eef2ff;
	border-color: #c7d2fe;
	color: var(--yw-primary);
	text-decoration: none;
}

.yw-community-tags__more {
	display: inline-block;
	margin-top: 12px;
	font-size: 12px;
	font-weight: 600;
	color: var(--yw-primary);
	text-decoration: none;
}

/* —— Hero —— */
.yw-community-hero {
	display: grid;
	grid-template-columns: 1fr minmax(120px, 200px);
	gap: 20px;
	align-items: center;
	margin-bottom: 20px;
	padding: 32px 32px 28px;
	border-radius: 20px;
	background: linear-gradient(135deg, #1e40af 0%, #4f46e5 45%, #6366f1 100%);
	color: #fff;
	overflow: hidden;
	position: relative;
}

.yw-community-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.12), transparent 50%);
	pointer-events: none;
}

.yw-community-hero__content {
	position: relative;
	z-index: 1;
}

.yw-community-hero__title {
	margin: 0 0 10px;
	font-size: clamp(22px, 2.8vw, 30px);
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.02em;
}

.yw-community-hero__sub {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.88);
	max-width: 420px;
}

.yw-community-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.yw-community-hero .yw-btn--white {
	color: var(--yw-primary);
	font-weight: 700;
}

.yw-btn--outline-light {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.45);
	background: transparent;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.yw-btn--outline-light:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	color: #fff;
}

.yw-community-hero__art {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.yw-community-hero__art img {
	max-width: 100%;
	height: auto;
	filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.2));
}

/* —— 信息流工具栏 —— */
.yw-community-feed__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--yw-border);
}

.yw-community-feed__tabs {
	display: flex;
	align-items: center;
	gap: 4px;
}

.yw-community-feed__tab {
	display: inline-flex;
	align-items: center;
	padding: 8px 14px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #64748b;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.yw-community-feed__tab:hover {
	color: var(--yw-primary);
	text-decoration: none;
}

.yw-community-feed__tab.is-active {
	color: var(--yw-primary);
	border-bottom-color: var(--yw-primary);
}

.yw-community-feed__board-select select {
	min-width: 140px;
	padding: 8px 32px 8px 12px;
	border: 1px solid var(--yw-border);
	border-radius: 10px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%2364748b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	cursor: pointer;
	appearance: none;
}

/* —— 帖子卡片 —— */
.yw-community-feed__list {
	display: grid;
	gap: 14px;
}

.yw-community-card {
	background: #fff;
	border: 1px solid var(--yw-border);
	border-radius: 16px;
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.yw-community-card:hover {
	border-color: #c7d2fe;
	box-shadow: 0 8px 24px rgba(79, 70, 229, 0.08);
}

.yw-community-card__link {
	display: flex;
	gap: 16px;
	padding: 18px 20px;
	color: inherit;
	text-decoration: none;
}

.yw-community-card__link:hover {
	text-decoration: none;
}

.yw-community-card__main {
	flex: 1;
	min-width: 0;
}

.yw-community-card__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin-bottom: 10px;
}

.yw-community-card__avatar {
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: linear-gradient(135deg, #eef2ff, #e0e7ff);
	color: var(--yw-primary);
	font-size: 14px;
	font-weight: 800;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.yw-community-card__author {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
}

.yw-community-card__author strong {
	font-weight: 700;
	color: #0f172a;
}

.yw-community-card__level {
	padding: 2px 6px;
	border-radius: 6px;
	font-size: 10px;
	font-weight: 800;
	color: #7c3aed;
	background: #f5f3ff;
}

.yw-community-card__meta {
	font-size: 12px;
	color: #94a3b8;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.yw-community-card__section::before {
	content: "·";
	margin-right: 6px;
	color: #cbd5e1;
}

.yw-community-card__title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.35;
	color: #0f172a;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.yw-community-card__link:hover .yw-community-card__title {
	color: var(--yw-primary);
}

.yw-community-card__badge {
	display: inline-flex;
	padding: 2px 8px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 800;
	color: #dc2626;
	background: #fef2f2;
	flex-shrink: 0;
}

.yw-community-card__excerpt {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.55;
	color: #64748b;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.yw-community-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.yw-community-card__tag {
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	color: var(--yw-primary);
	background: #eef2ff;
}

.yw-community-card__foot {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 12px;
	color: #94a3b8;
}

.yw-community-card__stat {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-weight: 600;
}

.yw-community-card__stat svg {
	opacity: 0.7;
}

.yw-community-card__thumb {
	flex-shrink: 0;
	width: 120px;
	height: 120px;
	border-radius: 12px;
	overflow: hidden;
	background: #f1f5f9;
	border: 1px solid var(--yw-border);
}

.yw-community-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.yw-community-feed__more {
	text-align: center;
	margin-top: 20px;
}

.yw-community-page__content {
	margin-top: 24px;
}

/* —— 右侧栏 —— */
.yw-community-sidebar--right {
	display: grid;
	gap: 16px;
	position: sticky;
	top: 88px;
}

.yw-community-panel {
	padding: 18px;
	border-radius: 16px;
	background: #fff;
	border: 1px solid var(--yw-border);
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.yw-community-panel__title {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 800;
	color: #0f172a;
}

.yw-community-stats__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	text-align: center;
}

.yw-community-stats__item {
	padding: 12px 6px;
	border-radius: 12px;
	background: #f8fafc;
}

.yw-community-stats__icon {
	display: block;
	font-size: 20px;
	margin-bottom: 6px;
}

.yw-community-stats__value {
	display: block;
	font-size: 16px;
	font-weight: 800;
	color: #0f172a;
	line-height: 1.2;
}

.yw-community-stats__label {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	color: #94a3b8;
	font-weight: 600;
}

.yw-community-users {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.yw-community-users__item {
	display: grid;
	grid-template-columns: 24px 36px 1fr;
	gap: 10px;
	align-items: center;
}

.yw-community-users__rank {
	width: 22px;
	height: 22px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 800;
	background: #f1f5f9;
	color: #64748b;
}

.yw-community-users__rank--gold { background: #fef2f2; color: #dc2626; }
.yw-community-users__rank--silver { background: #fff7ed; color: #ea580c; }
.yw-community-users__rank--bronze { background: #fefce8; color: #ca8a04; }

.yw-community-users__avatar {
	width: 36px;
	height: 36px;
	border-radius: 999px;
	background: var(--yw-avatar-bg, #6366f1);
	color: #fff;
	font-size: 14px;
	font-weight: 800;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.yw-community-users__name {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 700;
	color: #0f172a;
}

.yw-community-users__level {
	font-size: 10px;
	font-weight: 800;
	color: #7c3aed;
	background: #f5f3ff;
	padding: 2px 5px;
	border-radius: 4px;
}

.yw-community-users__meta {
	display: block;
	font-size: 11px;
	color: #94a3b8;
	margin-top: 2px;
}

.yw-community-topics {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.yw-community-topics__link {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 6px;
	align-items: center;
	padding: 8px 10px;
	border-radius: 10px;
	font-size: 13px;
	color: inherit;
	text-decoration: none;
	transition: background 0.15s ease;
}

.yw-community-topics__link:hover {
	background: #f8fafc;
	text-decoration: none;
}

.yw-community-topics__hash {
	color: var(--yw-primary);
	font-weight: 800;
}

.yw-community-topics__title {
	font-weight: 600;
	color: #334155;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yw-community-topics__count {
	font-size: 11px;
	color: #94a3b8;
	font-weight: 600;
}

@media (max-width: 1280px) {
	.yw-community-layout {
		grid-template-columns: 240px minmax(0, 1fr) 260px;
		gap: 18px;
	}
}

@media (max-width: 1080px) {
	.yw-community-layout {
		grid-template-columns: 1fr;
	}

	.yw-community-sidebar--right {
		position: static;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.yw-community-sidebar--right .yw-community-panel:last-child {
		grid-column: 1 / -1;
	}
}

@media (max-width: 768px) {
	.yw-community-hero {
		grid-template-columns: 1fr;
		padding: 24px 20px;
	}

	.yw-community-hero__art {
		display: none;
	}

	.yw-community-feed__toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.yw-community-feed__tabs {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.yw-community-feed__tabs::-webkit-scrollbar {
		display: none;
	}

	.yw-community-card__link {
		flex-direction: column;
	}

	.yw-community-card__thumb {
		width: 100%;
		height: 160px;
	}

	.yw-community-sidebar--right {
		grid-template-columns: 1fr;
	}

	.yw-community-stats__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
