:root {
	--page-bg: #f4f6f8;
	--panel-bg: #ffffff;
	--line-color: #d9dee7;
	--muted-color: #687385;
	--title-color: #1d2736;
	--brand-color: #2f6fed;
	--brand-soft: #e9f0ff;
	--success-soft: #e9f8ef;
	--warning-soft: #fff5db;
	--danger-soft: #ffecef;
	--purple-soft: #f1edff;
}

body {
	background: var(--page-bg);
	color: var(--title-color);
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
	color: inherit;
	text-decoration: none;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 1020;
}

.site-brand {
	align-items: center;
	display: inline-flex;
	font-weight: 700;
	gap: 8px;
}

.brand-mark {
	align-items: center;
	background: var(--brand-color);
	border-radius: 6px;
	color: #ffffff;
	display: inline-flex;
	font-size: 16px;
	height: 32px;
	justify-content: center;
	width: 32px;
}

.search-form {
	min-width: 240px;
}

.auth-area {
	white-space: nowrap;
}

.category-strip {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 2px;
	scrollbar-width: thin;
}

.category-strip .btn {
	flex: 0 0 auto;
}

.content-panel,
.sidebar-panel {
	background: var(--panel-bg);
	border: 1px solid var(--line-color);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgb(29 39 54 / 5%);
}

.topic-table-head {
	border-bottom: 1px solid var(--line-color);
	color: var(--muted-color);
	font-size: 13px;
	font-weight: 700;
	grid-template-columns: minmax(0, 1fr) 84px 84px 112px;
	padding: 12px 16px;
}

.topic-list {
	min-height: 120px;
}

.topic-item {
	border-bottom: 1px solid var(--line-color);
	display: grid;
	gap: 12px;
	grid-template-columns: minmax(0, 1fr) 84px 84px 112px;
	padding: 16px;
	transition: background-color 0.16s ease;
}

.topic-item:last-child {
	border-bottom: 0;
}

.topic-item:hover {
	background: #f9fbff;
}

.topic-title-row {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 6px;
}

.topic-title {
	color: var(--title-color);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
}

.topic-title:hover {
	color: var(--brand-color);
}

.topic-summary {
	color: #4f5b6b;
	font-size: 14px;
	line-height: 1.6;
	margin-bottom: 10px;
}

.topic-meta {
	align-items: center;
	color: var(--muted-color);
	display: flex;
	flex-wrap: wrap;
	font-size: 13px;
	gap: 8px;
}

.topic-stat {
	align-items: center;
	color: #415066;
	display: flex;
	flex-direction: column;
	font-size: 13px;
	justify-content: center;
	text-align: center;
}

.topic-stat strong {
	color: var(--title-color);
	font-size: 18px;
	line-height: 1.2;
}

.topic-activity {
	align-items: flex-end;
	color: var(--muted-color);
	display: flex;
	flex-direction: column;
	font-size: 13px;
	justify-content: center;
	text-align: right;
}

.badge-category {
	border-radius: 5px;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 7px;
}

.badge-category.category-announcement {
	background: var(--danger-soft);
	color: #b42339;
}

.badge-category.category-share {
	background: var(--brand-soft);
	color: #245ac4;
}

.badge-category.category-question {
	background: var(--success-soft);
	color: #1e7a43;
}

.badge-category.category-tutorial {
	background: var(--purple-soft);
	color: #5b3db3;
}

.badge-category.category-chat {
	background: #eef1f5;
	color: #536072;
}

.badge-category.category-default {
	background: var(--warning-soft);
	color: #936100;
}

.tag-pill {
	background: #eef2f7;
	border-radius: 999px;
	color: #536072;
	display: inline-flex;
	font-size: 12px;
	line-height: 1;
	padding: 5px 8px;
}

.empty-state {
	color: var(--muted-color);
	padding: 48px 16px;
	text-align: center;
}

.detail-panel {
	padding: 24px;
}

.detail-header {
	border-bottom: 1px solid var(--line-color);
	margin-bottom: 20px;
	padding-bottom: 18px;
}

.detail-title {
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 800;
	line-height: 1.25;
	margin: 14px 0 12px;
}

.detail-content {
	color: #334155;
	font-size: 16px;
	line-height: 1.8;
	white-space: pre-wrap;
}

.detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sidebar-stack {
	display: grid;
	gap: 16px;
}

.sidebar-panel {
	padding: 16px;
}

.sidebar-title {
	font-size: 16px;
	font-weight: 800;
	margin-bottom: 14px;
}

.stats-grid {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-box {
	background: #f7f9fc;
	border: 1px solid #e6ebf2;
	border-radius: 8px;
	padding: 10px;
}

.stat-box strong {
	display: block;
	font-size: 20px;
	line-height: 1.2;
}

.stat-box span {
	color: var(--muted-color);
	font-size: 12px;
}

.tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mobile-topic-stats {
	color: var(--muted-color);
	display: none;
	font-size: 13px;
	gap: 10px;
}

@media (max-width: 991.98px) {
	.site-header {
		position: static;
	}

	.search-form {
		margin: 12px 0 4px;
		min-width: 100%;
	}

	.auth-area {
		padding-bottom: 8px;
	}
}

@media (max-width: 767.98px) {
	main.container-xl {
		padding-left: 12px;
		padding-right: 12px;
	}

	.content-panel,
	.sidebar-panel {
		border-radius: 6px;
	}

	.topic-item {
		display: block;
		padding: 14px;
	}

	.topic-title {
		font-size: 16px;
	}

	.topic-summary {
		font-size: 13px;
	}

	.topic-stat,
	.topic-activity {
		display: none;
	}

	.mobile-topic-stats {
		display: flex;
		flex-wrap: wrap;
		margin-top: 10px;
	}

	.detail-panel {
		padding: 18px;
	}

	.detail-title {
		font-size: 24px;
	}
}

@media (max-width: 575.98px) {
	.navbar-brand {
		font-size: 17px;
	}

	.input-group-text {
		display: none;
	}

	.detail-actions .btn {
		flex: 1 1 auto;
	}
}
