/* FusRock AI 助手 — 与官网 message 弹层 / 品牌色一致 */
.fusrock-ai-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 980;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(145deg, #2f8fc8 0%, #0863c4 55%, #071426 100%);
    box-shadow: 0 14px 40px rgba(7, 20, 38, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.fusrock-ai-launcher:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 18px 48px rgba(47, 143, 200, 0.45);
}
.fusrock-ai-launcher svg {
    width: 26px;
    height: 26px;
}
.fusrock-ai-launcher[aria-expanded="true"] {
    background: linear-gradient(145deg, #123a5b, #2f8fc8);
}

.fusrock-ai-panel {
    position: fixed;
    right: 22px;
    bottom: 92px;
    z-index: 979;
    width: min(400px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.96));
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}
.fusrock-ai-panel::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: 0;
    height: 4px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, #2f8fc8, #38bdf8, #c8ff00);
    z-index: 2;
}
.fusrock-ai-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.fusrock-ai-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 14px;
    background: linear-gradient(135deg, #071426 0%, #123a5b 48%, #2f8fc8 100%);
    color: #fff;
}
.fusrock-ai-head-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.fusrock-ai-head-icon svg {
    width: 22px;
    height: 22px;
}
.fusrock-ai-head-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}
.fusrock-ai-head-text p {
    margin: 4px 0 0;
    font-size: 12px;
    opacity: 0.82;
}
.fusrock-ai-close {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}
.fusrock-ai-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fusrock-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 220px;
    background: #f4f8fc;
}
.fusrock-ai-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
}
.fusrock-ai-msg--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
    border-bottom-left-radius: 4px;
}
.fusrock-ai-msg--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #2f8fc8, #0863c4);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.fusrock-ai-msg--typing {
    opacity: 0.7;
    font-style: italic;
}

.fusrock-ai-compose {
    display: flex;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
}
.fusrock-ai-input {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #0f172a;
    background: #f4f8fc;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.fusrock-ai-input:focus {
    outline: none;
    border-color: rgba(47, 143, 200, 0.5);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(47, 143, 200, 0.12);
}
.fusrock-ai-send {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    color: #071426;
    background: linear-gradient(135deg, #c8ff00, #a8e600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
}
.fusrock-ai-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.fusrock-ai-send:not(:disabled):hover {
    transform: scale(1.05);
}
.fusrock-ai-send svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .fusrock-ai-launcher {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
    }
    .fusrock-ai-panel {
        right: 16px;
        bottom: 82px;
        width: calc(100vw - 32px);
        max-height: calc(100vh - 100px);
    }
}
