/* AI 客服客户端 widget 样式 —— 独立命名空间 wyc-*，不依赖任何框架 */

/* 悬浮按钮：蓝色胶囊 —— 机器人客服图标 + Live Chat 文案 */
#wycare-css ~ * .wyc-launcher, .wyc-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    padding: 0 24px 0 20px;
    border-radius: 999px;
    background: -webkit-gradient(linear, left top, right bottom, from(#59a4ff), color-stop(55%, #2f7cf0), to(#2a6fe0));
    background: linear-gradient(135deg, #59a4ff 0%, #2f7cf0 55%, #2a6fe0 100%);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.2px;
    white-space: nowrap;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    box-shadow: 0 10px 24px rgba(47, 124, 240, 0.38), 0 0 0 8px rgba(96, 165, 250, 0.14);
    z-index: 2147483000;
    -webkit-transition: -webkit-transform 0.2s, opacity 0.2s, box-shadow 0.2s;
    transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
}
.wyc-launcher:hover {
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(47, 124, 240, 0.46), 0 0 0 10px rgba(96, 165, 250, 0.16);
}
.wyc-launcher:active { -webkit-transform: translateY(0) scale(0.98); transform: translateY(0) scale(0.98); }
.wyc-launcher.is-hidden { opacity: 0; pointer-events: none; -webkit-transform: scale(0.6); transform: scale(0.6); }
.wyc-launcher svg { display: block; width: 26px; height: 26px; -ms-flex-negative: 0; flex: 0 0 auto; }
.wyc-launcher-label { font-size: 16px; font-weight: 700; }

.wyc-panel {
    position: fixed;
    right: 22px;
    bottom: 90px;
    width: 360px;
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(20, 40, 80, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2147483001;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.98);
    transition: opacity 0.2s, transform 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
}
.wyc-panel.is-open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }

/* 头部 */
.wyc-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #3498db, #2c7be5);
    color: #fff;
    flex: 0 0 auto;
}
.wyc-dot { width: 9px; height: 9px; border-radius: 50%; background: #58d68d; box-shadow: 0 0 0 3px rgba(88, 214, 141, 0.25); }
.wyc-head-title { flex: 1 1 auto; font-weight: 600; font-size: 15px; }
.wyc-head-lang {
    cursor: pointer;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 1px 9px;
    line-height: 18px;
    user-select: none;
}
.wyc-head-lang:hover { background: rgba(255, 255, 255, 0.15); }
.wyc-head-close { cursor: pointer; font-size: 22px; line-height: 1; opacity: 0.85; user-select: none; }
.wyc-head-close:hover { opacity: 1; }

/* 消息区 */
.wyc-body { flex: 1 1 auto; overflow-y: auto; background: #f5f7fa; }
.wyc-msgs { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.wyc-msg { display: flex; }
.wyc-msg.is-user { justify-content: flex-end; }
.wyc-msg.is-ai { justify-content: flex-start; }
.wyc-msg-bubble {
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.65;
    word-break: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.wyc-msg.is-user .wyc-msg-bubble { background: #2c7be5; color: #fff; border-bottom-right-radius: 3px; }
.wyc-msg.is-ai .wyc-msg-bubble { background: #fff; color: #2b3446; border-bottom-left-radius: 3px; }
.wyc-msg.is-agent .wyc-msg-bubble { background: #e8f1ff; color: #1f4fa8; border-bottom-left-radius: 3px; border: 1px solid #cfe0ff; }
.wyc-typing .wyc-msg-bubble { color: #8792a8; font-style: italic; }

/* 留言表单 */
.wyc-leave { display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; }
.wyc-leave-title { font-size: 13px; font-weight: 600; color: #2b3446; }
.wyc-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #dde3ec;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
    background: #fff;
    color: #2b3446;
    resize: none;
    font-family: inherit;
}
.wyc-input:focus { border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.12); }

/* 底部 */
.wyc-foot { flex: 0 0 auto; padding: 0 14px; background: #f5f7fa; }
.wyc-leave-link { font-size: 12px; color: #2c7be5; cursor: pointer; user-select: none; }
.wyc-leave-link:hover { text-decoration: underline; }

/* 输入条 */
.wyc-inputbar {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #eef1f6;
}
.wyc-text {
    flex: 1 1 auto;
    border: 1px solid #dde3ec;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    outline: none;
    color: #2b3446;
    font-family: inherit;
    min-width: 0;
}
.wyc-text:focus { border-color: #3498db; }
.wyc-btn {
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    background: linear-gradient(135deg, #3498db, #2c7be5);
    color: #fff;
    font-family: inherit;
}
.wyc-btn:disabled { opacity: 0.6; cursor: default; }
.wyc-btn-leave { align-self: flex-end; border-radius: 8px; }

/* 移动端 */
@media (max-width: 480px) {
    .wyc-panel {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .wyc-launcher { right: 16px; bottom: 16px; height: 50px; padding: 0 20px 0 16px; gap: 8px; font-size: 15px; }
    .wyc-launcher svg { width: 24px; height: 24px; }
    .wyc-launcher-label { font-size: 15px; }
}

/* 公司联系卡片：打开聊天 / 首条消息时自动推送 */
.wyc-msg-bubble.wyc-contact-card {
    max-width: 88%; width: 88%; padding: 12px 14px 11px;
    border: 1px solid #d9e8ff; border-top: 3px solid #2c7be5;
    background: #fff; border-radius: 10px; white-space: normal;
    box-shadow: 0 3px 12px rgba(44, 123, 229, .12);
}
.wyc-contact-title { font-size: 13px; font-weight: 700; color: #1f4fa8; margin-bottom: 2px; }
.wyc-contact-company { font-size: 12px; color: #5d6b85; margin-bottom: 8px; }
.wyc-contact-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.wyc-contact-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.wyc-contact-label { flex: 0 0 68px; color: #8792a8; font-weight: 600; }
.wyc-contact-value { color: #2b3446; word-break: break-all; text-decoration: none; }
a.wyc-contact-value { color: #2c7be5; }
a.wyc-contact-value:hover { text-decoration: underline; }
.wyc-contact-intro { margin: 0; padding-top: 8px; border-top: 1px dashed #e5ecf7; font-size: 11.5px; color: #6a7b96; line-height: 1.55; }
