/* 右侧悬浮窗核心样式 - 固定向上定位，无JS干扰 */
.float-window {
    position: fixed;
    right: 20px;
    /* 固定向上的位置，不会被JS覆盖 */
    top: 30%;
    transform: translateY(-50%);
    z-index: 500; /* 降低层级，确保不遮挡导航栏 */
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: calc(100vh - 40px);
    overflow: visible;
}

/* 按钮包裹容器 */
.float-btn-wrap {
    position: relative;
}

/* 浮窗按钮通用样式 */
.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-primary);
    border: none;
    outline: none;
    text-decoration: none;
}

.float-btn:hover,
.float-btn:focus {
    background: var(--primary-hover);
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-hover);
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 悬浮提示样式 */
.float-tip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--white);
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    z-index: 600; /* 低于导航栏 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    min-width: 200px;
    text-align: center;
}

/* 悬浮提示三角箭头 */
.float-tip::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 20px;
    height: 20px;
    background: var(--white);
    box-shadow: 5px -5px 10px rgba(0, 0, 0, 0.1);
}

/* 鼠标悬浮按钮时显示提示 */
.float-btn-wrap:hover .float-tip,
.float-btn-wrap:focus-within .float-tip {
    opacity: 1;
    visibility: visible;
    right: 85px;
}

/* 微信二维码弹窗 */
.wechat-popup {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    height: 220px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    padding: 15px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 600; /* 低于导航栏 */
}

.wechat-popup::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 20px;
    height: 20px;
    background: var(--white);
    box-shadow: 5px -5px 10px rgba(0, 0, 0, 0.08);
}

.wechat-popup img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    margin-bottom: 8px;
}

.wechat-popup p {
    font-size: 14px;
    color: var(--text-color);
    text-align: center;
    font-weight: 500;
}

/* 显示二维码 */
.float-btn.wechat-btn:hover + .wechat-popup,
.float-btn.wechat-btn:focus + .wechat-popup {
    display: flex;
}

/* 响应式适配 - 移动端（同步向上调整） */
@media (max-width: 768px) {
    .float-window {
        /* 关键修改：移动端直接隐藏浮窗 */
        display: none !important;
        right: 10px;
        top: 38%;
        transform: translateY(-50%);
        gap: 12px;
        max-height: calc(100vh - 30px);
    }
    .float-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    .float-tip {
        font-size: 16px;
        font-weight: 600;
        padding: 10px 18px;
        min-width: 180px;
        right: 60px;
    }
    .float-btn-wrap:hover .float-tip,
    .float-btn-wrap:focus-within .float-tip {
        right: 75px;
    }
    .float-tip::after {
        width: 16px;
        height: 16px;
        right: -8px;
    }
    .wechat-popup {
        width: 180px;
        height: 200px;
        right: 60px;
    }
    .wechat-popup img {
        width: 150px;
        height: 150px;
    }
    .wechat-popup::after {
        width: 16px;
        height: 16px;
        right: -8px;
    }
}

/* 小屏移动端优化（同步向上调整） */
@media (max-width: 576px) {
    .float-window {
        /* 关键修改：小屏移动端也确保隐藏浮窗 */
        display: none !important;
        right: 8px;
        top: 38%;
        transform: translateY(-50%);
        gap: 10px;
        max-height: calc(100vh - 20px);
    }
    .float-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}