/* 评论表情 - 前台样式（评论框内左下角 + 动效） */
.comment-emoji-wrap {
    position: relative;
    display: block;
    width: 100%;
    overflow: visible;
}

textarea.comment-emoji-has-btn {
    position: relative;
    z-index: 3;
    box-sizing: border-box !important;
    padding-bottom: 40px !important;
}

/* 有内容时隐藏系统 Unicode 字形，改由镜像层显示表情包图片 */
textarea.comment-emoji-has-btn.ce-composer-active {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
}

.comment-emoji-mirror {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
    background: transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.comment-emoji-mirror .comment-emoji-img-inline {
    pointer-events: none;
}

.comment-emoji-mount {
    display: inline-flex;
    align-items: center;
    margin: 6px 0 10px;
    position: relative;
    z-index: 20;
    vertical-align: middle;
}

.comment-emoji-mount--inside {
    position: absolute;
    left: 10px;
    bottom: 8px;
    margin: 0;
    z-index: 6;
}

.comment-emoji-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #344054;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    outline: none;
    backdrop-filter: blur(6px);
    transition:
        transform .18s cubic-bezier(.22, 1, .36, 1),
        background-color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        color .18s ease;
}

.comment-emoji-btn:hover,
.comment-emoji-btn:focus {
    border-color: #98a2b3;
    background: #fff;
    color: #1d2939;
    box-shadow: 0 4px 12px rgba(16, 24, 40, .08);
    transform: translateY(-1px);
}

.comment-emoji-btn:active,
.comment-emoji-btn.is-press {
    transform: translateY(0) scale(.94);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.comment-emoji-btn.is-open {
    border-color: #667085;
    background: #f2f4f7;
    color: #101828;
}

.comment-emoji-btn-icon {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}

.comment-emoji-btn.is-open .comment-emoji-btn-icon {
    transform: rotate(-12deg) scale(1.08);
}

.comment-emoji-panel {
    position: fixed;
    width: 292px;
    max-width: calc(100vw - 24px);
    max-height: 248px;
    overflow: auto;
    padding: 10px;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(16, 24, 40, .16);
    z-index: 10050;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(.96);
    transform-origin: bottom left;
    transition:
        opacity .2s ease,
        transform .24s cubic-bezier(.22, 1, .36, 1),
        visibility .2s ease;
}

.comment-emoji-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.comment-emoji-panel-title {
    margin: 0 0 8px;
    font-size: 12px;
    color: #667085;
}

.comment-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.comment-emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    transition:
        background-color .15s ease,
        transform .18s cubic-bezier(.22, 1, .36, 1);
}

.comment-emoji-item:hover,
.comment-emoji-item:focus {
    background: #f2f4f7;
    transform: scale(1.12);
}

.comment-emoji-item:active {
    transform: scale(.92);
}

.comment-emoji-item.is-pop {
    animation: ce-emoji-pop .32s cubic-bezier(.22, 1, .36, 1);
}

.comment-emoji-item img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.comment-emoji-img-inline {
    width: 1.35em;
    height: 1.35em;
    vertical-align: -0.25em;
    object-fit: contain;
    margin: 0 1px;
}

@keyframes ce-emoji-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.28); }
    100% { transform: scale(1); }
}

@media (max-width: 480px) {
    .comment-emoji-panel {
        width: 260px;
    }
    .comment-emoji-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .comment-emoji-btn,
    .comment-emoji-btn-icon,
    .comment-emoji-panel,
    .comment-emoji-item {
        transition: none !important;
        animation: none !important;
    }
}
