/**
 * 卡片显示插件 - 前台样式
 */

/* 主框架容器 */
.onlinelive-card-container {
    position: fixed;
    z-index: 9999;
    font-family: "Microsoft YaHei", Arial, sans-serif;
}

/* 主卡片 */
.onlinelive-card-main {
    position: relative;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: visible;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 关闭按钮 */
.onlinelive-card-close {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #ff4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 1.5px solid #fff;
}

.onlinelive-card-close:hover {
    background: #ff6666;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
}

.onlinelive-card-close:active {
    transform: scale(0.95);
}

.onlinelive-card-close span {
    color: #fff;
    font-size: 16px;
    line-height: 1;
    font-weight: bold;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 边框样式一：圆角边框 */
.onlinelive-border-style-1 {
    border: 2px solid #e0e0e0;
    border-radius: 15px;
}

/* 边框样式二：阴影边框 */
.onlinelive-border-style-2 {
    border: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.1);
}

/* 边框样式三：渐变边框 */
.onlinelive-border-style-3 {
    border: 3px solid;
    border-image: linear-gradient(45deg, #667eea 0%, #764ba2 100%) 1;
    border-radius: 10px;
}

/* 边框样式四：立体边框 */
.onlinelive-border-style-4 {
    border: 2px solid #d0d0d0;
    border-top-color: #fff;
    border-left-color: #fff;
    border-right-color: #999;
    border-bottom-color: #999;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.5), inset -1px -1px 0 rgba(0, 0, 0, 0.1);
}

/* 边框样式五：简洁边框 */
.onlinelive-border-style-5 {
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* 头像容器 */
.onlinelive-avatar {
    margin: 12px auto;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 
                0 2px 4px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    background: #fff;
    /* 宽度和高度通过内联样式动态设置 */
}

.onlinelive-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 动画效果一：缩放渐变 */
.onlinelive-animation-1 {
    animation: scaleFade 2s ease-in-out infinite;
}

@keyframes scaleFade {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* 动画效果二：旋转缩放 */
.onlinelive-animation-2 {
    animation: rotateScale 3s ease-in-out infinite;
}

@keyframes rotateScale {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.15) rotate(180deg);
    }
}

/* 动画效果三：弹跳效果 */
.onlinelive-animation-3 {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 动画效果四：呼吸效果 */
.onlinelive-animation-4 {
    animation: breathe 2.5s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

/* 动画效果五：闪烁效果 */
.onlinelive-animation-5 {
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* 标题 */
.onlinelive-title {
    text-align: center;
    font-size: 14px;
    color: #333;
    margin: 8px 0;
    font-weight: bold;
    padding: 0 8px;
}

/* 栏目列表 */
.onlinelive-category-list {
    padding: 0 10px 10px;
}

.onlinelive-category-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin-bottom: 6px;
    background: #f5f5f5;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.onlinelive-category-item:hover {
    background: #e8e8e8;
    transform: translateX(5px);
}

.onlinelive-category-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    flex-shrink: 0;
}

.onlinelive-category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.onlinelive-category-name {
    flex: 1;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 栏目内容文本 */
.onlinelive-category-content {
    padding: 10px 15px;
    font-size: 13px;
    color: #888;
    line-height: 1.6;
    border-top: 1px solid #eee;
    display: none;
    margin-top: 0;
    margin-bottom: 6px;
    background: #fafafa;
    border-radius: 0 0 5px 5px;
}

.onlinelive-category-content.active {
    display: block;
}

/* 底部图标区域 */
.onlinelive-bottom-icons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.onlinelive-bottom-icon {
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.onlinelive-bottom-icon-left {
    position: relative;
    /* 确保预览图片可以超出容器显示 */
    overflow: visible;
}

.onlinelive-bottom-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.onlinelive-bottom-icon:hover {
    transform: scale(1.1);
}

/* 底部图标分隔线 */
.onlinelive-bottom-icon-divider {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 8px;
    flex-shrink: 0;
}

/* 底部图标提示框 */
.onlinelive-bottom-icon-tooltip {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.onlinelive-bottom-icon-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #333;
}

.onlinelive-bottom-icon:hover .onlinelive-bottom-icon-tooltip {
    opacity: 1;
    bottom: 45px;
}

/* 底部左侧图标悬停显示图片 */
.onlinelive-bottom-icon-left-popup {
    position: absolute;
    /* 使用相对定位，相对于图标元素，确保始终在图标左侧 */
    right: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    white-space: nowrap;
    display: block !important;
    visibility: hidden;
    min-width: 200px;
    min-height: 200px;
}

.onlinelive-bottom-icon-left-popup.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.onlinelive-bottom-icon-left-popup-image-wrapper {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(128, 128, 128, 0.3);
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.onlinelive-bottom-icon-left-popup-image {
    max-width: 180px;
    max-height: 180px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* 箭头指向右侧（指向图标） */
.onlinelive-bottom-icon-left-popup::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid rgba(128, 128, 128, 0.3);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.onlinelive-bottom-icon-left-popup::before {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 7px solid #fff;
    z-index: 1;
}

/* 使用CSS hover规则控制显示/隐藏（参考第一版） */
.onlinelive-bottom-icon-left:hover .onlinelive-bottom-icon-left-popup {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    display: block !important;
}

/* 确保悬停时图片容器可见 */
.onlinelive-bottom-icon-left:hover .onlinelive-bottom-icon-left-popup-image-wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.onlinelive-bottom-icon-left:hover .onlinelive-bottom-icon-left-popup-image {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 180px;
    max-height: 180px;
    width: auto;
    height: auto;
}

/* 确保父容器不会裁剪悬停内容 */
.onlinelive-bottom-icons {
    overflow: visible !important;
}

.onlinelive-bottom-icon {
    overflow: visible !important;
}

/* 内容图片弹窗 */
.onlinelive-content-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.onlinelive-content-modal.active {
    display: flex;
}

.onlinelive-content-modal-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.onlinelive-content-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.onlinelive-content-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 箭头指向 */
.onlinelive-arrow-pointer {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 15px solid #fff;
    filter: drop-shadow(-2px 0 2px rgba(0, 0, 0, 0.1));
}

/* 响应式设计 */
@media (max-width: 768px) {
    .onlinelive-card-main {
        transform: scale(0.9);
    }
    
    .onlinelive-avatar {
        width: 60px;
        height: 60px;
    }
    
    .onlinelive-title {
        font-size: 14px;
    }
}

