/* 所有非移动端设备隐藏 */
#mobileFixed {
    display: none;
}

@media (max-width: 768px) {
    #mobileFixed {
        display: block;
    }
}

/* ========= 移动端底部抽屉式窗口样式开始 ========= */
@media (max-width: 768px) {
    /* 隐藏原有的右侧固定窗口 */
    .st-float-window {
        display: none !important;
    }

    /* 移动端悬浮按钮 - 位置固定在右下角 */
    .mobile-float-btn {
        position: fixed;
        bottom: 20px;
        right: 10px;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, #0052cc, #0a6cff);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 20px rgba(0, 82, 204, 0.4);
        z-index: 99998;
        cursor: pointer;
        transition: all 0.3s ease;
        border: none;
    }

    .mobile-float-btn:active {
        transform: scale(0.95);
    }

    .mobile-float-btn svg {
        width: 28px;
        height: 28px;
        stroke: white;
        fill: none;
    }

    /* 底部抽屉遮罩层 */
    .mobile-drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-drawer-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* 底部抽屉窗口 */
    .mobile-drawer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 24px 24px 0 0;
        z-index: 100000;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
        height: 80vh;
        display: flex;
        flex-direction: column;
    }

    .mobile-drawer.active {
        transform: translateY(0);
    }

    /* 抽屉头部 - 带拖拽条 */
    .mobile-drawer-header {
        padding: 6px 20px 10px;
        border-bottom: 1px solid #eef2f9;
        position: relative;
        text-align: center;
        flex-shrink: 0;
    }

    .mobile-drawer-drag {
        width: 40px;
        height: 4px;
        background: #cbd5e1;
        border-radius: 4px;
        margin: 0 auto 12px;
    }

    .mobile-drawer-title {
        font-size: 18px;
        font-weight: 700;
        color: #0052cc;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .mobile-drawer-title img {
        height: 24px;
    }

    .mobile-drawer-close {
        position: absolute;
        right: 20px;
        top: 16px;
        background: #f1f5f9;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #64748b;
        font-size: 18px;
    }

    .mobile-drawer-close:active {
        background: #e2e8f0;
    }

    /* 抽屉滚动内容区 */
    .mobile-drawer-content {
        flex: 1.5;
        overflow-y: auto;
        padding: 10px 20px;
    }

    .mobile-drawer-content h1 {
        color: #1e293b;
        font-size: 20px;
        margin-bottom: 10px;
    }

    .mobile-drawer-content p {
        color: #1e293b;
        font-size: 12px;
        line-height: 1.6;
        margin-bottom: 16px;
    }

    .mobile-drawer-content a {
        display: block;
        color: #0052cc;
        text-decoration: underline;
        font-size: 12px;
        margin-bottom: 12px;
        word-break: break-all;
    }

    .mobile-drawer-content .quick-link {
        background: #eef3ff;
        padding: 10px;
        border-radius: 12px;
        text-align: center;
    }

    .mobile-drawer-content .quick-link a {
        margin-bottom: 0;
        font-weight: 600;
        text-decoration: none;
    }
}

/* 聊天区域 */
.mobile-st-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f9fafc;
    border-top: 1px solid #e9ecef;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}

.mobile-st-chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9fafc;
}

.mobile-st-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.mobile-st-message.received {
    align-items: flex-start;
    align-self: flex-start;
}

.mobile-st-message.sent {
    align-items: flex-end;
    align-self: flex-end;
}

.mobile-st-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
    background: #ffffff;
    color: #1e2a3e;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.mobile-st-message.sent .mobile-st-message-bubble {
    background: #0052cc;
    border-color: #0052cc;
    color: white;
}

.mobile-st-message-time {
    font-size: 10px;
    color: #8a99b0;
    margin-top: 4px;
}

.mobile-st-chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.mobile-st-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 30px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    background: #ffffff;
    color: #1e2a3e;
}

.mobile-st-chat-input:focus {
    border-color: #0052cc;
    box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.1);
}

.mobile-st-chat-send {
    background: #0052cc;
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-st-chat-send:hover {
    background: #003d99;
}

@media (max-width: 640px) {
    .st-float-window {
        height: 520px;
    }

    .mobile-st-chat-messages {
        padding: 10px;
    }

    .mobile-st-message-bubble {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* ========= 移动端底部抽屉式窗口样式结束 ========= */

/* ========= 思考中的动画效果样式开始 ========= */
.mobile-thinking-dots span {
    animation: blink 1.4s infinite both;
    font-size: 18px;
    font-weight: bold;
}

.mobile-thinking-dots span:nth-child(1) {
    animation-delay: 0s;
}

.mobile-thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.mobile-thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% {
        opacity: 0.2;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0.2;
    }
}

/* 发送按钮禁用样式 */
.mobile-st-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 输入框禁用样式 */
.mobile-st-chat-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* ========= 思考中的动画效果样式结束 ========= */

/* ========= 转人工按钮样式开始 ========= */
.mobile-transfer-manual-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #0052cc 0%, #0077ff 100%);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 82, 204, 0.3);
}

.mobile-transfer-manual-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.4);
    background: linear-gradient(135deg, #0045b3 0%, #0066e6 100%);
}

.mobile-transfer-manual-btn:active {
    transform: translateY(0);
}

/* 消息气泡内按钮容器 */
.mobile-st-message-bubble {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mobile-st-message-bubble .btn-wrapper {
    width: 100%;
    margin-top: 4px;
}

/* ========= 转人工按钮样式结束 ========= */