:root {
	--bg: #f5f6f7;
	--card: #fff;
	--ink: #222;
	--sub: #666;
	--muted: #999;
	--line: #f0f0f0;
	--red: #f04142;
	--red-soft: #fff1f0;
	--shadow: 0 1px 2px rgba(0,0,0,.04);
	--top: 108px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body {
	font: 14px/1.5 "PingFang SC", "Microsoft YaHei", Tahoma, sans-serif;
	color: var(--ink);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { max-width: 100%; display: block; }

.top {
	position: sticky;
	top: 0;
	z-index: 20;
	background: #fff;
	box-shadow: 0 1px 0 #eee;
}
.top-bar, .channel-bar, .wrap {
	width: min(1100px, calc(100% - 32px));
	margin: 0 auto;
}
.top-bar {
	height: 60px;
	display: flex;
	align-items: center;
	gap: 20px;
}
.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.brand img { height: 30px; }
.brand strong { font-size: 22px; letter-spacing: 1px; color: var(--red); }
.search {
	flex: 1;
	display: flex;
	height: 38px;
	border: 1px solid #e6e6e6;
	border-radius: 4px;
	overflow: hidden;
	background: #fff;
	max-width: 520px;
}
.search input {
	flex: 1;
	border: 0;
	outline: none;
	padding: 0 14px;
	background: transparent;
}
.search button {
	width: 64px;
	border: 0;
	background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center/18px no-repeat;
	cursor: pointer;
}
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.btn {
	height: 32px;
	padding: 0 14px;
	border-radius: 2px;
	border: 1px solid #ddd;
	background: #fff;
	display: inline-flex;
	align-items: center;
}
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.avatar-btn {
	width: 34px; height: 34px; border: 0; padding: 0; border-radius: 50%; overflow: hidden; cursor: pointer; background: #eee;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.drop {
	display: none;
	position: absolute;
	right: 0;
	top: 42px;
	width: 168px;
	background: #fff;
	border: 1px solid #eee;
	box-shadow: 0 8px 24px rgba(0,0,0,.08);
	padding: 6px;
	z-index: 5;
}
.drop.show { display: block; }
.drop a, .drawer a { display: block; padding: 9px 10px; color: #444; }
.drop a:hover, .drawer a:hover { background: #fafafa; color: var(--red); }
.drop .who { padding: 8px 10px 10px; border-bottom: 1px solid #f2f2f2; margin-bottom: 4px; }
.drop .who b { display: block; }
.drop .who span { color: var(--muted); font-size: 12px; }
.icon-btn { display: none; width: 36px; height: 36px; border: 0; background: transparent; padding: 8px; }
.icon-btn span { display: block; height: 2px; margin: 4px 0; background: #333; }

.channel-bar { height: 46px; }
.channels {
	display: flex;
	gap: 4px;
	height: 46px;
	align-items: center;
	overflow-x: auto;
	scrollbar-width: none;
}
.channels::-webkit-scrollbar { display: none; }
.channels button {
	flex: 0 0 auto;
	border: 0;
	background: transparent;
	height: 46px;
	padding: 0 14px;
	font-size: 16px;
	color: #444;
	cursor: pointer;
	position: relative;
}
.channels button.on { color: var(--red); font-weight: 700; }
.channels button.on:after {
	content: "";
	position: absolute;
	left: 16px; right: 16px; bottom: 6px;
	height: 3px;
	border-radius: 2px;
	background: var(--red);
}

.wrap {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 16px;
	padding: 16px 0 40px;
	align-items: start;
}
.feed { background: #fff; border-radius: 4px; }
.card {
	display: block;
	padding: 16px 18px 14px;
	border-bottom: 1px solid var(--line);
}
.card:hover h2 { color: var(--red); }
.card h2 {
	margin: 0;
	font-size: 18px;
	line-height: 1.45;
	font-weight: 650;
}
.tag {
	display: inline-block;
	margin-right: 6px;
	padding: 0 4px;
	font-size: 12px;
	line-height: 18px;
	color: var(--red);
	border: 1px solid #ffccc7;
	border-radius: 2px;
	vertical-align: 2px;
	font-style: normal;
	font-weight: 500;
}
.excerpt {
	margin: 8px 0 0;
	color: var(--sub);
	font-size: 14px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
	margin-top: 10px;
}
.gallery img, .thumb img {
	width: 100%;
	height: 108px;
	object-fit: cover;
	border-radius: 4px;
	background: #f3f3f3;
}
.card.right {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 168px;
	gap: 16px;
	align-items: start;
}
.card.right .thumb img { height: 96px; }
.meta {
	display: flex;
	gap: 12px;
	margin-top: 10px;
	color: var(--muted);
	font-size: 12px;
	align-items: center;
}
.meta .src { color: #666; }
.meta .hot { color: var(--red); }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #ccc; }

.side { position: sticky; top: 124px; }
.panel { background: #fff; border-radius: 4px; padding: 14px 16px; margin-bottom: 12px; }
.panel h3 {
	margin: 0 0 8px;
	font-size: 16px;
	padding-left: 8px;
	border-left: 3px solid var(--red);
}
.panel ol, .panel ul { margin: 0; padding: 0; list-style: none; }
.panel li { padding: 8px 0; border-top: 1px solid #f6f6f6; }
.panel li:first-child { border-top: 0; }
.rank { color: var(--red); font-weight: 700; margin-right: 6px; display: inline-block; width: 16px; }
.panel .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.members { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.member { text-align: center; font-size: 12px; color: #666; }
.member img { width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 4px; object-fit: cover; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stats span { background: #fafafa; border-radius: 2px; padding: 4px 8px; color: #777; font-size: 12px; }
.stats b { color: var(--red); margin-left: 4px; }

.loader, .empty, .error {
	text-align: center;
	color: var(--muted);
	padding: 22px 12px 28px;
	background: #fff;
}
.loader.spin:before {
	content: "";
	display: inline-block;
	width: 14px; height: 14px;
	margin-right: 6px;
	border: 2px solid #eee;
	border-top-color: var(--red);
	border-radius: 50%;
	vertical-align: -2px;
	animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.drawer[hidden] { display: none; }
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-mask { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(78vw, 300px); background: #fff; padding: 18px 12px; overflow: auto; }
.drawer-head { font-size: 18px; font-weight: 700; padding: 4px 10px 12px; }

@media (max-width: 860px) {
	:root { --top: 96px; }
	.top-bar, .channel-bar, .wrap { width: 100%; }
	.top-bar { height: 50px; padding: 0 12px; gap: 10px; }
	.brand strong { font-size: 18px; }
	.search { display: none; }
	.icon-btn { display: block; }
	.userbox .btn { display: none; }
	.channel-bar { padding: 0 4px; }
	.channels button { font-size: 16px; padding: 0 12px; }
	.wrap { display: block; padding: 8px 0 24px; }
	.side { display: none; }
	.feed { border-radius: 0; }
	.card { padding: 14px 12px 12px; }
	.card h2 { font-size: 17px; }
	.card.right { grid-template-columns: minmax(0, 1fr) 112px; gap: 10px; }
	.card.right .thumb img, .gallery img { height: 76px; }
	.excerpt { display: none; }
}
