/**
 * PC 右侧悬浮导航 — 对齐 GoodBase 模板（尺寸、客服弹层、微信弹层）
 */
.hiwawa-floating-nav-pc {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hiwawa-fn-item {
    position: relative;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.hiwawa-fn-item:hover:not(.hiwawa-fn-checkin--disabled) {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.hiwawa-fn-item i {
    font-size: 18px;
    color: #ff6600;
}

.hiwawa-fn-activity {
    overflow: visible;
    animation: hiwawaFnPulse 1.8s ease-in-out infinite;
}

.hiwawa-fn-activity i {
    color: #ff7a00;
}

.hiwawa-fn-activity__icon {
    transform-origin: 50% 72%;
    will-change: transform;
}

@keyframes hiwawaFnPulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 2px 12px rgba(255, 136, 0, 0.25);
    }
    50% {
        transform: translateY(-1px) scale(1.04);
        box-shadow: 0 6px 18px rgba(255, 136, 0, 0.4);
    }
}

.hiwawa-fn-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hiwawa-fn-confetti-piece {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 10px;
    border-radius: 2px;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg);
    background: #ff7a00;
}

.hiwawa-fn-confetti-piece:nth-child(1) { background: #ff7a00; }
.hiwawa-fn-confetti-piece:nth-child(2) { background: #ffb703; }
.hiwawa-fn-confetti-piece:nth-child(3) { background: #6ee7b7; }
.hiwawa-fn-confetti-piece:nth-child(4) { background: #60a5fa; }
.hiwawa-fn-confetti-piece:nth-child(5) { background: #c084fc; }
.hiwawa-fn-confetti-piece:nth-child(6) { background: #f472b6; }
.hiwawa-fn-confetti-piece:nth-child(7) { background: #34d399; }
.hiwawa-fn-confetti-piece:nth-child(8) { background: #f97316; }

.hiwawa-fn-activity.is-burst .hiwawa-fn-confetti-piece {
    animation: hiwawaConfettiBurst 0.9s ease-out forwards;
}

.hiwawa-fn-activity.is-burst .hiwawa-fn-activity__icon {
    animation: hiwawaGiftWiggle 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.hiwawa-fn-activity.is-burst .hiwawa-fn-confetti-piece:nth-child(1) { --tx: -6px; --ty: -34px; --rot: -28deg; animation-delay: 0s; }
.hiwawa-fn-activity.is-burst .hiwawa-fn-confetti-piece:nth-child(2) { --tx: 8px; --ty: -38px; --rot: 26deg; animation-delay: 0.03s; }
.hiwawa-fn-activity.is-burst .hiwawa-fn-confetti-piece:nth-child(3) { --tx: -24px; --ty: -24px; --rot: -68deg; animation-delay: 0.06s; }
.hiwawa-fn-activity.is-burst .hiwawa-fn-confetti-piece:nth-child(4) { --tx: 24px; --ty: -22px; --rot: 64deg; animation-delay: 0.09s; }
.hiwawa-fn-activity.is-burst .hiwawa-fn-confetti-piece:nth-child(5) { --tx: -28px; --ty: -8px; --rot: -84deg; animation-delay: 0.12s; }
.hiwawa-fn-activity.is-burst .hiwawa-fn-confetti-piece:nth-child(6) { --tx: 30px; --ty: -6px; --rot: 82deg; animation-delay: 0.15s; }
.hiwawa-fn-activity.is-burst .hiwawa-fn-confetti-piece:nth-child(7) { --tx: -18px; --ty: -44px; --rot: -44deg; animation-delay: 0.18s; }
.hiwawa-fn-activity.is-burst .hiwawa-fn-confetti-piece:nth-child(8) { --tx: 18px; --ty: -42px; --rot: 48deg; animation-delay: 0.21s; }

@keyframes hiwawaConfettiBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6) rotate(0deg);
    }
    12% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) rotate(var(--rot));
    }
}

@keyframes hiwawaGiftWiggle {
    0% {
        transform: translateX(0) rotate(0deg);
    }
    16% {
        transform: translateX(-1px) rotate(-13deg);
    }
    32% {
        transform: translateX(1px) rotate(11deg);
    }
    48% {
        transform: translateX(-1px) rotate(-8deg);
    }
    64% {
        transform: translateX(1px) rotate(6deg);
    }
    82% {
        transform: translateX(0) rotate(-3deg);
    }
    100% {
        transform: translateX(0) rotate(0deg);
    }
}

.hiwawa-fn-checkin--disabled {
    cursor: not-allowed;
    opacity: 0.65;
    pointer-events: none;
}

/* 窄条 tooltip（VIP / 签到）— GoodBase 同款 */
.hiwawa-fn-tooltip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #ff6600;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.hiwawa-fn-tooltip::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #ffffff;
}

.hiwawa-fn-item:hover .hiwawa-fn-tooltip {
    opacity: 1;
    visibility: visible;
}

/* 互斥 */
.hiwawa-floating-nav-pc.is-mutex .hiwawa-fn-item.hiwawa-fn-hide-tip .hiwawa-fn-tooltip,
.hiwawa-floating-nav-pc.is-mutex .hiwawa-fn-item.hiwawa-fn-hide-tip .hiwawa-fn-wechat-popup,
.hiwawa-floating-nav-pc.is-mutex .hiwawa-fn-item.hiwawa-fn-hide-tip .hiwawa-fn-service-popup {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ========== 联系客服弹层（GoodBase .floating-phone-popup） ========== */
.hiwawa-fn-service {
    overflow: visible;
}

.hiwawa-fn-service::before {
    content: "";
    position: absolute;
    right: 100%;
    top: 0;
    bottom: 0;
    width: 16px;
    z-index: 9;
}

.hiwawa-fn-service-popup {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    width: 180px;
    padding: 16px;
    border-radius: 12px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #e8f4ff 0%, #ffffff 100%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.hiwawa-fn-service:hover .hiwawa-fn-service-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.hiwawa-fn-service-popup::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #f0f8ff;
}

.hiwawa-fn-service-popup__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #1890ff;
}

.hiwawa-fn-service-popup__header i {
    font-size: 14px;
    color: #1890ff;
}

.hiwawa-fn-service-popup__buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.hiwawa-fn-service-popup__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    background: #ffffff;
    color: #ff6600;
    border: 1px solid #ff6600;
    box-sizing: border-box;
}

.hiwawa-fn-service-popup__btn:hover {
    background: #fff5f0;
}

.hiwawa-fn-service-popup__btn i {
    font-size: 14px;
    color: #ff6600;
}

.hiwawa-fn-service-popup__notice {
    font-size: 11px;
    color: #666;
    text-align: center;
    margin-bottom: 10px;
}

.hiwawa-fn-service-popup__verify {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1890ff;
    background: rgba(24, 144, 255, 0.08);
    padding: 8px 12px;
    border-radius: 4px;
}

.hiwawa-fn-service-popup__verify i {
    font-size: 14px;
}

/* ========== 微信二维码弹层（GoodBase 结构 + 橙色强调参考图） ========== */
.hiwawa-fn-wechat {
    overflow: visible;
}

.hiwawa-fn-wechat::before {
    content: "";
    position: absolute;
    right: 100%;
    top: 0;
    bottom: 0;
    width: 16px;
    z-index: 9;
}

.hiwawa-fn-wechat-popup {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    padding: 14px 16px 16px;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    z-index: 10;
    pointer-events: none;
    min-width: 156px;
    box-sizing: border-box;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.hiwawa-fn-wechat:hover .hiwawa-fn-wechat-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.hiwawa-fn-wechat-popup::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #ffffff;
}

.hiwawa-fn-wechat-popup__title {
    font-size: 13px;
    font-weight: 700;
    color: #ff6600;
    text-align: center;
    margin: 0 0 12px;
    line-height: 1.35;
}

.hiwawa-fn-wechat-popup__qr {
    width: 128px;
    height: 128px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: #fff;
    border-radius: 12px;
    border: 2px dashed #ff6600;
    box-sizing: border-box;
    overflow: hidden;
}

.hiwawa-fn-wechat-popup__qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hiwawa-fn-wechat-popup__tip {
    font-size: 12px;
    font-weight: 500;
    color: #ff6600;
    text-align: center;
    margin: 12px 0 0;
    line-height: 1.4;
}

.hiwawa-fn-wechat--empty .hiwawa-fn-wechat-popup__tip {
    margin-top: 8px;
    opacity: 0.85;
}

.hiwawa-fn-wechat-popup__placeholder {
    font-size: 12px;
    color: #666;
    text-align: center;
    line-height: 1.55;
    max-width: 220px;
}

@media (max-width: 1024px) {
    .hiwawa-floating-nav-pc {
        display: none;
    }
}

@media (min-width: 1600px) {
    .hiwawa-floating-nav-pc {
        right: 40px;
    }
}
