/* 多渠道咨询弹窗样式 */

/* 主触发按钮 - 保持右侧贴边布局 */
.multi-consultation-trigger {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998; /* 降低触发按钮层级，确保面板在上方 */
    background: linear-gradient(135deg, #0098ef 0%, #2563eb 100%);
    color: white;
    border-radius: 35px 0 0 35px;
    height: 200px;
    width: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 152, 239, 0.3);
    overflow: hidden;
}

.multi-consultation-trigger:hover {
    transform: translateY(-50%) translateX(-5px);
    box-shadow: 0 6px 30px rgba(0, 152, 239, 0.4);
}

.multi-consultation-trigger .trigger-icon {
    font-size: 28px;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

.multi-consultation-trigger .trigger-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 18px;
    letter-spacing: 4px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* 呼吸灯动画 */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* 扩展面板 */
.multi-consultation-panel {
    position: fixed;
    right: 10px; /* 稍微向左偏移，避免被触发按钮遮挡 */
    top: 50%;
    transform: translateY(-50%) translateX(100%);
    z-index: 10001; /* 确保面板在最上层 */
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    width: 320px;
    max-height: 600px;
    /* 修改：使用flex布局以更好地控制内容分布 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    visibility: hidden;
}

.multi-consultation-panel.active {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    visibility: visible;
}

/* PC端：面板展开时，调整触发按钮的透明度和层级 */
.multi-consultation-panel.active + .multi-consultation-trigger {
    opacity: 0.7;
    z-index: 9997;
}

.consultation-header {
    background: linear-gradient(135deg, #0098ef 0%, #2563eb 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.consultation-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.consultation-header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close-btn:hover {
    opacity: 1;
}

.consultation-options {
    padding: 0px;
    /* 修改：当留言表单显示时，调整滚动区域高度 */
    max-height: calc(600px - 80px); /* 减去头部高度 */
    overflow-y: auto;
    /* 确保滚动区域包含留言表单 */
    flex: 1;
    display: flex;
    flex-direction: column;
    /* 添加相对定位，作为表单的定位参考 */
    position: relative;
    
    /* 优化滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: #0098ef #f1f1f1;
}

/* Webkit浏览器滚动条样式 */
.consultation-options::-webkit-scrollbar {
    width: 6px;
}

.consultation-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.consultation-options::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0098ef 0%, #2563eb 100%);
    border-radius: 3px;
}

.consultation-options::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #007acc 0%, #1d4ed8 100%);
}

.consultation-option {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.consultation-option:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f3ff 100%);
    border-color: #0098ef;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 152, 239, 0.15);
}

.consultation-option:last-child {
    margin-bottom: 0;
}

.option-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 30px;
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.option-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.15;
    border-radius: 50%;
}

.option-content {
    flex: 1;
}

.option-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
}

