/**
 * 表情包插件样式
 */

/* 表情包面板 */
.sticker-panel {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 360px;
    max-width: 95vw;
    height: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.sticker-panel.active {
    display: flex;
}

/* 面板头部 */
.sticker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
}

.sticker-header h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.sticker-header-actions {
    display: flex;
    gap: 8px;
}

.sticker-header-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.sticker-header-btn:hover {
    background: #e5e5e5;
}

/* 标签页 */
.sticker-tabs {
    display: flex;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
}

.sticker-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: none;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.sticker-tab.active {
    color: #07c160;
    background: white;
}

.sticker-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: #07c160;
    border-radius: 1px;
}

/* 表情网格 */
.sticker-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.sticker-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.sticker-item:hover {
    border-color: #07c160;
    transform: scale(1.05);
}

.sticker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 空状态 */
.sticker-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 13px;
}

.sticker-empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* 上传区域 */
.sticker-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.sticker-upload-area:hover {
    border-color: #07c160;
    background: #f9fff9;
}

.sticker-upload-area .upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.sticker-upload-area p {
    margin: 4px 0;
    font-size: 13px;
    color: #666;
}

.sticker-upload-area .hint {
    font-size: 11px;
    color: #999;
}

/* 右键菜单 */
.sticker-context-menu {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    min-width: 140px;
    display: none;
    overflow: hidden;
}

.sticker-context-menu.active {
    display: block;
}

.sticker-context-menu-item {
    padding: 10px 16px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.sticker-context-menu-item:hover {
    background: #f5f5f5;
}

.sticker-context-menu-item.danger {
    color: #f5222d;
}

/* 遮罩 */
.sticker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: none;
}

.sticker-overlay.active {
    display: block;
}

/* 加载状态 */
.sticker-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 13px;
}

/* 表情所有者标记 */
.sticker-item {
    position: relative;
}

.sticker-owner-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(7, 193, 96, 0.9);
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
}

.sticker-item.my-upload {
    border: 2px solid #07c160;
}

/* 聊天中的表情包样式 */
.sticker-message {
    max-width: 120px !important;
    background: transparent !important;
}

.sticker-message img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .sticker-panel {
        width: 100%;
        max-width: 100vw;
        bottom: 60px;
        left: 0;
        right: 0;
        transform: none;
        border-radius: 12px 12px 0 0;
        height: 280px;
    }
    
    .sticker-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .sticker-header {
        padding: 10px 14px;
    }
    
    .sticker-tab {
        padding: 8px 10px;
        font-size: 12px;
    }
}
