/* Smoji 评论表情面板 — 跟随主题视觉，面板默认隐藏，零首屏负担。 */

.asmoji-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	vertical-align: middle;
}

.asmoji-btn svg {
	flex: none;
}

.asmoji-panel {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 0;
	z-index: 999;
	display: none;
	width: 350px;
	max-width: calc(100vw - 24px);
	background: #fff;
	border: 1px solid rgba(120, 130, 152, 0.14);
	border-radius: 10px;
	box-shadow: 0 8px 28px rgba(30, 40, 90, 0.14);
	padding: 8px;
}

.asmoji-panel.show {
	display: block;
	animation: asmoji-pop 0.16s ease-out;
}

@keyframes asmoji-pop {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.asmoji-tabs {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	scrollbar-width: thin;
	padding-bottom: 8px;
	margin-bottom: 4px;
	border-bottom: 1px solid rgba(120, 130, 152, 0.12);
	-webkit-overflow-scrolling: touch;
}

.asmoji-tab {
	flex: none;
	padding: 3px 10px;
	border: 0;
	border-radius: 999px;
	background: rgba(120, 130, 152, 0.1);
	color: #666;
	font-size: 12px;
	line-height: 20px;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.asmoji-tab:hover {
	background: rgba(120, 130, 152, 0.18);
	color: #333;
}

.asmoji-tab.active {
	background: #307af6;
	color: #fff;
}

.asmoji-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
	gap: 2px;
	max-height: 240px;
	overflow-y: auto;
	scrollbar-width: thin;
	padding: 2px 0;
}

.asmoji-cell {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1;
	padding: 3px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
	transition: background 0.12s, transform 0.12s;
}

.asmoji-cell:hover {
	background: rgba(120, 130, 152, 0.12);
	transform: scale(1.08);
}

.asmoji-cell img {
	display: block;
	object-fit: contain;
}

.asmoji-loading {
	grid-column: 1 / -1;
	padding: 28px 0;
	text-align: center;
	font-size: 13px;
	color: #999;
}

.asmoji-foot {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid rgba(120, 130, 152, 0.12);
	text-align: right;
	font-size: 11px;
	color: #aaa;
}

.asmoji-foot a {
	color: #aaa;
	text-decoration: none;
}

.asmoji-foot a:hover {
	color: #307af6;
}

/* 深色模式下的面板配色（跟随系统偏好，与主题暗色下拉一致即可） */
@media (prefers-color-scheme: dark) {
	.asmoji-panel {
		background: #1e2229;
		border-color: rgba(255, 255, 255, 0.08);
		box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
	}

	.asmoji-tab {
		background: rgba(255, 255, 255, 0.08);
		color: #aab;
	}

	.asmoji-tab:hover {
		background: rgba(255, 255, 255, 0.14);
		color: #eee;
	}

	.asmoji-cell:hover {
		background: rgba(255, 255, 255, 0.08);
	}

	.asmoji-loading,
	.asmoji-foot,
	.asmoji-foot a {
		color: #788;
	}

	.asmoji-tabs,
	.asmoji-foot {
		border-color: rgba(255, 255, 255, 0.08);
	}
}

@media (max-width: 480px) {
	.asmoji-panel {
		width: 300px;
	}

	.asmoji-grid {
		grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
	}
}