.option-desc {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.option-arrow {
    font-size: 16px;
    color: #999;
    transition: all 0.3s ease;
}

.consultation-option:hover .option-arrow {
    color: #0098ef;
    transform: translateX(3px);
}

/* 不同渠道的主题色 */
.wechat-option .option-icon { background: #07C160; }
.dingtalk-option .option-icon { background: #0089FF; }
.feishu-option .option-icon { background: #3370FF; }
.phone-option .option-icon { background: #FF6B35; }
.email-option .option-icon { background: #7C3AED; }
.message-option .option-icon { background: #F59E0B; }

/* 二维码弹窗 */
.qrcode-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.qrcode-modal.active {
    opacity: 1;
    visibility: visible;
}

.qrcode-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.qrcode-modal.active .qrcode-content {
    transform: scale(1);
}

.qrcode-content h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
}

.qrcode-content img {
    width: 200px;
    height: 200px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.qrcode-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* 留言表单 */
.message-form {
    /* 初始状态：隐藏在咨询选项底部 */
    padding: 20px;
    background: #fafbfc;
    border-top: 1px solid #eee;
    border-radius: 0 0 15px 15px;
    
    /* 默认隐藏 */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
}

.message-form.active {
    /* 激活状态：显示表单 */
    max-height: 600px; /* 足够的高度容纳表单内容 */
    opacity: 1;
    overflow-y: auto; /* 允许滚动 */
    /* 自定义滚动条 */
    scrollbar-width: thin;
    scrollbar-color: #0098ef #f1f1f1;
}

/* 留言表单滚动条样式 */
.message-form::-webkit-scrollbar {
    width: 6px;
}

.message-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.message-form::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0098ef 0%, #2563eb 100%);
    border-radius: 3px;
}

.message-form::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #007acc 0%, #1d4ed8 100%);
}

/* 当留言表单显示时，隐藏咨询选项 */
.consultation-options.form-active {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 正常状态的咨询选项 */
.consultation-options {
    transition: all 0.3s ease;
}

/* 表单头部 */
.form-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.back-btn {
    background: none;
    border: none;
    color: #0098ef;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-right: 15px;
}

.back-btn:hover {
    background: #f0f8ff;
    color: #007acc;
}

.form-header h4 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0098ef;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0098ef 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* 确保按钮始终可见 */
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 152, 239, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 移动端适配 - 保持右侧贴边 */
@media (max-width: 768px) {
    .multi-consultation-trigger {
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        height: 180px;
        width: 60px;
        border-radius: 30px 0 0 30px;
        flex-direction: column;
        padding: 10px 8px;
        z-index: 9998; /* 降低触发按钮层级，确保面板在上方 */
    }

    .multi-consultation-trigger .trigger-text {
        writing-mode: vertical-rl;
        text-orientation: upright;
        font-size: 16px;
        margin-left: 0;
        letter-spacing: 3px;
    }

    .multi-consultation-trigger .trigger-icon {
        font-size: 26px;
        margin-bottom: 8px;
    }

    .multi-consultation-panel {
        right: 10px; /* 稍微向左偏移，避免被触发按钮挡住 */
        top: 50%;
        transform: translateY(-50%) translateX(100%);
        width: 300px;
        max-width: calc(100vw - 80px);
        margin: 0;
        left: auto;
        margin-left: 0;
        border-radius: 15px;
        /* 移动端增加最大高度限制 */
        max-height: 520px;
        z-index: 10001; /* 确保面板在最上层 */
    }

    .multi-consultation-panel.active {
        transform: translateY(-50%) translateX(0);
    }

    /* 面板展开时，调整触发按钮的透明度和层级 */
    .multi-consultation-panel.active ~ .multi-consultation-trigger {
        opacity: 0.7;
        z-index: 9997;
    }

    /* 移动端调整咨询选项容器高度 */
    .consultation-options {
        max-height: calc(520px - 100px);
    }

    .option-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .option-title {
        font-size: 16px;
    }

    .option-desc {
        font-size: 13px;
    }

    /* 移动端留言表单优化 */
    .message-form {
        padding: 15px;
    }
    
    .message-form.active {
        max-height: calc(520px - 120px); /* 移动端限制高度 */
    }
    
    .form-header {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .form-header h4 {
        font-size: 16px;
    }
    
    .back-btn {
        font-size: 13px;
        padding: 6px 10px;
        margin-right: 10px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 16px; /* 防止iOS缩放 */
    }
}

/* 动画效果增强 */
.consultation-option {
    animation: slideInUp 0.3s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.consultation-option:nth-child(1) { animation-delay: 0.1s; }
.consultation-option:nth-child(2) { animation-delay: 0.2s; }
.consultation-option:nth-child(3) { animation-delay: 0.3s; }
.consultation-option:nth-child(4) { animation-delay: 0.4s; }
.consultation-option:nth-child(5) { animation-delay: 0.5s; }
.consultation-option:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 通知徽章 */
.notification-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* 悬停光效 */
.consultation-option::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.consultation-option:hover::after {
    left: 100%;
}