/* 聊天输入框多行样式 */
.chat-input textarea {
    width: 100%;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    box-sizing: border-box;
}

/* 聊天消息自动滚动优化 */
.chat-messages {
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-window {
    position: fixed !important;
    right: 90px !important;
    bottom: 90px !important;
    width: 340px !important;
    max-width: 90vw !important;
    min-height: 420px !important;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(44,62,80,0.18);
    display: none;
    flex-direction: column;
    z-index: 99999;
    transition: box-shadow 0.2s, transform 0.2s;
}
.customer-service .chat-window[style*="display: flex"] {
    display: flex !important;
}

/* 聊天弹窗头部美化 */
.chat-header {
    background: linear-gradient(90deg, #E75480 60%, #F8BBD0 100%);
    color: #C2185B;
    font-weight: 600;
    font-size: 1.08em;
    border-radius: 12px 12px 0 0;
    padding: 14px 18px 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.5px;
}
.chat-header .chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-header .chat-title i {
    font-size: 1.3em;
    margin-right: 2px;
}
.chat-header .close-button {
    background: none;
    border: none;
    color: #C2185B;
    font-size: 1.3em;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.chat-header .close-button:hover {
    opacity: 1;
}

/* 聊天消息气泡 */
.chat-messages {
    padding: 18px 14px 10px 14px;
    background: #f7fafd;
    flex: 1 1 auto;
    min-height: 120px;
    max-height: 320px;
    overflow-y: auto;
    border-bottom: 1px solid #f0f0f0;
}
.message {
    margin-bottom: 10px;
    max-width: 80%;
    word-break: break-all;
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 0.98em;
    line-height: 1.7;
    box-shadow: 0 1px 4px rgba(44,62,80,0.04);
}
.message.customer {
    background: #e3f0fd;
    color: #2C3E50;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.message.service {
    background: #fff;
    color: #E75480;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

/* 输入区美化 */
.chat-input {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: #f7fafd;
    border-radius: 0 0 12px 12px;
    gap: 8px;
}
.chat-input textarea {
    border: 1.5px solid #E75480;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 1em;
    flex: 1 1 auto;
    resize: none;
    background: #fff;
    transition: border 0.2s;
}
.chat-input textarea:focus {
    border: 1.5px solid #E75480;
    outline: none;
}
.chat-input button {
    background: linear-gradient(90deg, #E75480 60%, #F8BBD0 100%);
    color: #C2185B;
    border: none;
    border-radius: 8px;
    padding: 8px 22px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.chat-input button:hover {
    background: linear-gradient(90deg, #E75480 60%, #F8BBD0 100%);
}

/* 客服按钮美化 */
.customer-service-button {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #E75480 60%, #F8BBD0 100%);
    color: #C2185B;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(33,150,243,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    cursor: pointer;
    z-index: 9999;
    transition: box-shadow 0.2s, transform 0.2s;
}
.customer-service-button:hover {
    box-shadow: 0 8px 24px rgba(33,150,243,0.28);
    transform: scale(1.08);
}
.customer-service-button i, .customer-service-button svg {
    color: #C2185B;
    font-size: 2.1rem;
    pointer-events: none;
}

@media (max-width: 600px) {
    .chat-window {
        right: 10px !important;
        bottom: 85px !important;
        width: calc(100vw - 20px) !important;
        max-width: none !important;
        min-height: 0 !important;
        height: 70vh !important;
        max-height: 500px !important;
    }

    .chat-header {
        padding: 12px 15px 10px 15px;
    }

    .chat-messages {
        padding: 15px 10px;
    }

    .message {
        font-size: 0.95em;
    }

    .chat-input {
        padding: 10px;
    }
} 