.wpfcs-widget {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    z-index: 99999;
    line-height: 1.5;
    box-sizing: border-box;
}

.wpfcs-widget *,
.wpfcs-widget *::before,
.wpfcs-widget *::after {
    box-sizing: inherit;
}

.wpfcs-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    line-height: 1;
    font-family: inherit;
}

.wpfcs-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.wpfcs-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpfcs-toggle-icon svg {
    display: block;
}

.wpfcs-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    position: absolute;
    top: 6px;
    right: 6px;
    animation: wpfcs-pulse 2s infinite;
}

.wpfcs-status-dot.wpfcs-online {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.wpfcs-status-dot.wpfcs-offline {
    background: #9ca3af;
    box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.3);
    animation: none;
}

@keyframes wpfcs-pulse {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.5);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
    }
}

.wpfcs-panel {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(20px);
    width: 280px;
    margin-right: 15px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.wpfcs-widget.wpfcs-active .wpfcs-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

.wpfcs-panel-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
}

.wpfcs-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
}

.wpfcs-status.wpfcs-online {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.wpfcs-status.wpfcs-offline {
    background: rgba(156, 163, 175, 0.15);
    color: #6b7280;
}

.wpfcs-status-dot-small {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.wpfcs-status.wpfcs-online .wpfcs-status-dot-small {
    background: #22c55e;
}

.wpfcs-status.wpfcs-offline .wpfcs-status-dot-small {
    background: #9ca3af;
}

.wpfcs-panel-body {
    padding: 8px 0;
}

.wpfcs-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
    position: relative;
}

.wpfcs-item:hover {
    background: #f9fafb;
}

.wpfcs-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpfcs-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.wpfcs-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.wpfcs-value {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    word-break: break-all;
}

.wpfcs-phone .wpfcs-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.wpfcs-wechat .wpfcs-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #07c160;
}

.wpfcs-wechat .wpfcs-value {
    cursor: pointer;
}

.wpfcs-wechat .wpfcs-value::after {
    content: '📋';
    font-size: 13px;
    margin-left: 6px;
    opacity: 0.6;
}

.wpfcs-wechat:hover .wpfcs-value::after {
    opacity: 1;
}

.wpfcs-copy-hint {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #07c160;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.wpfcs-copy-hint::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid #07c160;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.wpfcs-copy-hint.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.wpfcs-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #07c160 0%, #05984c 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(7, 193, 96, 0.4);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 90%;
}

.wpfcs-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.wpfcs-toast-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpfcs-toast-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px;
}

.wpfcs-toast-content p {
    font-size: 12px;
    margin: 0;
    opacity: 0.95;
}

.wpfcs-qr {
    display: none;
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 15px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
    width: 160px;
}

.wpfcs-wechat:hover .wpfcs-qr {
    display: block;
}

.wpfcs-qr img {
    width: 130px;
    height: 130px;
    display: block;
    margin: 0 auto 8px;
    border-radius: 8px;
}

.wpfcs-qr p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.wpfcs-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #9ca3af;
    transition: all 0.2s;
    padding: 0;
}

.wpfcs-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.wpfcs-close svg {
    display: block;
}

/* ========== 蓝色主题 ========== */
.wpfcs-blue .wpfcs-toggle {
    background: linear-gradient(135deg, #0057B7 0%, #003366 100%);
    color: white;
}

.wpfcs-blue .wpfcs-toggle:hover {
    background: linear-gradient(135deg, #0066d1 0%, #003d7a 100%);
}

.wpfcs-blue .wpfcs-panel-header {
    background: linear-gradient(135deg, #0057B7 0%, #003366 100%);
    color: white;
}

.wpfcs-blue .wpfcs-close {
    color: rgba(255, 255, 255, 0.7);
}

.wpfcs-blue .wpfcs-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.wpfcs-blue .wpfcs-phone .wpfcs-icon {
    background: rgba(0, 87, 183, 0.1);
    color: #0057B7;
}

.wpfcs-blue .wpfcs-wechat .wpfcs-icon {
    background: rgba(0, 87, 183, 0.1);
    color: #0057B7;
}

/* ========== 绿色主题 ========== */
.wpfcs-green .wpfcs-toggle {
    background: linear-gradient(135deg, #07c160 0%, #05984c 100%);
    color: white;
}

.wpfcs-green .wpfcs-toggle:hover {
    background: linear-gradient(135deg, #09d46b 0%, #06a854 100%);
}

.wpfcs-green .wpfcs-panel-header {
    background: linear-gradient(135deg, #07c160 0%, #05984c 100%);
    color: white;
}

.wpfcs-green .wpfcs-close {
    color: rgba(255, 255, 255, 0.7);
}

.wpfcs-green .wpfcs-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ========== 深色主题 ========== */
.wpfcs-dark .wpfcs-toggle {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
}

.wpfcs-dark .wpfcs-toggle:hover {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

.wpfcs-dark .wpfcs-panel-header {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
}

.wpfcs-dark .wpfcs-close {
    color: rgba(255, 255, 255, 0.7);
}

.wpfcs-dark .wpfcs-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.wpfcs-dark .wpfcs-panel {
    background: #1f2937;
}

.wpfcs-dark .wpfcs-item:hover {
    background: #374151;
}

.wpfcs-dark .wpfcs-label {
    color: #9ca3af;
}

.wpfcs-dark .wpfcs-value {
    color: #f3f4f6;
}

.wpfcs-dark .wpfcs-qr {
    background: #1f2937;
}

.wpfcs-dark .wpfcs-qr p {
    color: #9ca3af;
}

/* ========== 隐藏文字时的样式 ========== */
.wpfcs-widget.wpfcs-hide-text .wpfcs-toggle {
    padding: 14px;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    justify-content: center;
}

.wpfcs-widget.wpfcs-hide-text .wpfcs-toggle-text {
    display: none;
}

.wpfcs-widget.wpfcs-hide-text .wpfcs-status-dot {
    top: 4px;
    right: 4px;
}

/* ========== 手机端样式 ========== */
@media (max-width: 767px) {
    .wpfcs-widget {
        right: auto;
        left: 50%;
        top: auto;
        bottom: 16px;
        transform: translateX(-50%);
        width: 85%;
        max-width: 380px;
    }

    .wpfcs-toggle {
        width: 100%;
        justify-content: center;
        height: 50px;
        font-size: 15px;
        border-radius: 25px;
    }

    .wpfcs-status-dot {
        top: 8px;
        right: calc(50% - 70px);
    }

    .wpfcs-panel {
        position: fixed;
        right: auto;
        left: 50%;
        top: auto;
        bottom: 80px;
        transform: translateX(-50%) translateY(20px);
        width: 85%;
        max-width: 380px;
        margin-right: 0;
    }

    .wpfcs-widget.wpfcs-active .wpfcs-panel {
        transform: translateX(-50%) translateY(0);
    }

    .wpfcs-wechat:hover .wpfcs-qr {
        display: none;
    }

    .wpfcs-wechat.wpfcs-qr-open .wpfcs-qr {
        display: block;
        position: fixed;
        right: 50%;
        top: 50%;
        transform: translate(50%, -50%);
        margin-right: 0;
        width: 200px;
        z-index: 999999;
    }

    .wpfcs-wechat.wpfcs-qr-open .wpfcs-qr img {
        width: 170px;
        height: 170px;
    }

    .wpfcs-widget.wpfcs-hide-text .wpfcs-toggle {
        width: 100%;
        border-radius: 25px;
        height: 50px;
    }

    .wpfcs-widget.wpfcs-hide-text .wpfcs-toggle-text {
        display: inline;
    }
}
