/* ============================================
   右侧悬浮在线客服样式
   ============================================ */

.side-contact {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.side-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.side-contact-item {
    position: relative;
    display: block;
    width: 44px;
    height: 44px;
    background: #222;
    border-radius: 4px 0 0 4px;
    transition: all 0.3s ease;
    overflow: visible;
    cursor: pointer;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.15);
}

.side-contact-item:hover {
    width: 160px;
    background: #c00;
}

.side-contact-item:nth-child(1) {
    background: #25a54a;
}
.side-contact-item:nth-child(2) {
    background: #d14836;
}
.side-contact-item:nth-child(3) {
    background: #25d366;
}
.side-contact-item:nth-child(4) {
    background: #1877f2;
}
.side-contact-item:nth-child(5) {
    background: #ff0000;
}
.side-contact-item:nth-child(6) {
    background: #555;
}

.side-contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 0 14px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.side-contact-link .fa {
    font-size: 18px;
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    color: #ffffff;
}

.side-contact-label {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #ffffff;
}

.side-contact-item:hover .side-contact-label {
    display: inline;
    opacity: 1;
}

.side-contact-item:hover .side-contact-link {
    gap: 12px;
}

/* ============================================
   弹出信息 - 白色文字（仅PC显示）
   ============================================ */
.side-contact-popup {
    display: none;
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 12px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 8px;
    padding: 14px 18px;
    min-width: 200px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    border: none;
    pointer-events: none;
}

.side-contact-popup::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 8px solid rgba(0, 0, 0, 0.85);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.side-contact-popup .popup-content {
    font-size: 14px;
    color: #ffffff !important;
    line-height: 1.6;
}

.side-contact-popup .popup-content strong {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6) !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
    font-weight: 600;
}

.side-contact-popup .popup-content p {
    margin: 0;
    padding: 0;
}

.side-contact-popup .popup-content a {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.side-contact-popup .popup-content a:hover {
    text-decoration: underline;
    color: #ffffff !important;
}

.side-contact-popup .popup-content .fa,
.side-contact-popup .popup-content i {
    color: #ffffff !important;
}

/* 悬浮时显示弹出信息（仅PC） */
.side-contact-item:hover .side-contact-popup {
    display: block;
}

/* ---------- 返回顶部特殊样式 ---------- */
.side-contact-top {
    margin-top: 4px;
    border-radius: 4px 0 0 4px;
}

.side-contact-top .side-contact-link {
    justify-content: center;
}

/* ============================================
   手机版 - 隐藏弹出框，只显示图标
   ============================================ */
@media (max-width: 768px) {
    .side-contact {
        top: auto;
        bottom: 80px;
        transform: none;
        right: 10px;
    }

    .side-contact-item {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin-bottom: 4px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    /* 手机版：悬浮/点击不展开宽度 */
    .side-contact-item:hover {
        width: 40px;
        background: inherit;
        /* 保持原背景色 */;
    }

    .side-contact-item:nth-child(1):hover {
        background: #25a54a;
    }
    .side-contact-item:nth-child(2):hover {
        background: #d14836;
    }
    .side-contact-item:nth-child(3):hover {
        background: #25d366;
    }
    .side-contact-item:nth-child(4):hover {
        background: #1877f2;
    }
    .side-contact-item:nth-child(5):hover {
        background: #ff0000;
    }
    .side-contact-item:nth-child(6):hover {
        background: #555;
    }

    .side-contact-link {
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .side-contact-link .fa {
        font-size: 16px;
        width: 16px;
        color: #ffffff;
    }

    /* 手机版隐藏文字标签 */
    .side-contact-label {
        display: none !important;
    }

    /* 手机版隐藏弹出信息 */
    .side-contact-popup {
        display: none !important;
    }

    /* 手机版隐藏返回顶部 */
    .side-contact-item:nth-child(6) {
        display: none;
    }
}

/* ============================================
   手机小屏适配 (≤480px)
   ============================================ */
@media (max-width: 480px) {
    .side-contact {
        bottom: 70px;
        right: 6px;
    }

    .side-contact-item {
        width: 36px;
        height: 36px;
    }

    .side-contact-link .fa {
        font-size: 14px;
        width: 14px;
    }
}

/* ============================================
   暗色模式
   ============================================ */
@media (prefers-color-scheme: dark) {
    .side-contact-popup {
        background: rgba(20, 20, 20, 0.92);
    }

    .side-contact-popup::after {
        border-left-color: rgba(20, 20, 20, 0.92);
    }

    .side-contact-popup .popup-content {
        color: #ffffff !important;
    }

    .side-contact-popup .popup-content strong {
        color: rgba(255, 255, 255, 0.5) !important;
    }

    .side-contact-popup .popup-content a {
        color: #ffffff !important;
    }

    .side-contact-popup .popup-content a:hover {
        color: #ffffff !important;
    }

    .side-contact-popup .popup-content .fa,
    .side-contact-popup .popup-content i {
        color: #ffffff !important;
    }
}

/* ============================================
   减少动画
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .side-contact-item {
        transition: none !important;
    }

    .side-contact-link {
        transition: none !important;
    }

    .side-contact-label {
        transition: none !important;
    }
}