/* ========== 表情包选择器样式 ========== */
.emoji-picker-wrap {
    position: relative;
    display: inline-block;
}

.emoji-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.emoji-btn:hover {
    color: var(--primary-color);
    background: var(--primary-bg);
}

.emoji-btn.active {
    color: var(--primary-color);
    background: var(--primary-bg);
}

.emoji-panel {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    width: 360px;
    max-height: 320px;
    overflow: hidden;
}

.emoji-panel.show {
    display: block;
    animation: emojiFadeIn 0.2s ease;
}

@keyframes emojiFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.emoji-panel-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.emoji-panel-header i {
    color: var(--primary-color);
}

.emoji-panel-body {
    padding: 10px;
    max-height: 260px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.emoji-panel-body::-webkit-scrollbar {
    width: 4px;
}

.emoji-panel-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.emoji-item {
    cursor: pointer;
    border-radius: 8px;
    padding: 4px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

.emoji-item:hover {
    background: var(--primary-bg);
    transform: scale(1.15);
}

.emoji-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 工具栏中的表情按钮 */
.write-editor-toolbar .emoji-picker-wrap {
    display: inline-flex;
}

.write-editor-toolbar .emoji-btn {
    padding: 6px 8px;
}

.write-editor-toolbar .emoji-panel {
    bottom: auto;
    top: 100%;
    margin-top: 8px;
    margin-bottom: 0;
}

/* 评论区表情按钮 */
.comment-form .form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 响应式 */
@media (max-width: 768px) {
    .emoji-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        max-height: 50vh;
        margin-bottom: 0;
        border-radius: 12px 12px 0 0;
        transform: none;
    }
    
    .emoji-panel-body {
        grid-template-columns: repeat(6, 1fr);
        max-height: 40vh;
    }
}


/* 帖子和评论中的内联表情显示 */
.post-content img.emoji-inline,
.comment-body img.emoji-inline,
.comment-content img.emoji-inline,
.content img[src*="xiaolaohu"] {
    display: inline-block;
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin: 0 2px;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: none !important;
}

/* 侧边栏评论中的表情（小尺寸） */
.sidebar .comment-text img.emoji-inline,
.sidebar .comment-text img[src*="xiaolaohu"] {
    width: 20px;
    height: 20px;
}
