/* ============================================================
   iModel 专属客服浮窗 v2.1.2
   所有规则加 #iml-cw-root 前缀 + !important 防止主题污染
   ============================================================ */

/* ── 根容器 ─────────────────────────────────────────────── */
#iml-cw-root {
    position: fixed !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    font-family: "PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif !important;
    font-size: 14px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}
#iml-cw-root *, #iml-cw-root *::before, #iml-cw-root *::after {
    box-sizing: border-box !important;
    font-family: "PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif !important;
}

/* ── 触发按钮 ────────────────────────────────────────────── */
#iml-cw-root #iml-cw-toggle {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 46px !important;
    padding: 14px 0 !important;
    margin: 0 !important;
    background: #1a6bcc !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px 0 0 10px !important;
    cursor: pointer !important;
    box-shadow: -2px 0 14px rgba(26,107,204,.32) !important;
    transition: background .18s !important;
    line-height: 1 !important;
    text-decoration: none !important;
    outline: none !important;
}
#iml-cw-root #iml-cw-toggle:hover {
    background: #0d1b2e !important;
}
#iml-cw-root #iml-cw-toggle .iml-cw-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#iml-cw-root #iml-cw-toggle .iml-cw-icon svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    fill: none !important;
    stroke: #fff !important;
}
#iml-cw-root .iml-cw-toggle-label {
    font-size: 10.5px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    text-align: center !important;
    letter-spacing: .3px !important;
    color: #fff !important;
}

/* ── 展开面板 ────────────────────────────────────────────── */
#iml-cw-root #iml-cw-panel {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: #fff !important;
    border: 1px solid #d4e3f5 !important;
    border-right: none !important;
    border-radius: 12px 0 0 12px !important;
    box-shadow: -3px 0 22px rgba(26,107,204,.13) !important;
    width: 86px !important;
    padding: 8px 0 10px !important;
    margin: 0 !important;
    animation: imlSlideIn .18s ease !important;
}
@keyframes imlSlideIn {
    from { opacity: 0; transform: translateY(-50%) translateX(14px); }
    to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}

#iml-cw-root .iml-cw-close {
    position: absolute !important;
    top: 4px !important;
    right: 5px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: #b8c8d8 !important;
    padding: 2px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 3px !important;
    transition: color .15s !important;
    line-height: 1 !important;
}
#iml-cw-root .iml-cw-close:hover { color: #1a6bcc !important; }
#iml-cw-root .iml-cw-close svg {
    width: 11px !important;
    height: 11px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
}

/* ── 按钮列表 ────────────────────────────────────────────── */
#iml-cw-root .iml-cw-list {
    list-style: none !important;
    margin: 14px 0 0 !important;
    padding: 0 !important;
}
#iml-cw-root .iml-cw-list li {
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}
#iml-cw-root .iml-cw-list li:not(:last-child)::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 12px !important;
    right: 12px !important;
    height: 1px !important;
    background: #edf1f7 !important;
    display: block !important;
}

#iml-cw-root .iml-cw-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 100% !important;
    padding: 10px 0 11px !important;
    margin: 0 !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    text-decoration: none !important;
    color: #2d3748 !important;
    cursor: pointer !important;
    transition: background-color .12s !important;
    line-height: 1 !important;
    outline: none !important;
    box-shadow: none !important;
}
#iml-cw-root .iml-cw-item:hover {
    background-color: #f0f5fc !important;
    text-decoration: none !important;
    color: #2d3748 !important;
}

/* 图标圆形 */
#iml-cw-root .iml-cw-item-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background-color: #e8f0fb !important;
    color: #1a6bcc !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color .15s, color .15s !important;
    border: 1.5px solid #c5d9f5 !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}
#iml-cw-root .iml-cw-item-icon svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
}
#iml-cw-root .iml-cw-item:hover .iml-cw-item-icon {
    background-color: #1a6bcc !important;
    color: #fff !important;
    border-color: #1a6bcc !important;
}

/* 专属客服主按钮 */
#iml-cw-root .iml-cw-item.iml-cw-primary .iml-cw-item-icon {
    background-color: #0d1b2e !important;
    color: #c9a84c !important;
    border-color: #0d1b2e !important;
}
#iml-cw-root .iml-cw-item.iml-cw-primary:hover .iml-cw-item-icon {
    background-color: #1a6bcc !important;
    color: #fff !important;
    border-color: #1a6bcc !important;
}

