#yanzi-chat-bubble {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 62px;
    height: 62px;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 899;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 3px solid #7BA0C4;
    outline: none;
    padding: 0;
    overflow: hidden;
}

#yanzi-chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(123,160,196,0.45);
}

#yanzi-chat-bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

#yanzi-chat-bubble .yc-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #68D391;
    border-radius: 50%;
    border: 2px solid white;
}

#yanzi-chat-tooltip {
    position: fixed;
    bottom: 2.1rem;
    right: 5.5rem;
    background: #fff;
    color: #2D3748;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 898;
    animation: ycTooltipIn 0.4s ease-out 2s both;
    cursor: pointer;
}

#yanzi-chat-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #fff;
}

#yanzi-chat-tooltip .yc-tooltip-close {
    display: inline;
    margin-left: 0.5rem;
    color: #A0AEC0;
    cursor: pointer;
    font-size: 0.9rem;
}

#yanzi-chat-tooltip .yc-tooltip-close:hover {
    color: #2D3748;
}

@keyframes ycTooltipIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

#yanzi-chat-panel {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    width: 370px;
    height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
    z-index: 898;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    animation: ycSlideUp 0.25s ease-out;
}

@keyframes ycSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

#yanzi-chat-panel.yc-open {
    display: flex;
}

.yc-header {
    background: linear-gradient(135deg, #3D4F63, #5A8AB5);
    color: white;
    padding: 0.85rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.yc-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.yc-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

.yc-header-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.yc-header-info p {
    font-size: 0.7rem;
    opacity: 0.8;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.yc-online-dot {
    width: 6px;
    height: 6px;
    background: #68D391;
    border-radius: 50%;
    display: inline-block;
}

.yc-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.yc-close:hover {
    background: rgba(255,255,255,0.25);
}

.yc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #F0F5FA;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.yc-messages::-webkit-scrollbar {
    width: 4px;
}

.yc-messages::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 4px;
}

.yc-msg {
    max-width: 82%;
    padding: 0.65rem 0.9rem;
    font-size: 0.84rem;
    line-height: 1.55;
    word-wrap: break-word;
    animation: ycFadeIn 0.2s ease-out;
}

@keyframes ycFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.yc-msg-user {
    background: #7BA0C4;
    color: white;
    border-radius: 14px 14px 4px 14px;
    align-self: flex-end;
}

.yc-msg-bot {
    background: #fff;
    color: #2D3748;
    border: 1px solid #E2E8F0;
    border-radius: 14px 14px 14px 4px;
    align-self: flex-start;
}

.yc-typing {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 14px 14px 14px 4px;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 4px;
    align-items: center;
}

.yc-typing span {
    width: 6px;
    height: 6px;
    background: #A0AEC0;
    border-radius: 50%;
    animation: ycBounce 1.4s infinite;
}

.yc-typing span:nth-child(2) { animation-delay: 0.2s; }
.yc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ycBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

.yc-input-area {
    padding: 0.75rem;
    border-top: 1px solid #E2E8F0;
    display: flex;
    gap: 0.5rem;
    background: #fff;
    flex-shrink: 0;
}

.yc-input-area input {
    flex: 1;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.84rem;
    font-family: 'Inter', -apple-system, sans-serif;
    outline: none;
    transition: border-color 0.2s;
    background: #F7FAFC;
}

.yc-input-area input:focus {
    border-color: #7BA0C4;
    background: #fff;
}

.yc-input-area input::placeholder {
    color: #A0AEC0;
}

.yc-send-btn {
    background: #7BA0C4;
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    min-width: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.yc-send-btn:hover {
    background: #5A8AB5;
}

.yc-send-btn:disabled {
    background: #CBD5E0;
    cursor: not-allowed;
}

.yc-send-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.yc-powered {
    text-align: center;
    padding: 0.4rem;
    font-size: 0.6rem;
    color: #A0AEC0;
    background: #fff;
    border-top: 1px solid #F0F5FA;
}

@media (max-width: 480px) {
    #yanzi-chat-panel {
        width: calc(100vw - 1.5rem);
        right: 0.75rem;
        bottom: 5rem;
        height: 70vh;
        border-radius: 16px 16px 0 0;
    }
}
