/* ========================================
   AI 聊天弹窗组件样式
   前缀: ai-chat-popup
   ======================================== */

/* ----- 遮罩层 ----- */
.ai-chat-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    animation: ai-chat-popup-fadeIn 0.3s ease;
}
.ai-chat-popup-overlay.active {
    display: flex;
}

/* ----- 弹窗容器 ----- */
.ai-chat-popup-modal {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 85vh;
    max-height: 700px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: ai-chat-popup-slideUp 0.3s ease;
}

/* ----- 关闭按钮 ----- */
.ai-chat-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
    padding: 0;
}
.ai-chat-popup-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

/* ----- iframe ----- */
.ai-chat-popup-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ----- 触发按钮/图片（可选样式） ----- */
.ai-chat-popup-trigger {
    cursor: pointer;
    transition: transform 0.2s;
    display: inline-block;
}
.ai-chat-popup-trigger:hover {
    transform: scale(1.05);
}

/* ========================================
   动画
   ======================================== */
@keyframes ai-chat-popup-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes ai-chat-popup-slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========================================
   响应式适配
   ======================================== */
@media (max-width: 640px) {
    .ai-chat-popup-modal {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .ai-chat-popup-close {
        top: 10px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 18px;
        background: rgba(0, 0, 0, 0.6);
    }
}
@media (max-width: 480px) {
    .ai-chat-popup-modal {
        border-radius: 0;
    }
}