/**
 * 宝策网主题 - 公共组件样式
 *
 * 浮动栏、联系弹窗、面包屑、分页等。
 */

/* ========== Floating Bar (Right Side) ========== */
.cbj-floating-bar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--cbj-z-floating);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cbj-float-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    background: var(--cbj-bg-white);
    color: var(--cbj-primary);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
    font-size: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--cbj-border-light);
}

.cbj-float-item:hover {
    background: var(--cbj-primary);
    color: var(--cbj-text-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
    border-color: var(--cbj-primary);
}

.cbj-float-item .c_icon {
    font-size: 20px;
    margin-bottom: 3px;
    transition: transform 0.3s ease;
}

.cbj-float-item:hover .c_icon {
    transform: scale(1.15);
}

.cbj-float-item span {
    font-size: 10px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Back to Top */
.cbj-float-top {
    background: var(--cbj-bg-white);
    color: var(--cbj-text-tertiary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cbj-float-top.visible {
    opacity: 1;
    visibility: visible;
}

.cbj-float-top:hover {
    background: var(--cbj-text-secondary);
    color: var(--cbj-text-white);
    border-color: var(--cbj-text-secondary);
}

/* Floating Popups */
.cbj-float-popup {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 12px;
    background: var(--cbj-bg-white);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 16px;
    white-space: nowrap;
    display: none;
    color: var(--cbj-text-primary);
    min-width: 160px;
}

.cbj-float-item:hover .cbj-float-popup {
    display: block;
}

.cbj-popup-arrow {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid var(--cbj-bg-white);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.cbj-float-popup-phone p {
    font-size: 13px;
    color: var(--cbj-text-secondary);
    margin-bottom: 6px;
}

.cbj-float-popup-phone a {
    font-size: 18px;
    font-weight: 700;
    color: var(--cbj-primary);
    letter-spacing: 0.5px;
}

.cbj-float-popup-qrcode {
    text-align: center;
}

.cbj-float-popup-qrcode img {
    width: 140px;
    height: 140px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.cbj-float-popup-qrcode p {
    font-size: 13px;
    color: var(--cbj-text-secondary);
    margin-bottom: 3px;
}

.cbj-wechat-id {
    font-size: 12px;
    color: var(--cbj-text-light);
}

/* ========== Contact Trigger (Left Bottom) ========== */
.cbj-contact-trigger {
    position: fixed;
    left: 20px;
    bottom: 30px;
    z-index: var(--cbj-z-floating);
    cursor: pointer;
}

.cbj-trigger-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.cbj-trigger-inner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.45);
}

.cbj-trigger-inner .c_icon {
    font-size: 18px;
    filter: brightness(0) invert(1);
}

.cbj-trigger-inner span {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* Pulse ring animation */
.cbj-trigger-pulse {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    background: rgba(249, 115, 22, 0.3);
    z-index: 1;
    animation: triggerPulse 2.5s ease-out infinite;
}

@keyframes triggerPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.3, 1.6);
        opacity: 0;
    }
}

/* ========== Contact Popup ========== */
.cbj-contact-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--cbj-z-overlay);
    align-items: center;
    justify-content: center;
}

.cbj-contact-mask.active {
    display: flex;
}

.cbj-contact-popup {
    background: var(--cbj-bg-white);
    border-radius: 16px;
    padding: 40px 35px;
    max-width: 420px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.25);
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cbj-popup-close {
    position: absolute;
    top: 12px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--cbj-text-light);
    cursor: pointer;
    padding: 5px;
    min-width: 44px;
    min-height: 44px;
    line-height: 1;
    transition: color 0.2s;
}

.cbj-popup-close:hover {
    color: var(--cbj-text-primary);
}

.cbj-contact-header h3 {
    font-size: 20px;
    text-align: center;
    margin-bottom: 25px;
    color: var(--cbj-text-primary);
}

.cbj-contact-field {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border: 1px solid var(--cbj-border);
    border-radius: var(--cbj-radius-sm);
    padding: 0 12px;
    transition: var(--cbj-transition-fast);
}

.cbj-contact-field:focus-within {
    border-color: var(--cbj-primary);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
}

.cbj-contact-field .c_icon {
    flex-shrink: 0;
    margin-right: 8px;
    opacity: 0.5;
}

.cbj-contact-field input {
    flex: 1;
    border: none;
    padding: 12px 0;
    font-size: 14px;
    outline: none;
    background: transparent;
    color: var(--cbj-text-primary);
}

.cbj-contact-field input::placeholder {
    color: var(--cbj-text-light);
}

.cbj-contact-form .cbj-btn {
    margin-top: 15px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--cbj-radius-md);
    letter-spacing: 0.05em;
}

.cbj-contact-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--cbj-text-secondary);
}

.cbj-contact-footer .c_icon {
    margin-right: 5px;
}

/* ========== Toast Notification ========== */
.cbj-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--cbj-text-white);
    border-radius: var(--cbj-radius-md);
    font-size: 14px;
    z-index: var(--cbj-z-popup);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.cbj-toast.visible {
    opacity: 1;
    visibility: visible;
}

.cbj-toast.success {
    background: rgba(16, 185, 129, 0.9);
}

.cbj-toast.error {
    background: rgba(231, 56, 39, 0.9);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    /* 移动端隐藏浮动客服栏（后续接入在线客服系统） */
    .cbj-floating-bar {
        display: none;
    }

    .cbj-contact-trigger {
        left: 15px;
        bottom: 20px;
    }

    .cbj-trigger-inner {
        padding: 10px 16px;
    }

    .cbj-trigger-inner .c_icon {
        font-size: 16px;
    }

    .cbj-trigger-inner span {
        font-size: 13px;
    }

    .cbj-contact-popup {
        padding: 25px 20px;
    }
}

@media (max-width: 576px) {
    /* 移动端隐藏浮动客服栏（后续接入在线客服系统） */
    .cbj-floating-bar {
        display: none;
    }

    /* 保留定制方案按钮 */
    .cbj-contact-trigger {
        bottom: 20px;
        left: 15px;
    }

    .cbj-trigger-inner {
        padding: 8px 14px;
        box-shadow: 0 3px 12px rgba(249, 115, 22, 0.3);
    }

    .cbj-trigger-inner .c_icon {
        font-size: 15px;
    }

    .cbj-trigger-inner span {
        font-size: 12px;
    }
}
