.chatbot-trigger {
    position: fixed;
    right: 0.7rem;
    /* 核心定位调整：让按钮最下方接近页面中间（页面高度50%处） */
    bottom: 35%;
    top: 54%;
    /* 宽度保持紧凑：仅适配图标和单个竖排文字 */
    width: 44px;
    /* 高度自动但通过内容压缩变短：取消多余内边距和间距 */
    height: auto;
    background: #409EFF;
    color: white;
    border-radius: 12px; /* 宽度一半，保持圆润感 */
    display: flex;
    flex-direction: column; /* 图标在上+竖排文字在下 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(64, 158, 255, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    /* 压缩上下内边距：从8px减至5px，缩短按钮长度 */
    padding: 5px 0;
    /* 压缩图标与文字间距：从8px减至4px，进一步缩短 */
    gap: 4px;
}

/* 图标缩小：从18px减至16px，适配紧凑宽度 */
.chatbot-trigger .el-icon-chat-dot-round {
    font-size: 16px;
}

/* 竖排文字压缩：减小字号和字间距，缩短纵向长度 */
.chatbot-trigger .chatbot-text {
    font-size: 11px; /* 字号从12px缩小至11px */
    font-weight: 500;
    writing-mode: vertical-rl; /* 文字竖排（单个汉字上下） */
    letter-spacing: 1px; /* 字间距从2px减至1px，大幅缩短长度 */
    width: 11px; /* 匹配文字尺寸，避免偏移 */
}

/* 保留hover效果，适配紧凑尺寸 */
.chatbot-trigger:hover {
    background: #66b1ff;
    transform: scale(1.05);
}

.chatbot-trigger i {
    font-size: 24px;
}

.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 57px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
    display: none;
    flex-direction: column;
    transition: all 0.3s ease;
}

.chatbot-container.active {
    display: flex;
    width: 50%;
    height: 87%;
}

.chatbot-header {
    background: #409EFF;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-btn {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-container iframe {
    flex: 1;
    width: 100%;
    border: none;
}
/* 响应式设计 */
@media (max-width: 768px) {
    .home {
        padding: 15px;
    }

    .index-btn-box {
        grid-template-columns: 1fr;
    }

    .el-card__body {
        padding: 20px;
    }

    .chatbot-container {
        width: 50%;
        right: 10%;
        bottom: 80px;
        height: 87%;
    }

    .chatbot-trigger {
        bottom: 20px;
        right: 20px;
    }
}

/* 新增：控制栏（最小化+最大化图标） */
.chatbot-control-bar {
    height: 30px;
    background: #409EFF; /* 与触发按钮同色系，保持风格统一 */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* 图标靠右排列 */
    padding: 0 12px;
    cursor: pointer;
}

/* 控制栏图标样式：间距+ hover效果 */
/* 控制栏图标通用样式（适配Element图标和“口”字符） */
.chatbot-control-bar i,
.chatbot-control-bar .max-icon {
    font-size: 16px; /* 图标/字符大小统一 */
    margin-left: 16px; /* 图标间距不变 */
    transition: all 0.2s ease;
    /*font-weight: 500; !* 字符“口”加粗更清晰 *!*/
}

/* hover效果：统一放大反馈 */
.chatbot-control-bar i,
.chatbot-control-bar .max-icon {
    font-size: 16px; /* 图标/字符大小统一 */
    margin-left: 16px; /* 图标间距不变 */
    transition: all 0.2s ease;
    font-weight: 500; /* 字符“口”加粗更清晰 */
}

/* hover效果：统一放大反馈 */
.chatbot-control-bar i:hover,
.chatbot-control-bar .max-icon:hover {
    transform: scale(1.1);
}

/* iframe：占满容器，无边框 */
.chatbot-container iframe {
    width: 100%;
    height: calc(100% - 40px); /* 减去控制栏高度，避免溢出 */
    border: none; /* 清除iframe默认边框 */
}
