/* floating-cs.css - 精致紧凑版，缩小整体比例 */
.floating-cs-wrapper {
    position: fixed;
    bottom: max(120px, 8vh);   /* 提高位置 */
    right: max(12px, 2vw);
    z-index: 9999;
}

/* 主按钮缩小至 44-56px */
.cs-trigger-btn {
    width: clamp(44px, 6vw, 56px);
    height: clamp(44px, 6vw, 56px);
    background: linear-gradient(145deg, #2c5f8a, #1a3f5c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 14px -4px rgba(26, 63, 92, 0.3);
    transition: all 0.25s ease;
    position: relative;
    border: none;
    color: white;
}

.cs-trigger-btn i {
    font-size: clamp(20px, 3.5vw, 26px);
}

.cs-trigger-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 18px -6px rgba(26, 63, 92, 0.4);
}
/* 脉冲光晕同步缩小 */
.pulse-glow::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(44,95,138,0.3), rgba(26,63,92,0));
    z-index: -1;
    animation: pulseGlowAnim 2s infinite;
}

@keyframes pulseGlowAnim {
    0% { opacity: 0.6; transform: scale(0.95); }
    70% { opacity: 0; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(1.2); }
}

/* 面板缩小至 260-320px */
.cs-panel-modern {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    width: clamp(260px, 70vw, 320px);
    max-width: calc(100vw - 24px);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
    overflow: hidden;
}

