/* 触发链接样式 - 使用 span 内联元素 */
.bilibili-user-trigger {
    display: inline;
    cursor: pointer;
}

.bilibili-user-trigger a {
    color: #00a1d6;
    text-decoration: none;
    border-bottom: 1px dashed #00a1d6;
    transition: all 0.2s ease;
}

.bilibili-user-trigger a:hover {
    color: #fb7299;
    border-bottom-color: #fb7299;
}

/* 全局悬浮窗样式 */
.bilibili-user-popup {
    position: fixed;
    width: 340px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    cursor: auto;
    animation: popupFadeIn 0.2s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 悬浮窗箭头 - 朝上（弹窗在下方时） */
.bilibili-user-popup[data-arrow-top="false"]::before {
    content: '';
    position: absolute;
    top: -16px;
    bottom: auto;
    left: 20px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* 悬浮窗箭头 - 朝下（弹窗在上方时） */
.bilibili-user-popup[data-arrow-top="true"]::before {
    content: '';
    position: absolute;
    bottom: -16px;
    top: auto;
    left: 20px;
    border-width: 8px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* 加载状态 */
.user-card-loading {
    padding: 40px;
    text-align: center;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" fill="none" stroke="%2300a1d6" stroke-width="4" stroke-dasharray="100" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="1s" repeatCount="indefinite"/></circle></svg>');
    background-size: 30px;
    background-repeat: no-repeat;
    background-position: center;
    min-height: 100px;
}

/* 卡片头部 */
.user-card-header {
    display: flex;
    padding: 16px;
    border-bottom: 1px solid #e5e9ef;
}

.user-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f4f5f7;
}

.user-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-card-info {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.user-card-name {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    margin-bottom: 8px;
    word-break: break-all;
}

.user-card-name a {
    color: #222;
    text-decoration: none;
}

.user-card-name a:hover {
    color: #00a1d6;
}

.user-card-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

.badge-official {
    background: #ff8a5c;
    color: #fff;
}

.badge-vip {
    background: #fb7299;
    color: #fff;
}

.user-card-level {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

.level-value {
    display: inline-block;
    padding: 2px 8px;
    background: #f4f5f7;
    border-radius: 20px;
}

/* 统计信息 */
.user-card-stats {
    display: flex;
    padding: 12px 16px;
    background: #f6f9fc;
    justify-content: space-around;
    text-align: center;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-size: 18px;
    font-weight: bold;
    color: #222;
}

.stat-label {
    font-size: 11px;
    color: #999;
}

/* 签名 */
.user-card-sign {
    padding: 12px 16px;
    font-size: 13px;
    color: #666;
    border-top: 1px solid #e5e9ef;
    word-break: break-all;
    line-height: 1.5;
    max-height: 100px;
    overflow-y: auto;
}

/* 错误状态 */
.user-card-error {
    padding: 20px;
    text-align: center;
    color: #f25d8e;
    font-size: 13px;
}

/* 响应式 */
@media (max-width: 768px) {
    .bilibili-user-popup {
        width: 280px;
    }
    
    .user-card-stats {
        padding: 10px 12px;
    }
    
    .stat-number {
        font-size: 16px;
    }
}