/* 浮动联系方式容器 */
.contact-box {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 每一项 */
.contact-item {
    position: relative;
    width: 40px; /* 默认只显示图标 */
    min-height: 40px;
    background-color: rgba(255,255,255,0.95); 
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    overflow: visible; 
    transition: width 0.3s ease;
    padding: 0 10px 0 0; /* 保证文字不紧贴右边 */
}

/* 图标固定位置 */
.contact-item img {
    width: 24px;
    height: 24px;
    flex-shrink: 0; /* 不缩小 */
}

/* 文字容器 */
.contact-item span {
    margin-left: 10px;
    white-space: nowrap;
    color: #333;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    flex-shrink: 0; /* 不缩小文字 */
}

/* 悬停展开 */
.contact-item:hover {
    width: auto; /* 自动宽度 */
    padding-left: 10px; /* 图标左边空隙 */
}

/* 悬停显示文字 */
.contact-item:hover span {
    opacity: 1;
}

/* 微信二维码 */
.contact-item.weixin:hover .qr {
    display: block;
}

.contact-item .qr {
    display: none;
    position: absolute;
    left: -140px; 
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 120px;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    z-index: 10000;
}

.contact-item .qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
