/* ============================================================
   女楼社区 — 表情插件样式（配合 emoji.js）
   .nv-emoji      正文/编辑器里的表情（span + 背景图，内联排版）
   .nvemoji-panel 工具栏表情面板（分类 tab + 表情网格）
   ============================================================ */

/* ---------- 正文与编辑器里的表情图 ---------- */
.nv-emoji {
	display: inline-block;
	width: 1.5em;
	height: 1.5em;
	margin: 0 1px;
	vertical-align: -0.32em;
	background-repeat: no-repeat;
	background-position: center center;
	background-size: contain;
}

/* 会员自定义表情（固定在 uploads/forum/emoji/ 下）：尺寸由 emoji.js 按**图片原始尺寸**写行内样式
   （上限见 emoji.js 的 NvEmoji.MINE_MAX，小图保持原尺寸；入口 NvEmoji._cellSize / fitMine）。
   这里**不写死宽高**：没测出尺寸时退回基础 .nv-emoji 的 1.5em——写死一个大值会把 24px 的小图
   拉伸填满整个框（background-size:contain 会放大）。max-width/max-height 只作硬上限兜底。
   用属性选择器而非额外类名：帖子/评论列表直接输出**存库 HTML**，不经编辑器渲染。*/
.nv-emoji[style*="uploads/forum/emoji/"] {
	max-width: 168px;
	max-height: 168px;
	margin: 0 2px;
}

/* 表情面板 ---------- */
.nvemoji-panel {
	position: fixed;
	z-index: 99999;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 348px;
	max-width: calc(100vw - 24px);
	padding: 8px;
	background: #fff;
	border: 1px solid #e8ebf0;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(20, 30, 50, .14);
	font-size: 14px;
	overflow: hidden;
}

.nvemoji-tabs {
	display: flex;
	flex: 0 0 auto;
	gap: 4px;
	margin-bottom: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.nvemoji-tabs::-webkit-scrollbar {
	display: none;
}

.nvemoji-tab {
	flex: 0 0 auto;
	padding: 4px 12px;
	border: 0;
	border-radius: 14px;
	background: #f2f4f8;
	color: #5c6473;
	font-size: 13px;
	line-height: 20px;
	white-space: nowrap;
	cursor: pointer;
	transition: background .15s, color .15s;
}

.nvemoji-tab:hover {
	background: #e9edf5;
}

.nvemoji-tab.on {
	background: #ff4713;
	color: #fff;
}

.nvemoji-grid {
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 4px;
	/* 内边距给删除角标（top/right -4px 外溢）留出伸展空间，否则贴边格子会被 overflow 裁掉一半 */
	padding: 4px;
	flex: 1 1 auto;
	max-height: 286px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.nvemoji-cell {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 6px;
	cursor: pointer;
}

.nvemoji-cell:hover {
	background: #f4f6fa;
}

.nvemoji-cell img {
	width: 28px;
	height: 28px;
	object-fit: contain;
	pointer-events: none;
}

/* 自定义表情（uploads/forum/emoji/）在面板里放大到约 4em 显示 */
.nvemoji-cell-big {
	width: 62px;
	height: 62px;
}

.nvemoji-cell-big img {
	width: 56px;
	height: 56px;
}

.nvemoji-empty {
	padding: 18px 10px;
	color: #99a0ac;
	font-size: 13px;
	line-height: 1.9;
	text-align: center;
}

.nvemoji-empty span {
	color: #c2c7d0;
	font-size: 12px;
}

/* ---------- 我的表情（会员自定义） ---------- */
/* 「我的表情」tab：只有红心图标，无文字 → 收成窄胶囊 */
.nvemoji-tab-mine {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 9px;
}

.nvemoji-tab-mine svg {
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
}

/* 选中态背景是橙红，红心转白更清楚 */
.nvemoji-tab-mine.on svg path {
	fill: #fff;
}

.nvemoji-del {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 15px;
	height: 15px;
	line-height: 14px;
	font-size: 13px;
	font-style: normal;
	text-align: center;
	color: #fff;
	background: #f0453a;
	border-radius: 50%;
	opacity: 0;
	transition: opacity .15s;
	cursor: pointer;
	z-index: 2;
	user-select: none;
}

.nvemoji-cell:hover .nvemoji-del {
	opacity: 1;
}

.nvemoji-upload {
	color: #9aa2ae;
	border: 1px dashed #d7dce4;
	border-radius: 6px;
}

.nvemoji-upload:hover {
	color: #ff4713;
	border-color: #ff4713;
	background: #fff7f4;
}

.nvemoji-upload svg {
	width: 18px;
	height: 18px;
	pointer-events: none;
}

.nvemoji-upload.loading {
	opacity: .45;
	pointer-events: none;
}

/* 未登录提示占满整个网格区 */
.nvemoji-grid-plain {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 140px;
}

/* ---------- 正文表情的收藏入口（鼠标悬停浮出 / 手机长按触发） ---------- */
/* 按钮是 body 下的 fixed 浮层，不塞进正文 DOM —— 避免污染存库 HTML（编辑器回填只认 background-image） */
.nv-emoji-fav {
	position: fixed;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #ff4713;
	color: #fff;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(20, 30, 50, .24);
	transition: transform .12s, background .15s;
}

.nv-emoji-fav svg {
	width: 13px;
	height: 13px;
	pointer-events: none;
}

.nv-emoji-fav:hover {
	transform: scale(1.1);
}

/* 已收藏：转灰 + 不再响应点击 */
.nv-emoji-fav.on,
.nv-emoji-fav.on:hover {
	background: #b0b7c3;
	transform: none;
	cursor: default;
}

/* 收藏结果轻提示 */
.nv-emoji-toast {
	position: fixed;
	left: 50%;
	bottom: 96px;
	z-index: 99999;
	max-width: 76vw;
	padding: 8px 16px;
	border-radius: 18px;
	background: rgba(28, 34, 44, .9);
	color: #fff;
	font-size: 13px;
	line-height: 1.5;
	transform: translateX(-50%);
	transition: opacity .3s;
	pointer-events: none;
}

.nv-emoji-toast.out {
	opacity: 0;
}

html.io-black-mode .nv-emoji-fav.on,
html.io-black-mode .nv-emoji-fav.on:hover {
	background: #5b6270;
}

/* ---------- 暗黑模式 ---------- */
html.io-black-mode .nvemoji-panel {
	background: #23272f;
	border-color: #363c46;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

html.io-black-mode .nvemoji-tab {
	background: #2e333c;
	color: #a8b0bd;
}

html.io-black-mode .nvemoji-tab:hover {
	background: #383e49;
}

html.io-black-mode .nvemoji-tab.on {
	background: #ff4713;
	color: #fff;
}

html.io-black-mode .nvemoji-cell:hover {
	background: #2e333c;
}

html.io-black-mode .nvemoji-empty {
	color: #79818f;
}

html.io-black-mode .nvemoji-upload {
	color: #7d8695;
	border-color: #414855;
}

html.io-black-mode .nvemoji-upload:hover {
	color: #ff6a3d;
	border-color: #ff6a3d;
	background: #33272a;
}