/* 微信图标（fill not stroke） */
#iml-cw-root .iml-cw-item-icon svg.iml-fill {
    fill: currentColor !important;
    stroke: none !important;
}

#iml-cw-root .iml-cw-item-label {
    font-size: 10.5px !important;
    font-weight: 600 !important;
    text-align: center !important;
    line-height: 1.35 !important;
    color: #374151 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
}
#iml-cw-root .iml-cw-item-sub {
    font-size: 9px !important;
    font-weight: 400 !important;
    color: #9aabb8 !important;
    white-space: nowrap !important;
}

/* ── 聊天窗 ──────────────────────────────────────────────── */
#iml-cw-root #iml-cw-chat {
    position: fixed !important;
    right: 58px !important;
    bottom: 20px !important;
    width: 304px !important;
    background: #fff !important;
    border: 1px solid #d4e3f5 !important;
    border-radius: 12px !important;
    box-shadow: -4px 4px 26px rgba(26,107,204,.15) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 999999 !important;
    animation: imlFadeUp .2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}
@keyframes imlFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

#iml-cw-root .iml-cw-chat-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 11px 13px !important;
    margin: 0 !important;
    background: #0d1b2e !important;
    background-color: #0d1b2e !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: .2px !important;
    border: none !important;
    border-radius: 0 !important;
}
#iml-cw-root .iml-cw-chat-status {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: #fff !important;
}
#iml-cw-root .iml-cw-online-dot {
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: #4ade80 !important;
    background-color: #4ade80 !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}
#iml-cw-root .iml-cw-chat-header button {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    cursor: pointer !important;
    color: rgba(255,255,255,.55) !important;
    display: flex !important;
    align-items: center !important;
    padding: 3px !important;
    margin: 0 !important;
    border-radius: 4px !important;
    transition: color .15s, background-color .15s !important;
    line-height: 1 !important;
    outline: none !important;
    box-shadow: none !important;
}
#iml-cw-root .iml-cw-chat-header button:hover {
    color: #fff !important;
    background-color: rgba(255,255,255,.1) !important;
}
#iml-cw-root .iml-cw-chat-header button svg {
    width: 14px !important;
    height: 14px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
}

#iml-cw-root .iml-cw-chat-body {
    flex: 1 !important;
    max-height: 252px !important;
    overflow-y: auto !important;
    padding: 12px 11px !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    background: #f4f8fd !important;
    background-color: #f4f8fd !important;
    scroll-behavior: smooth !important;
}
#iml-cw-root .iml-cw-chat-body::-webkit-scrollbar { width: 3px !important; }
#iml-cw-root .iml-cw-chat-body::-webkit-scrollbar-thumb {
    background: #cddaee !important;
    border-radius: 3px !important;
}

#iml-cw-root .iml-cw-msg {
    max-width: 87% !important;
    padding: 8px 11px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    font-size: 12.5px !important;
    line-height: 1.65 !important;
    word-break: break-word !important;
}
#iml-cw-root .iml-cw-msg-bot {
    background: #fff !important;
    background-color: #fff !important;
    color: #1a202c !important;
    border-radius: 3px 10px 10px 10px !important;
    align-self: flex-start !important;
    border: 1px solid #e5edf8 !important;
}
#iml-cw-root .iml-cw-msg-user {
    background: #1a6bcc !important;
    background-color: #1a6bcc !important;
    color: #fff !important;
    border-radius: 10px 3px 10px 10px !important;
    align-self: flex-end !important;
    border: none !important;
}
#iml-cw-root .iml-cw-msg-loading {
    background: #fff !important;
    background-color: #fff !important;
    color: #94a3b8 !important;
    border-radius: 3px 10px 10px 10px !important;
    align-self: flex-start !important;
    border: 1px solid #e5edf8 !important;
    font-size: 16px !important;
    letter-spacing: 3px !important;
    padding: 5px 13px !important;
}

/* 热点标签 */
#iml-cw-root .iml-cw-keywords {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    margin-top: 5px !important;
    align-self: flex-start !important;
    padding: 0 !important;
}
#iml-cw-root .iml-cw-kw-btn {
    display: inline-block !important;
    padding: 3px 9px !important;
    margin: 0 !important;
    background: #fff !important;
    background-color: #fff !important;
    border: 1px solid #c5d9f5 !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #1a6bcc !important;
    cursor: pointer !important;
    transition: background-color .12s, color .12s !important;
    line-height: 1.6 !important;
    white-space: nowrap !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}
