.wy-customer-service-toggle,
.wy-customer-service-overlay {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

.wy-customer-service-toggle {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 2147482998;
    min-width: 126px;
    min-height: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 7px 15px 7px 8px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(103, 232, 249, 0.62);
    border-radius: 18px;
    color: #ecfeff;
    background: linear-gradient(145deg, rgba(8, 19, 35, 0.98), rgba(8, 47, 73, 0.97));
    box-shadow:
        0 15px 36px rgba(2, 132, 199, 0.28),
        0 0 18px rgba(34, 211, 238, 0.18),
        inset 0 1px 0 rgba(207, 250, 254, 0.2);
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.wy-customer-service-toggle::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(108deg, transparent 22%, rgba(103, 232, 249, 0.18) 48%, transparent 72%);
    transform: translateX(-130%);
    animation: wy-customer-service-scan 4.2s ease-in-out infinite;
    pointer-events: none;
}

.wy-customer-service-toggle::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 4px;
    border: 1px solid rgba(125, 211, 252, 0.14);
    border-radius: 13px;
    pointer-events: none;
}

.wy-customer-service-toggle:hover {
    border-color: #67e8f9;
    filter: brightness(1.08);
    box-shadow:
        0 17px 40px rgba(2, 132, 199, 0.34),
        0 0 24px rgba(34, 211, 238, 0.28),
        inset 0 1px 0 rgba(207, 250, 254, 0.25);
}

.wy-customer-service-toggle:focus-visible,
.wy-customer-service-close:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.42);
    outline-offset: 3px;
}

.wy-customer-service-tech-icon {
    position: relative;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
}

.wy-customer-service-tech-ring,
.wy-customer-service-tech-core {
    position: absolute;
    inset: 0;
    clip-path: polygon(25% 5%, 75% 5%, 98% 50%, 75% 95%, 25% 95%, 2% 50%);
}

.wy-customer-service-tech-ring {
    background: conic-gradient(from 0deg, #22d3ee, #2563eb, #a78bfa, #22d3ee);
    animation: wy-customer-service-spin 5s linear infinite;
}

.wy-customer-service-tech-core {
    inset: 2px;
    z-index: 1;
    display: grid;
    place-items: center;
    color: #a5f3fc;
    background:
        radial-gradient(circle at 50% 42%, rgba(34, 211, 238, 0.18), transparent 58%),
        #071827;
    box-shadow: inset 0 0 14px rgba(34, 211, 238, 0.22);
}

.wy-customer-service-tech-core svg {
    width: 29px;
    height: 29px;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.55));
}

.wy-customer-service-tech-copy {
    position: relative;
    z-index: 1;
    min-width: 48px;
    display: grid;
    gap: 5px;
    text-align: left;
}

.wy-customer-service-tech-copy strong {
    color: #f0fdfa;
    font-size: 16px;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.wy-customer-service-tech-copy small {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #67e8f9;
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.wy-customer-service-tech-copy small::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.9);
    animation: wy-customer-service-pulse 2.2s ease-in-out infinite;
}

.wy-customer-service-overlay[hidden] {
    display: none !important;
}

.wy-customer-service-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147482999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.wy-customer-service-dialog {
    position: relative;
    width: min(420px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 30px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 20px;
    color: #0f172a;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
    text-align: center;
    animation: wy-customer-service-in 200ms ease-out;
}

.wy-customer-service-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #475569;
    background: #f1f5f9;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease;
}

.wy-customer-service-close:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.wy-customer-service-close svg {
    width: 22px;
    height: 22px;
}

.wy-customer-service-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 16px;
    color: #0369a1;
    background: #e0f2fe;
}

.wy-customer-service-icon svg {
    width: 28px;
    height: 28px;
}

.wy-customer-service-title {
    margin: 0;
    padding: 0 40px;
    color: #0f172a;
    font-size: 24px;
    font-weight: 850;
    line-height: 1.3;
}

.wy-customer-service-copy {
    margin: 10px 0 20px;
    color: #334155;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.65;
}

.wy-customer-service-qr-card {
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #f8fbff;
}

.wy-customer-service-qr {
    display: block;
    width: min(280px, 72vw);
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
    background: #fff;
}

.wy-customer-service-qr-note {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

body.wy-customer-service-open {
    overflow: hidden !important;
}

@keyframes wy-customer-service-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wy-customer-service-scan {
    0%, 58% {
        transform: translateX(-130%);
    }
    82%, 100% {
        transform: translateX(130%);
    }
}

@keyframes wy-customer-service-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes wy-customer-service-pulse {
    0%, 100% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .wy-customer-service-toggle {
        right: max(14px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
        min-width: 118px;
        min-height: 58px;
        padding: 6px 13px 6px 7px;
        border-radius: 16px;
    }

    .wy-customer-service-tech-icon {
        width: 43px;
        height: 43px;
        flex-basis: 43px;
    }

    .wy-customer-service-overlay {
        padding: 12px;
    }

    .wy-customer-service-dialog {
        max-height: calc(100vh - 24px);
        padding: 26px 18px 20px;
        border-radius: 18px;
    }

    .wy-customer-service-title {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wy-customer-service-toggle,
    .wy-customer-service-close,
    .wy-customer-service-dialog {
        animation: none !important;
        transition: none !important;
    }

    .wy-customer-service-toggle::before,
    .wy-customer-service-tech-ring,
    .wy-customer-service-tech-copy small::before {
        animation: none !important;
    }
}
