/**	01. Chat Application
*************************************************** 
**/
.pvr_chat_button {
    z-index: 9999;
    position: fixed;
    top: 50%;
    right: 0;
    bottom: auto;
    transform: translateY(-50%);
    background: linear-gradient(to left, var(--primary-color, #ff8e64), var(--secondary-color, #ffb3a0));
    box-shadow: 0 10px 30px rgba(var(--primary-color-rgb, 255, 142, 100), 0.35);
    border-radius: 14px 0 0 14px;
    color: #fff;
    padding: 12px 10px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    vertical-align: middle;
    font-size: 14px;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.pvr_chat_button.chat_left{
    left: 35px;
    right: unset;
}

.pvr_chat_button i {
    vertical-align: middle;
    display: inline-block;
    font-size: 16px;
}

.pvr_chat_button span {
    vertical-align: middle;
    display: inline-block;
    font-weight: 600;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
}

.pvr_chat_button i + span {
    margin-left: 0;
}

.pvr_chat_button:hover {
    -webkit-transform: scale(1.05);
    transform: translateY(-50%) scale(1.05);
    background: linear-gradient(to left, var(--secondary-color, #ffb3a0), var(--primary-color, #ff8e64));
    box-shadow: 0 12px 34px rgba(var(--primary-color-rgb, 255, 142, 100), 0.45);
}

.pvr_chat_wrapper {
    z-index: 9999;
    position: fixed;
    top: 50%;
    right: 0;
    bottom: auto;
    visibility: hidden; /* 初始隐藏 */
    opacity: 0; /* 初始透明 */
    transform: translate3d(12px, -50%, 0); /* 初始位置偏移（略向右，方便动效） */
    transition: all 0.3s ease;
}

.pvr_chat_wrapper.chat_left {
    left: 35px;
}

.pvr_chat_wrapper.active {
    visibility: visible;
    opacity: 1;
    -webkit-transform: translate3d(0, -50%, 0);
    transform: translate3d(0, -50%, 0);
}

.pvr_chat_wrapper .pvr_chat_content {
    background-color: #fff;
    /* Rectangle: */
    box-shadow: 0 12px 44px rgba(var(--primary-color-rgb, 255, 142, 100), 0.22);
    border-radius: 10px;
    width: 320px;
    position: relative;

    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    background-image: url(../../image/chat_box/header_2.svg);
    padding: 20px;
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

.pvr_chat_wrapper .pvr_chat_content .close_chat {
    position: absolute;
    top: 10px;
    right: 10px;
    color: rgba(0, 0, 0, 0.8);
    font-size: 10px;
    cursor: pointer;
}

.pvr_chat_wrapper .pvr_chat_content {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w .pvr-user-avatar-w {
    width: 50px;
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w .pvr-user-avatar-w .user-avatar {
    border-radius: 40px;
    overflow: hidden;
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w .pvr-user-avatar-w .user-avatar img {
    max-width: 100%;
    height: auto;
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w.with-status .pvr-user-avatar-w {
    position: relative;
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w.with-status .pvr-user-avatar-w:before {
    content: "";
    width: 10px;
    height: 10px;
    position: absolute;
    top: 2px;
    right: 2px;
    border-radius: 10px;
    box-shadow: 0px 0px 0px 3px #fff;
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w.with-status.status-green .pvr-user-avatar-w:before {
    background-color: #90be2e;
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w.with-status.status-red .pvr-user-avatar-w:before {
    background-color: #e65252;
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w .user-name {
    padding-left: 20px;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w .user-title {
    margin-bottom: 2px;
    color: var(--primary-color, #ff8e64);
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w .user-role {
    font-weight: 600;
    font-size: 0.81rem;
}

.pvr_chat_wrapper .pvr_chat_content .pvr-user-w .user-action {
    width: 50px;
    color: var(--primary-color, #ff8e64);
    font-size: 18px;
}

.pvr_chat_wrapper .chat-messages {
    padding: 20px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 220px;
    max-height: 420px;
    overscroll-behavior: contain; /* 防止滚动穿透到页面 */
}

.pvr_chat_wrapper .chat-messages .message {
    margin-bottom: 12px;
}


.pvr_chat_wrapper .chat-messages.theme_2 .message .message-content {
    color: #FFFFFF;
    padding: 10px 20px;
    background-color: rgba(var(--primary-color-rgb, 255, 142, 100), 0.85);
    border-radius: 20px 20px 20px 0px;
    max-width: 80%;
    font-size: 15px; /* 字体加大 */
    line-height: 1.6; /* 增加行高 */
    display: inline-block;
    text-align: left;
}

.pvr_chat_wrapper .chat-messages.theme_2 .message.self .message-content {
    border-radius: 20px 20px 0px 20px;
    background-color: rgba(var(--secondary-color-rgb, 255, 179, 160), 0.95);
    color: #FFFFFF;
}




.pvr_chat_wrapper .chat-messages .message.self {
    text-align: right;
}

.pvr_chat_wrapper .chat-messages .date-break {
    text-align: center;
    margin-bottom: 10px;
    color: rgba(0, 0, 0, 0.4);
    font-size: 13px;
}

.pvr_chat_wrapper .chat-controls {
    padding: 10px;
    padding-top: 0px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.pvr_chat_wrapper .chat-controls .message-input {
    border: 1px solid transparent;
    background-color: transparent;
    padding: 10px;
    width: 100%;
    display: block;
    font-size: 13px;
    border-radius: 0px;
}

.pvr_chat_wrapper .chat-controls .message-input:focus {
    outline: none;
    border-bottom: 1px solid var(--primary-color, #ff8e64);
}

.pvr_chat_wrapper .chat-controls .chat-extra {
    text-align: left;
    padding-left: 0px;
    padding-top: 10px;
}

.pvr_chat_wrapper .chat-controls .chat-extra a {
    display: inline-block;
    margin-left: 10px;
    font-size: 16px;
    position: relative;
    color: var(--primary-color, #ff8e64);
}

.pvr_chat_wrapper .chat-controls .chat-extra a .extra-tooltip {
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-weight: 600;
    font-size: 0.63rem;
    text-transform: uppercase;
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    position: absolute;
    top: -20px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    white-space: nowrap;
    display: none;
}

.pvr_chat_wrapper .chat-controls .chat-extra a:hover {
    text-decoration: none;
}

.pvr_chat_wrapper .chat-controls .chat-extra a:hover .extra-tooltip {
    display: block;
}

.change_chat_theme {
    float: right;
}

.pvr_chat_wrapper .material-icons {
    font-size: 18px !important;
}

/* 预设问题样式 */
.preloaded-question {
    background-color: #f2f2f2;
    padding: 8px 15px;
    margin: 10px 0;
    border-radius: 10px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
    user-select: none;
    -webkit-user-select: none;
}

.preloaded-question:hover {
    background-color: #e0e0e0;
    border-color: var(--primary-color, #ff8e64);
    color: var(--primary-color, #ff8e64);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preloaded-question:active {
    background-color: var(--primary-color, #ff8e64);
    color: #fff;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.qrcode-container {
    text-align: center;
    margin-top: 5px;
}

.qrcode-image {
    width: 68px;
    height: 68px;
}

.qrcode-text {
    margin-top: 8px;
    color: #555;
    font-size: 12px;
}

/* 正在输入文字提示（绿色） */
.typing-text {
    font-size: 0.81rem;
    font-weight: 600;
    color: #28a745;
    margin-top: 2px;
    animation: typing-pulse 1.5s ease-in-out infinite;
}

@keyframes typing-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}
