#chat-container {
    position: fixed; /* 改成 relative/absolute 也能用！任意位置 */
    bottom: 8.8rem;
    right: 3.3rem;
    z-index: 9999;
    /* 核心：让容器成定位祖先 */
}

#chat-panel {
    position: absolute;
    /* 🔥 左上角锁定：永远对齐按钮左上！ */
    bottom: calc(90%); /* 上方间隙 */
    right: calc(90%);  /* 左侧间隙 */
    width: 280px;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    /* 丝滑动画：从右下滑出 */
    transform: translate(0.5rem, 0.5rem) scale(0.95);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 1rem 0;
}

#chat-container:hover #chat-panel {
    opacity: 1;
    visibility: visible;
    transform: translate(0, 0) scale(1);
}

.chat-panel-header {
    padding: 0 1.5rem 1rem;
    text-align: center;
    color: #0088cc;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid #f0f0f0;
}

.chat-panel-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}
.chat-panel-buttons i{
    margin-right: 12px;
    color: #11c4fd;
}

.telegram-btn {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0088cc, #0066aa);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.telegram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 136, 204, 0.5) !important;
    color: #ffffff !important;
}

.telegram-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.75rem;
    fill: currentColor;
}

#chat-toggle-button {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.75rem 2rem rgba(0, 136, 204, 0.4);
    transition: all 0.2s;
    /* 🔥 确保按钮是定位基准 */
    position: relative;
}

#chat-toggle-button:hover {
    transform: scale(1.1);
    box-shadow: 0 1rem 2.5rem rgba(0, 136, 204, 0.6);
}

#chat-toggle-button svg {
    width: 2.2rem;
    height: 2.2rem;
    stroke: #ffffff;
    stroke-width: 2;
}

/* 🔥 手机适配：位置不变，点击toggle */
@media (max-width: 768px), (hover: none) {
    #chat-container { bottom: 1rem; right: 1rem; }
    #chat-panel { 
        width: 260px; 
        /* 保持左上锁定！ */
        bottom: calc(100% + 0.5rem) !important;
        right: calc(100% + 0.5rem) !important;
        /* 初始隐藏 */
        opacity: 0 !important; 
        visibility: hidden !important; 
        transform: translate(0.5rem, 0.5rem) scale(0.95) !important;
    }
    #chat-container.active #chat-panel { 
        opacity: 1 !important; 
        visibility: visible !important; 
        transform: translate(0, 0) scale(1) !important; 
    }
    
    /* 防出屏：如果太左，微调（可选） */
    @media (max-width: 480px) {
        #chat-panel { right: 100% !important; } /* 紧贴左边 */
    }
}


#chat-toggle-button img {
    width: 60px; /* 按钮大小 */
    height: 60px;
    border-radius: 50%; /* 圆形效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影 */
}
