:root{
    --cs-primary:#111827;
    --cs-accent:#feee00;
    --cs-surface:#ffffff;
    --cs-muted:#6b7280;
    --cs-line:#e5e7eb;
    --cs-shadow:0 18px 45px rgba(15,23,42,.22);
}

.ns-customer-service{
    position:fixed;
    right:22px;
    bottom:24px;
    z-index:9999;
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:12px;
    font-family:Inter,Arial,"PingFang SC","Microsoft YaHei",sans-serif;
}

.ns-customer-service__panel{
    width:310px;
    padding:16px;
    opacity:0;
    visibility:hidden;
    transform:translateY(12px) scale(.96);
    transform-origin:bottom right;
    background:rgba(255,255,255,.98);
    border:1px solid rgba(17,24,39,.08);
    border-radius:20px;
    box-shadow:var(--cs-shadow);
    backdrop-filter:blur(16px);
    transition:opacity .2s ease,visibility .2s ease,transform .2s ease;
}

.ns-customer-service.is-open .ns-customer-service__panel{
    opacity:1;
    visibility:visible;
    transform:translateY(0) scale(1);
}

.ns-customer-service__header{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:14px;
}

.ns-customer-service__avatar{
    position:relative;
    flex:0 0 46px;
    width:46px;
    height:46px;
    display:grid;
    place-items:center;
    color:var(--cs-accent);
    background:linear-gradient(145deg,#111827,#334155);
    border-radius:15px;
    font-size:20px;
    font-weight:900;
    box-shadow:0 8px 20px rgba(17,24,39,.22);
}

.ns-customer-service__avatar::after{
    content:"";
    position:absolute;
    right:-2px;
    bottom:-2px;
    width:13px;
    height:13px;
    background:#22c55e;
    border:3px solid #fff;
    border-radius:50%;
}

.ns-customer-service__title{
    min-width:0;
    flex:1 1 auto;
}

.ns-customer-service__title strong{
    display:block;
    color:#111827;
    font-size:15px;
    font-weight:850;
}

.ns-customer-service__title span{
    display:block;
    margin-top:2px;
    color:var(--cs-muted);
    font-size:12px;
}

.ns-customer-service__close{
    width:30px;
    height:30px;
    display:grid;
    place-items:center;
    color:#6b7280;
    background:#f3f4f6;
    border:0;
    border-radius:50%;
    cursor:pointer;
}

.ns-customer-service__message{
    margin-bottom:13px;
    padding:12px 13px;
    color:#374151;
    background:#f8fafc;
    border:1px solid #eef2f7;
    border-radius:14px;
    font-size:13px;
    line-height:1.55;
}

.ns-customer-service__actions{
    display:grid;
    gap:9px;
}

.ns-customer-service__action{
    min-height:44px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 13px;
    color:#111827;
    background:#fff;
    border:1px solid var(--cs-line);
    border-radius:12px;
    font-size:13px;
    font-weight:800;
    transition:transform .18s ease,border-color .18s ease,background .18s ease;
}

.ns-customer-service__action:hover{
    transform:translateY(-2px);
    border-color:#cbd5e1;
    background:#f8fafc;
}

.ns-customer-service__action--primary{
    background:var(--cs-accent);
    border-color:#e5d600;
}

.ns-customer-service__action-icon{
    width:30px;
    height:30px;
    display:grid;
    place-items:center;
    background:rgba(17,24,39,.08);
    border-radius:9px;
    font-size:15px;
}

.ns-customer-service__trigger{
    position:relative;
    width:66px;
    height:66px;
    display:grid;
    place-items:center;
    color:var(--cs-accent);
    background:linear-gradient(145deg,#111827,#334155);
    border:0;
    border-radius:22px;
    box-shadow:
        0 14px 30px rgba(15,23,42,.28),
        inset 0 0 0 1px rgba(255,255,255,.08);
    cursor:pointer;
    transition:transform .2s ease,box-shadow .2s ease;
}

.ns-customer-service__trigger:hover{
    transform:translateY(-4px) scale(1.03);
    box-shadow:
        0 18px 38px rgba(15,23,42,.34),
        inset 0 0 0 1px rgba(255,255,255,.10);
}

.ns-customer-service__trigger-icon{
    font-size:28px;
    line-height:1;
}

.ns-customer-service__badge{
    position:absolute;
    top:-5px;
    right:-5px;
    min-width:22px;
    height:22px;
    display:grid;
    place-items:center;
    padding:0 6px;
    color:#111827;
    background:var(--cs-accent);
    border:3px solid #fff;
    border-radius:999px;
    font-size:10px;
    font-weight:950;
}

.ns-customer-service__pulse{
    position:absolute;
    inset:-7px;
    z-index:-1;
    border:2px solid rgba(254,238,0,.55);
    border-radius:26px;
    animation:nsCsPulse 2.2s ease-out infinite;
}

@keyframes nsCsPulse{
    0%{opacity:.75;transform:scale(.92)}
    70%{opacity:0;transform:scale(1.18)}
    100%{opacity:0;transform:scale(1.18)}
}

@media (max-width:768px){
    .ns-customer-service{
        right:12px;
        bottom:84px;
    }

    .ns-customer-service__panel{
        width:min(310px,calc(100vw - 24px));
    }

    .ns-customer-service__trigger{
        width:58px;
        height:58px;
        border-radius:19px;
    }

    .ns-customer-service__trigger-icon{
        font-size:24px;
    }
}

@media (prefers-reduced-motion:reduce){
    .ns-customer-service__pulse{animation:none}
    .ns-customer-service__panel,
    .ns-customer-service__trigger,
    .ns-customer-service__action{transition:none}
}
