.fy-chatbot {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2600;
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    color: #fff;
}

.fy-chatbot * {
    box-sizing: border-box;
}

.fy-chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: min(380px, calc(100vw - 32px));
    height: min(580px, calc(100vh - 126px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 218, 166, 0.28);
    border-radius: 24px;
    background:
        radial-gradient(circle at 15% 0%, rgba(255, 205, 119, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(15, 23, 45, 0.98), rgba(8, 13, 28, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(18px);
    transform: translateY(14px) scale(0.98);
    transform-origin: right bottom;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.fy-chatbot.is-open .fy-chatbot-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.fy-chatbot-head {
    padding: 18px 18px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fy-chatbot-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.fy-chatbot-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #c41e3a, #f4b860);
    box-shadow: 0 10px 22px rgba(196, 30, 58, 0.25);
    font-weight: 800;
    letter-spacing: 1px;
}

.fy-chatbot-title {
    min-width: 0;
}

.fy-chatbot-title strong {
    display: block;
    color: #fff4de;
    font-size: 16px;
    line-height: 1.25;
}

.fy-chatbot-title span {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 12px;
    white-space: nowrap;
}

.fy-chatbot-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: background 0.18s ease, transform 0.18s ease;
}

.fy-chatbot-tools {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.fy-chatbot-clear {
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0 11px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 244, 222, 0.82);
    cursor: pointer;
    font-size: 12px;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.fy-chatbot-clear:hover {
    background: rgba(255, 218, 166, 0.12);
    border-color: rgba(255, 218, 166, 0.32);
}

.fy-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

.fy-chatbot-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 218, 166, 0.48) rgba(255, 255, 255, 0.06);
}

.fy-chatbot-msg {
    display: flex;
    margin-bottom: 12px;
}

.fy-chatbot-msg.is-user {
    justify-content: flex-end;
}

.fy-chatbot-bubble {
    max-width: 86%;
    padding: 11px 13px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.65;
    word-break: break-word;
}

.fy-chatbot-msg.is-bot .fy-chatbot-bubble {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top-left-radius: 6px;
}

.fy-chatbot-msg.is-user .fy-chatbot-bubble {
    color: #1a1209;
    background: linear-gradient(135deg, #ffe0af, #f3b456);
    border-top-right-radius: 6px;
    box-shadow: 0 10px 24px rgba(243, 180, 86, 0.18);
}

.fy-chatbot-badge-line {
    margin-bottom: 8px;
}

.fy-chatbot-info-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(139,220,255,.28);
    background: rgba(139,220,255,.10);
    color: #d8f5ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.fy-chatbot-bubble-text {
    white-space: pre-wrap;
}

.fy-chatbot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 14px;
}

.fy-chatbot-actions-inline {
    margin: -2px 0 14px;
    padding-left: 2px;
}

.fy-chatbot-chip {
    border: 1px solid rgba(255, 218, 166, 0.28);
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 244, 222, 0.92);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.fy-chatbot-chip:hover {
    transform: translateY(-1px);
    background: rgba(255, 218, 166, 0.14);
    border-color: rgba(255, 218, 166, 0.52);
}

.fy-chatbot-chip-author {
    background: rgba(139,220,255,.08);
    border-color: rgba(139,220,255,.22);
    color: #d8f5ff;
}

.fy-chatbot-chip-author:hover {
    background: rgba(139,220,255,.14);
    border-color: rgba(139,220,255,.34);
}

.fy-chatbot-foot {
    padding: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 9, 20, 0.42);
}

.fy-chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 2px 8px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    line-height: 1.4;
}

.fy-chatbot-status-dot {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.44);
    box-shadow: 0 0 0 4px rgba(255,255,255,.05);
}

.fy-chatbot-status-dot.is-online {
    background: #7ee6a2;
    box-shadow: 0 0 0 4px rgba(126,230,162,.12);
}

.fy-chatbot-status-dot.is-fallback {
    background: #ffd081;
    box-shadow: 0 0 0 4px rgba(255,208,129,.12);
}

.fy-chatbot-status-dot.is-checking {
    background: #8fb9ff;
    box-shadow: 0 0 0 4px rgba(143,185,255,.12);
}

.fy-chatbot-form {
    display: flex;
    gap: 8px;
}

.fy-chatbot-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 11px 12px;
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
}

.fy-chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.46);
}

.fy-chatbot-input:focus {
    border-color: rgba(255, 218, 166, 0.62);
    box-shadow: 0 0 0 3px rgba(255, 218, 166, 0.12);
}

.fy-chatbot-send {
    width: 54px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #c41e3a, #f4b860);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(196, 30, 58, 0.22);
}

.fy-chatbot-note {
    margin: 8px 2px 0;
    color: rgba(255, 255, 255, 0.44);
    font-size: 11px;
    line-height: 1.55;
}

.fy-chatbot-toggle {
    width: 62px;
    height: 62px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 22px;
    background:
        radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.38), transparent 26%),
        linear-gradient(135deg, #c41e3a, #f4b860);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 16px 36px rgba(196, 30, 58, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fy-chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(196, 30, 58, 0.36);
}

.fy-chatbot-toggle-text {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 1px;
}

.fy-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(10, 16, 34, 0.95);
    border-radius: 999px;
    background: #ffe0af;
    color: #6b110f;
    font-size: 11px;
    font-weight: 800;
}

.fy-chatbot.is-open .fy-chatbot-badge {
    display: none;
}

@media (max-width: 640px) {
    .fy-chatbot {
        right: 14px;
        bottom: 14px;
    }

    .fy-chatbot-panel {
        right: -2px;
        bottom: 72px;
        width: calc(100vw - 24px);
        height: min(560px, calc(100vh - 104px));
        border-radius: 22px;
    }

    .fy-chatbot-toggle {
        width: 58px;
        height: 58px;
        border-radius: 20px;
    }
}

@media (max-width: 390px) {
    .fy-chatbot-head {
        padding-left: 14px;
        padding-right: 14px;
    }

    .fy-chatbot-title span {
        display: none;
    }

    .fy-chatbot-clear {
        padding: 0 9px;
    }
}