.floating-cs-wrapper.active .cs-panel-modern {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 头部内边距减小 */
.panel-header {
    background: linear-gradient(115deg, #f8fafd, #fff);
    padding: 10px 14px;
    border-bottom: 1px solid #eef2f8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* 头像缩小至 32-40px */
.avatar-icon {
    width: clamp(32px, 6vw, 40px);
    height: clamp(32px, 6vw, 40px);
    background: linear-gradient(145deg, #3a7ca5, #1e4a6e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: clamp(16px, 3.5vw, 20px);
    box-shadow: 0 4px 8px -4px rgba(0,0,0,0.2);
    overflow: hidden;  /* 确保子元素不溢出圆角 */
    flex-shrink: 0;
}
.avatar-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-icon:hover {
    transform: scale(1.02);
}

.status-dot {
    width: clamp(5px, 1.2vw, 7px);
    height: clamp(5px, 1.2vw, 7px);
    background-color: #2bcd7a;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 1.5px rgba(43,205,122,0.2);
}

.header-text h4 {
    font-size: clamp(0.8rem, 3vw, 0.9rem);
    font-weight: 700;
    color: #1f2f3e;
    margin-bottom: 1px;
}

.header-text p {
    font-size: clamp(0.6rem, 2.2vw, 0.7rem);
    color: #5b7a9a;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

/* 关闭按钮缩小 */
.close-panel-btn {
    background: #f0f3f8;
    width: clamp(24px, 4vw, 28px);
    height: clamp(24px, 4vw, 28px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #7b8ba3;
    transition: all 0.2s;
    font-size: clamp(12px, 2.5vw, 14px);
}

.close-panel-btn:hover {
    background: #e6ecf4;
    color: #2c5f8a;
    transform: rotate(90deg);
}

/* 联系方式列表间距缩小 */
.contact-list {
    padding: 6px 4px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 3px 5px;
    background: #fff;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.contact-item:hover {
    background: #f5f9ff;
    border-color: #e2edff;
    transform: translateX(2px);
}

.contact-icon {
    width: clamp(32px, 6vw, 38px);
    height: clamp(32px, 6vw, 38px);
    background: #eef3fc;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(16px, 3.5vw, 20px);
    color: #2c5f8a;
}

.contact-detail h4 {
    font-size: clamp(0.75rem, 2.8vw, 0.85rem);
    font-weight: 600;
    color: #1e2f3c;
    margin-bottom: 1px;
}

.contact-detail span {
    font-size: clamp(0.6rem, 2.2vw, 0.7rem);
    color: #6c86a3;
}

.contact-arrow {
    color: #b9cef0;
    font-size: clamp(10px, 2vw, 12px);
}

/* 推广横幅缩小 */
.promo-banner-modern {
    background: linear-gradient(105deg, #fef9e6, #fff6e8);
    margin: 6px 12px 14px 12px;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border: 1px solid #ffefcf;
}

.promo-banner-modern:hover {
    background: linear-gradient(105deg, #fff0dc, #ffe8d4);
    transform: scale(0.98);
}

.promo-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.promo-text i {
    font-size: clamp(16px, 3vw, 20px);
    color: #f5a623;
}

.promo-text p {
    font-weight: 600;
    color: #b45f1b;
    font-size: clamp(0.7rem, 2.5vw, 0.8rem);
    margin: 0;
}

.promo-tag {
    background: #f5a62320;
    padding: 3px 8px;
    border-radius: 30px;
    font-size: clamp(0.55rem, 2vw, 0.65rem);
    font-weight: 600;
    color: #c17b2e;
}

/* Toast 提示也稍微缩小 */
.cs-toast-global {
    position: fixed;
    bottom: max(150px, 12vh);   /* 比按钮的 bottom (30px,8vh) 更高，留出空间 */
    right: max(80px, 10vw);    /* 比按钮的 right 稍靠左，避免重叠 */
    background: #1e2a36e6;
    backdrop-filter: blur(12px);
    color: white;
    padding: 6px 14px;
    border-radius: 32px;
    font-size: clamp(0.65rem, 2.2vw, 0.8rem);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    max-width: 85vw;
    white-space: nowrap;
}

/* 二维码弹窗调整 */
.qrcode-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}
.qrcode-modal.active {
    opacity: 1;
    visibility: visible;
}
.qrcode-container {
    background: white;
    border-radius: 28px;
    padding: 18px;
    text-align: center;
    max-width: 260px;
    width: 70vw;
    box-shadow: 0 15px 30px -10px rgba(0,0,0,0.3);
}
.qrcode-container img {
    width: 150px;
    height: 150px;
    margin: 6px auto;
    border-radius: 14px;
}
.qrcode-container p {
    margin: 8px 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e2f3c;
}
.qrcode-container small {
    font-size: 0.65rem;
    color: #6c86a3;
}
.close-modal-btn {
    background: #f0f3f8;
    border: none;
    margin-top: 12px;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.75rem;
    cursor: pointer;
    width: 100%;
}

/* 大屏幕额外限制最大尺寸 */
@media (min-width: 1600px) {
    .cs-trigger-btn { width: 52px; height: 52px; }
    .cs-panel-modern { width: 300px; }
    .avatar-icon { width: 38px; height: 38px; }
    .contact-icon { width: 36px; height: 36px; }
}

/* 极小屏幕确保可点 */
@media (max-width: 480px) {
    .cs-trigger-btn { width: 48px; height: 48px; }
    .cs-panel-modern { width: 280px; }
    .contact-item { padding: 8px 10px; }
    .cs-toast-global { white-space: normal; word-break: keep-all; right: 16px; left: 16px; bottom: 80px; width: auto; text-align: center; }
}
/*智能客服打开当前页面新功能*/
/* 智能客服模态框样式 */
.chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 20001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}
.chat-modal.active {
    opacity: 1;
    visibility: visible;
}
.chat-container {
    width: 90%;
    max-width: 420px;
    min-width: 320px;      /* 根据您的客服页面实际最小宽度调整 */
    height: 560px;
    background: white;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}
@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.chat-header {
    background: linear-gradient(135deg, #2c5f8a, #1a3f5c);
    color: white;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.chat-header h3 {
    margin: 0;
    font-size: 1rem;
}
.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.chat-close:hover {
    background: rgba(255,255,255,0.2);
}
.chat-iframe {
    flex: 1;
    border: none;
    width: 100%;
    height: 100%;
    display: block;
}
@media (max-width: 550px) {
    .chat-container {
        width: 95%;
        height: 85vh;
        max-height: 600px;
    }
}