#iml-cw-root .iml-cw-kw-btn:hover {
    background-color: #1a6bcc !important;
    border-color: #1a6bcc !important;
    color: #fff !important;
}

/* 输入区 */
#iml-cw-root .iml-cw-chat-input {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 9px 10px !important;
    margin: 0 !important;
    border-top: 1px solid #e8eef8 !important;
    background: #fff !important;
    background-color: #fff !important;
}
#iml-cw-root .iml-cw-chat-input input {
    flex: 1 !important;
    border: 1px solid #d2e1f2 !important;
    border-radius: 8px !important;
    padding: 7px 9px !important;
    margin: 0 !important;
    font-size: 12px !important;
    color: #1a202c !important;
    outline: none !important;
    background: #f7fafd !important;
    background-color: #f7fafd !important;
    transition: border-color .15s !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    height: auto !important;
    line-height: normal !important;
}
#iml-cw-root .iml-cw-chat-input input:focus {
    border-color: #1a6bcc !important;
    background-color: #fff !important;
    box-shadow: none !important;
    outline: none !important;
}
#iml-cw-root .iml-cw-chat-input button {
    width: 31px !important;
    height: 31px !important;
    flex-shrink: 0 !important;
    background: #1a6bcc !important;
    background-color: #1a6bcc !important;
    color: #fff !important;
    border: none !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color .15s !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}
#iml-cw-root .iml-cw-chat-input button:hover {
    background-color: #0d1b2e !important;
}
#iml-cw-root .iml-cw-chat-input button svg {
    width: 13px !important;
    height: 13px !important;
    display: block !important;
    fill: none !important;
    stroke: #fff !important;
}

/* ── 电话浮层 ────────────────────────────────────────────── */
#iml-cw-root #iml-cw-phone-toast {
    position: fixed !important;
    right: 58px !important;
    background: #0d1b2e !important;
    background-color: #0d1b2e !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 14px 16px 12px !important;
    margin: 0 !important;
    text-align: center !important;
    box-shadow: -3px 3px 20px rgba(0,0,0,.24) !important;
    min-width: 158px !important;
    z-index: 999999 !important;
    animation: imlFadeLeft .18s ease !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    border: none !important;
}
@keyframes imlFadeLeft {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}
#iml-cw-root .iml-cw-phone-toast-close {
    position: absolute !important;
    top: 5px !important;
    right: 6px !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    color: rgba(255,255,255,.4) !important;
    cursor: pointer !important;
    width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 3px !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: color .15s !important;
    outline: none !important;
}
#iml-cw-root .iml-cw-phone-toast-close:hover { color: #fff !important; }
#iml-cw-root .iml-cw-phone-toast-close svg {
    width: 11px !important;
    height: 11px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
}
#iml-cw-root .iml-cw-phone-toast-num {
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    color: #c9a84c !important;
    display: block !important;
    margin: 0 0 3px !important;
    padding: 0 !important;
}
#iml-cw-root .iml-cw-phone-toast-label {
    font-size: 10.5px !important;
    color: rgba(255,255,255,.6) !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* iml-cw-phone-call-btn removed — no tel: links in China */

/* ── 微信二维码弹窗 ──────────────────────────────────────── */
#iml-cw-root #iml-cw-qr {
    position: fixed !important;
    right: 58px !important;
    background: #fff !important;
    background-color: #fff !important;
    border: 1px solid #d4e3f5 !important;
    border-radius: 12px !important;
    box-shadow: -4px 4px 22px rgba(26,107,204,.14) !important;
    padding: 15px 16px 13px !important;
    margin: 0 !important;
    text-align: center !important;
    width: 176px !important;
    z-index: 999999 !important;
    animation: imlFadeLeft .18s ease !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}
#iml-cw-root .iml-cw-qr-close {
    position: absolute !important;
    top: 6px !important;
    right: 7px !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #b0bec5 !important;
    border-radius: 4px !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: color .15s, background-color .15s !important;
    outline: none !important;
}
#iml-cw-root .iml-cw-qr-close:hover {
    color: #1a6bcc !important;
    background-color: #eef4fd !important;
}
#iml-cw-root .iml-cw-qr-close svg {
    width: 11px !important;
    height: 11px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
}
#iml-cw-root .iml-cw-qr-title {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #0d1b2e !important;
    margin: 0 0 10px !important;
    padding-right: 18px !important;
    text-align: left !important;
    line-height: 1.4 !important;
}
#iml-cw-root .iml-cw-qr-img {
    width: 144px !important;
    height: 144px !important;
    border-radius: 8px !important;
    border: 1px solid #d4e3f5 !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
    padding: 0 !important;
    max-width: 144px !important;
}
#iml-cw-root .iml-cw-qr-hint {
    font-size: 10.5px !important;
    color: #94a3b8 !important;
    margin: 8px 0 0 !important;
    padding: 0 !important;
    text-align: center !important;
    line-height: 1.4 !important;
}

