/**
 * @用户功能样式文件
 * @Author: 云间
 * @Description: zibll主题评论区@用户功能的CSS样式
 * @Date: 2025-10-16
 */

/* @用户选择器容器 */
.mention-user-selector {
    position: absolute;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    max-height: 300px;
    overflow: hidden;
    display: none !important;
    min-width: 280px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mention-user-selector.show {
    display: block !important;
    opacity: 1;
}

/* 搜索输入框 */
.mention-search-input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    outline: none;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}

.mention-search-input:focus {
    background: #fff;
}

/* 用户列表容器 */
.mention-user-list {
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
}

/* 用户项 */
.mention-user-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s ease;
}

.mention-user-item:hover,
.mention-user-item.active {
    background: #f8f9fa;
}

.mention-user-item:last-child {
    border-bottom: none;
}

/* 用户头像 */
.mention-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    background: #e9ecef;
    overflow: hidden;
    display: inline-block !important;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.mention-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block !important;
}

/* 用户信息 */
.mention-user-info {
    flex: 1;
    min-width: 0;
}

/* 用户徽章样式 */
.mention-user-name .avatar-badge,
.mention-user-name .vip-icon,
.mention-user-name .user-auth-icon,
.mention-user-name .user-level-icon,
.mention-user-name .medal-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-left: 1px;
}

.mention-user-name .badg {
    font-size: 11px;
    padding: 1px 3px;
    margin-left: 2px;
    vertical-align: middle;
}

.mention-user-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mention-user-desc {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}



/* 加载状态 */
.mention-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

.mention-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: mention-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes mention-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 空状态 */
.mention-empty {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 14px;
}

.mention-empty::before {
    content: '👤';
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* 评论中@用户的高亮样式 */
.comment-content .mention-user,
.mention-user {
    color: #007bff;
    font-weight: 500;
    background: rgba(0, 123, 255, 0.1);
    padding: 0 4px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.comment-content .mention-user:hover {
    color: #0056b3;
    background: rgba(0, 123, 255, 0.2);
    text-decoration: underline;
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .mention-user-selector {
        background: #2d3748;
        border-color: #4a5568;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .mention-search-input {
        background: #1a202c;
        border-bottom-color: #4a5568;
        color: #e2e8f0;
    }

    .mention-search-input:focus {
        background: #2d3748;
    }

    .mention-user-list {
        background: #2d3748;
    }

    .mention-user-item {
        border-bottom-color: #4a5568;
    }

    .mention-user-item:hover,
    .mention-user-item.active {
        background: #374151;
    }

    .mention-user-name {
        color: #e2e8f0;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .mention-user-desc {
        color: #a0aec0;
    }

    .mention-user-avatar {
        background: #4a5568;
    }

    .comment-content .mention-user {
        color: #60a5fa;
        background: rgba(96, 165, 250, 0.1);
    }

    .comment-content .mention-user:hover {
        color: #93c5fd;
        background: rgba(96, 165, 250, 0.2);
    }


}

/* 响应式设计 */
@media (max-width: 768px) {

    /* 添加遮罩层 */
    .mention-user-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 99998;
        opacity: 0;
        transition: opacity 0.3s ease;
        display: none;
    }

    .mention-user-overlay.show {
        display: block;
        opacity: 1;
    }

    .mention-user-selector {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        max-height: 60vh !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
        transform: translateY(100%);
        transition: transform 0.3s ease, opacity 0.3s ease !important;
        z-index: 99999;
    }

    .mention-user-selector.show {
        transform: translateY(0) !important;
    }

    .mention-user-list {
        max-height: calc(60vh - 50px);
        padding-bottom: 20px;
    }

    .mention-user-item {
        padding: 12px 16px;
    }

    .mention-user-avatar {
        width: 40px;
        height: 40px;
        margin-right: 12px;
    }

    .mention-user-name {
        font-size: 14px;
    }

    .mention-user-desc {
        font-size: 12px;
    }

    /* 添加底部滑动手势提示 */
    .mention-user-selector::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
    }
}

/* 滚动条样式 */
.mention-user-list::-webkit-scrollbar {
    width: 6px;
}

.mention-user-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.mention-user-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.mention-user-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 暗色主题滚动条 */
@media (prefers-color-scheme: dark) {
    .mention-user-list::-webkit-scrollbar-track {
        background: #2d3748;
    }

    .mention-user-list::-webkit-scrollbar-thumb {
        background: #4a5568;
    }

    .mention-user-list::-webkit-scrollbar-thumb:hover {
        background: #718096;
    }
}