.hotent-ai-customer-service,
.hotent-ai-customer-service * {
    box-sizing: border-box;
}

.hotent-ai-customer-service {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: #1f2937;
}

#ai-customer-button {
    position: fixed;
    right: 28px;
    bottom: 80px;
    z-index: 10000;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 18px 0 14px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #1677ff 0%, #12b981 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(22, 119, 255, 0.34);
    touch-action: none;
    user-select: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

#ai-customer-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(22, 119, 255, 0.42);
    filter: brightness(1.03);
}

#ai-customer-button:active {
    transform: translateY(0);
}

.ai-customer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 13px;
    letter-spacing: 0;
}

.ai-customer-icon img,
.ai-panel-title-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#ai-customer-panel {
    position: fixed;
    right: 28px;
    bottom: 92px;
    z-index: 9999;
    display: none;
    width: min(430px, calc(100vw - 32px));
    height: min(660px, calc(100vh - 120px));
    overflow: hidden;
    border: 1px solid rgba(22, 119, 255, 0.18);
    border-radius: 18px;
    background: #f8f9ff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

#ai-customer-panel.is-open {
    display: flex;
    flex-direction: column;
}

#ai-customer-panel.is-expanded {
    top: 24px;
    right: 24px;
    bottom: 24px;
    left: 24px;
    width: auto;
    height: auto;
}

.ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    height: 58px;
    padding: 0 16px 0 18px;
    border-bottom: 1px solid #eef0f4;
    background: #ffffff;
}

.ai-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.ai-panel-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-panel-manual-link {
    position: absolute;
    right: 16px;
    bottom: 82px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(22, 119, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
    color: #1677ff;
    font-size: 13px;
    font-weight: 600;
    line-height: 30px;
    text-decoration: none;
    backdrop-filter: blur(8px);
}

.ai-panel-manual-link:hover {
    border-color: rgba(22, 119, 255, 0.34);
    background: #ffffff;
    color: #0958d9;
}

.ai-panel-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #1677ff 0%, #12b981 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.ai-panel-actions {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
}

.ai-panel-action,
.ai-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ai-panel-action:hover,
.ai-panel-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.ai-shrink-icon {
    display: none;
}

#ai-customer-panel.is-expanded .ai-expand-icon {
    display: none;
}

#ai-customer-panel.is-expanded .ai-shrink-icon {
    display: block;
}

dify-chat-body {
    display: block;
}

dify-chat-body {
    flex: 1;
    min-height: 0;
}

.ai-chat-footer {
    flex-shrink: 0;
    padding: 12px 16px 16px;
    border-top: 1px solid #eef0f4;
    background: #ffffff;
}

.ai-chat-footer-shell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #f4f5f9;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-chat-footer-shell:focus-within {
    border-color: #c7d2fe;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.ai-chat-footer.is-disabled {
    opacity: 0.68;
}

.ai-chat-input {
    flex: 1;
    min-width: 0;
    max-height: 120px;
    padding: 8px 4px;
    border: 0;
    outline: none;
    resize: none;
    overflow-y: auto;
    background: transparent;
    color: #111827;
    font: inherit;
    font-size: 15px;
    line-height: 1.4;
}

.ai-chat-input::placeholder {
    color: #9ca3af;
}

.ai-chat-input:disabled {
    cursor: not-allowed;
}

.ai-chat-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #1677ff 0%, #12b981 100%);
    color: #ffffff;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.05s ease;
}

.ai-chat-send:hover:not(:disabled) {
    filter: brightness(1.05);
}

.ai-chat-send:active:not(:disabled) {
    transform: scale(0.96);
}

.ai-chat-send:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.ai-contact-mask[hidden] {
    display: none;
}

.ai-contact-mask {
    position: absolute;
    inset: 58px 0 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.18);
}

.ai-contact-dialog {
    position: relative;
    width: 100%;
    max-width: 360px;
    max-height: calc(100% - 32px);
    overflow: auto;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
}

.ai-contact-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
}

.ai-contact-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.ai-contact-title {
    margin: 0 34px 8px 0;
    color: #111827;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

.ai-contact-desc {
    margin: 0 0 14px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

.ai-contact-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.ai-contact-field input {
    width: 100%;
    height: 38px;
    padding: 0 11px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    outline: none;
    color: #111827;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-contact-field input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.ai-contact-error {
    margin: 0 0 10px;
    color: #dc2626;
    font-size: 12px;
    line-height: 1.4;
}

.ai-contact-error[hidden],
.ai-contact-success[hidden] {
    display: none;
}

.ai-contact-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #1677ff 0%, #12b981 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.ai-contact-submit:disabled {
    cursor: default;
    filter: grayscale(0.12);
    opacity: 0.78;
}

.ai-contact-success {
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 560px) {
    #ai-customer-panel {
        right: 12px;
        bottom: 82px;
        width: calc(100vw - 24px);
        height: calc(100vh - 108px);
        border-radius: 16px;
    }

    #ai-customer-panel.is-expanded {
        top: 8px;
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        height: auto;
    }

    #ai-customer-button {
        right: 18px;
        bottom: 38px;
    }
}