/* ── 移动端 ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    #iml-cw-root #iml-cw-chat { right: 6px !important; width: calc(100vw - 12px) !important; max-width: 320px !important; }
    #iml-cw-root #iml-cw-qr { right: 6px !important; width: calc(100vw - 12px) !important; max-width: 200px !important; }
    #iml-cw-root #iml-cw-phone-toast { right: 6px !important; }
    #iml-cw-root #iml-cw-toggle { width: 42px !important; }
    #iml-cw-root #iml-cw-panel { width: 80px !important; }
    #iml-cw-root .iml-cw-item { padding: 9px 0 10px !important; }
    #iml-cw-root .iml-cw-item-icon { width: 30px !important; height: 30px !important; }
    #iml-cw-root .iml-cw-item-icon svg { width: 14px !important; height: 14px !important; }
}

/* ── 初始隐藏（防止主题覆盖 [hidden] 属性）────────────────
   三重保险：HTML style=""、CSS、JS setProperty
   ─────────────────────────────────────────────────────── */
#iml-cw-root #iml-cw-panel,
#iml-cw-root #iml-cw-chat,
#iml-cw-root #iml-cw-phone-toast,
#iml-cw-root #iml-cw-qr {
    /* 默认隐藏；JS 用 setProperty("display", ..., "important") 控制显示 */
}

/* 覆盖主题可能写的 [hidden]{ display:block } */
#iml-cw-root [hidden] {
    display: none !important;
}

/* ── 转人工客服按钮条 ────────────────────────────────────── */
#iml-cw-root .iml-cw-human-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 7px 11px !important;
    margin: 0 !important;
    background: #f0f5fc !important;
    border-top: 1px solid #e2ecf8 !important;
    border-bottom: 1px solid #e2ecf8 !important;
    gap: 8px !important;
}
#iml-cw-root .iml-cw-human-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 5px 12px !important;
    margin: 0 !important;
    background: #1a6bcc !important;
    background-color: #1a6bcc !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color .15s !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    flex-shrink: 0 !important;
}
#iml-cw-root .iml-cw-human-btn:hover {
    background-color: #0d1b2e !important;
    color: #c9a84c !important;
}
#iml-cw-root .iml-cw-human-btn svg {
    width: 13px !important;
    height: 13px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    flex-shrink: 0 !important;
}
#iml-cw-root .iml-cw-human-tip {
    font-size: 10px !important;
    color: #94a3b8 !important;
    line-height: 1.4 !important;
    text-align: right !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── 转人工客服按钮条 ────────────────────────────────────── */
#iml-cw-root .iml-cw-human-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 7px 11px !important;
    margin: 0 !important;
    background: #f0f5fc !important;
    background-color: #f0f5fc !important;
    border-top: 1px solid #e2ecf8 !important;
    border-bottom: 1px solid #e2ecf8 !important;
    gap: 8px !important;
}
#iml-cw-root .iml-cw-human-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 5px 11px !important;
    margin: 0 !important;
    background: #1a6bcc !important;
    background-color: #1a6bcc !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color .15s !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    flex-shrink: 0 !important;
}
#iml-cw-root .iml-cw-human-btn:hover {
    background-color: #0d1b2e !important;
    color: #c9a84c !important;
}
#iml-cw-root .iml-cw-human-btn svg {
    width: 13px !important;
    height: 13px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    flex-shrink: 0 !important;
}
#iml-cw-root .iml-cw-human-tip {
    font-size: 10px !important;
    color: #94a3b8 !important;
    line-height: 1.4 !important;
    text-align: right !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}
/* 电话浮层：去掉立即拨打后加大号码字号 */
#iml-cw-root .iml-cw-phone-toast-num {
    font-size: 19px !important;
    margin-bottom: 4px !important;
}
#iml-cw-root .iml-cw-phone-toast-label {
    font-size: 11px !important;
}
