.vxcf-widget { position: fixed; bottom: 20px; right: 20px; z-index: 9999; font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif; font-size: 14px; }

.vxcf-toggle { width: 56px; height: 56px; border-radius: 50%; background: var(--vx-primary, #6366f1); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(99,102,241,.4); position: absolute; bottom: 0; right: 0; transition: transform .2s, box-shadow .2s; }
.vxcf-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(99,102,241,.5); }
.vxcf-badge { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

.vxcf-panel { position: absolute; bottom: 70px; right: 0; width: 370px; max-height: 560px; background: #fff; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.15); overflow: hidden; flex-direction: column; }

.vxcf-header { background: var(--vx-primary, #6366f1); color: #fff; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.vxcf-header-info { display: flex; align-items: center; gap: 10px; }
.vxcf-header-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vxcf-header-title { font-size: 15px; font-weight: 700; }
.vxcf-header-sub { font-size: 12px; opacity: .75; }
.vxcf-header-status { font-size: 11px; opacity: .75; display: flex; align-items: center; gap: 4px; }
.vxcf-header-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; display: inline-block; }
.vxcf-status-off::before { background: #9ca3af; }
.vxcf-close { background: none; border: none; color: rgba(255,255,255,.7); cursor: pointer; padding: 4px; }
.vxcf-close:hover { color: #fff; }

.vxcf-start { display: flex; flex-direction: column; }
.vxcf-start-body { padding: 20px 18px; }
.vxcf-start-text { font-size: 13px; color: #6b7280; margin: 0 0 16px 0; line-height: 1.5; }
.vxcf-field { margin-bottom: 10px; }
.vxcf-input { width: 100%; padding: 10px 14px; font-size: 14px; border: 1px solid #e5e7eb; border-radius: 10px; background: #f9fafb; color: #1f2937; font-family: inherit; outline: none; transition: border .15s; box-sizing: border-box; }
.vxcf-input:focus { border-color: var(--vx-primary, #6366f1); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.vxcf-error { font-size: 12px; color: #ef4444; padding: 6px 0; }
.vxcf-btn { width: 100%; padding: 12px; font-size: 14px; font-weight: 600; background: var(--vx-primary, #6366f1); color: #fff; border: none; border-radius: 10px; cursor: pointer; font-family: inherit; transition: background .15s; margin-top: 6px; }
.vxcf-btn:hover { background: #4f46e5; }
.vxcf-btn:disabled { opacity: .6; cursor: default; }

.vxcf-chat { display: flex; flex-direction: column; height: 480px; }
.vxcf-messages { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; background: #f9fafb; }

.vxcf-msg { display: flex; gap: 6px; max-width: 85%; animation: vxcf-in .2s ease; }
@keyframes vxcf-in { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

.vxcf-msg-mine { align-self: flex-end; flex-direction: row-reverse; }
.vxcf-msg-other { align-self: flex-start; }

.vxcf-msg-avatar-wrap { flex-shrink: 0; margin-top: 2px; }
.vxcf-msg-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.vxcf-msg-avatar-letter { width: 26px; height: 26px; border-radius: 50%; background: var(--vx-primary, #6366f1); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }

.vxcf-msg-bubble { padding: 10px 14px; border-radius: 14px; }
.vxcf-msg-mine .vxcf-msg-bubble { background: var(--vx-primary, #6366f1); color: #fff; border-bottom-right-radius: 4px; }
.vxcf-msg-other .vxcf-msg-bubble { background: #fff; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; color: #1f2937; }

.vxcf-msg-sender { font-size: 11px; font-weight: 700; color: #6b7280; margin-bottom: 2px; }
.vxcf-msg-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.vxcf-msg-text a { color: inherit; text-decoration: underline; }
.vxcf-msg-time { font-size: 10px; margin-top: 4px; }
.vxcf-msg-mine .vxcf-msg-time { color: rgba(255,255,255,.5); }
.vxcf-msg-other .vxcf-msg-time { color: #9ca3af; }

.vxcf-msg-img-wrap { margin: 4px 0; }
.vxcf-msg-img { max-width: 220px; max-height: 180px; border-radius: 8px; cursor: pointer; object-fit: cover; transition: transform .15s; }
.vxcf-msg-img:hover { transform: scale(1.03); }

.vxcf-msg-file { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: rgba(0,0,0,.04); border-radius: 6px; margin: 4px 0; color: inherit; text-decoration: none; font-size: 13px; font-weight: 500; }
.vxcf-msg-mine .vxcf-msg-file { background: rgba(255,255,255,.15); }

.vxcf-closed-banner { padding: 12px 18px; text-align: center; font-size: 13px; color: #6b7280; background: #f3f4f6; border-top: 1px solid #e5e7eb; flex-shrink: 0; }

.vxcf-input-bar { display: flex; align-items: flex-end; gap: 6px; padding: 10px 14px; border-top: 1px solid #e5e7eb; background: #fff; flex-shrink: 0; }
.vxcf-input-tools { display: flex; gap: 2px; padding-bottom: 4px; }
.vxcf-tool-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: none; border-radius: 6px; background: transparent; color: #9ca3af; cursor: pointer; transition: all .15s; }
.vxcf-tool-btn:hover { background: #f3f4f6; color: var(--vx-primary, #6366f1); }
.vxcf-textarea { flex: 1; resize: none; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 12px; font-size: 14px; background: #f9fafb; color: #1f2937; font-family: inherit; max-height: 100px; overflow-y: auto; outline: none; transition: border .15s; box-sizing: border-box; }
.vxcf-textarea:focus { border-color: var(--vx-primary, #6366f1); }
.vxcf-send { width: 36px; height: 36px; border-radius: 50%; background: var(--vx-primary, #6366f1); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s; }
.vxcf-send:hover { background: #4f46e5; }

.vxcf-zoom { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 99999; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
.vxcf-zoom.open { display: flex; }
.vxcf-zoom img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.vxcf-zoom-close { position: absolute; top: 20px; right: 20px; background: none; border: none; cursor: pointer; }

.vxcf-messages::-webkit-scrollbar { width: 4px; }
.vxcf-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

@media (max-width: 420px) {
    .vxcf-panel { width: calc(100vw - 20px); right: -10px; bottom: 66px; max-height: 80vh; }
}

.vxcf-translate-btn {
    display: inline-flex;
    align-items: center;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 3px;
    margin-top: 3px;
    opacity: 0;
    transition: opacity .15s;
}

.vxcf-msg-bubble:hover .vxcf-translate-btn { opacity: 1; }

.vxcf-translate-btn:hover { color: var(--vx-primary, #6366f1); }

.vxcf-msg-mine .vxcf-translate-btn { color: rgba(255,255,255,.4); }
.vxcf-msg-mine .vxcf-translate-btn:hover { color: rgba(255,255,255,.8); }

.vxcf-translate-spin {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: vxcf-spin .6s linear infinite;
}

@keyframes vxcf-spin { to { transform: rotate(360deg); } }

.vxcf-translated {
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 8px;
    background: rgba(0,0,0,.04);
    border-radius: 6px;
    color: #6b7280;
    font-style: italic;
}

.vxcf-msg-mine .vxcf-translated {
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.85);
}

.vxcf-translated-label {
    font-weight: 700;
    font-style: normal;
    font-size: 10px;
    text-transform: uppercase;
}
