:root {
    --app-height: 100vh;
    --mobile-browser-bottom-offset: 8px;
    --mobile-safe-bottom: var(--mobile-browser-bottom-offset);
    --bscl: linear-gradient(115deg, #d55e31, #efad63);
}

@supports (padding-bottom: constant(safe-area-inset-bottom)) {
    :root {
        --mobile-safe-bottom: calc(constant(safe-area-inset-bottom) + var(--mobile-browser-bottom-offset));
    }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    :root {
        --mobile-safe-bottom: calc(env(safe-area-inset-bottom) + var(--mobile-browser-bottom-offset));
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body.chat-page {
    width: 100%;
    height: 100%;
    height: var(--app-height, 100vh);
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    font-weight: 400;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: var(--app-height, 100vh);
    background-color: #f5f8fa;
}

/* Header */
.chat-header {
    width: 100%;
    z-index: 10;
    flex-shrink: 0;
}

.uxi_header {
    height: 62px;
    background: var(--bscl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1px 0 15px;
    color: #fff;
    box-shadow: 0 6px 10px rgba(8, 8, 8, 0.1);
    z-index: 100;
    position: relative;
}

.uxi_header .icon_warp {
    display: flex;
    align-items: center;
}

.uxi_header .icon_warp .icon {
    position: relative;
}

.uxi_header .icon_warp .icon img.agent-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    display: block;
}

.cite {
    display: inline-block;
    width: 9px;
    height: 9px;
    top: 30px;
    left: 35px;
    position: absolute;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cite-offline {
    background-color: #808080;
    animation: none;
}

.cite-online {
    background-color: #06d6a0;
    animation: colorChange 1.5s infinite alternate ease-in-out;
}

@keyframes colorChange {
    0% {
        box-shadow: 0 0 0 2px rgba(6, 214, 160, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
        transform: scale(1.2);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(128, 128, 128, 0.3);
        transform: scale(1.1);
    }
}

.header-title-row {
    display: inline-flex;
    align-items: center;
    font-size: 15px;
}

.vip-badge {
    width: 28px;
    height: 15px;
    margin-top: -2px;
    margin-right: 2px;
}

.chat-header-title {
    font-size: 15px;
    font-weight: 600;
}

.offline-message {
    margin-top: 2px;
}

.offline-message .olicon2 {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

/* Notice bar */
.notice-box {
    border-radius: 10px;
    background-color: #f2dede;
    border: 1px solid #dca7a7;
    padding: 1px;
    margin: 8px 8px 5px;
    flex-shrink: 0;
}

.notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
}

.notification-icon {
    margin-right: 6px;
    margin-left: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.notification-content {
    flex-grow: 1;
    margin-right: 8px;
    overflow: hidden;
    min-width: 0;
}

.notice-container {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.notice-content {
    display: inline-block;
    animation: scrollNotice 13s linear infinite;
    animation-delay: 3s;
}

.notice-content p {
    color: #ff0000;
    font-size: 13px;
    font-weight: 300;
    white-space: nowrap;
}

@keyframes scrollNotice {
    0%, 23% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.view__1ZionADc {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transform: translateX(-8px);
}

.Btn {
    background: #fff;
    border: 1px solid #b9b9b9;
    border-radius: 999px;
    font-weight: 500;
    line-height: 1.1;
    cursor: pointer;
    outline: none;
    color: #373838;
    font-size: 12px;
    padding: 2px 8px;
}

.Btn:active {
    background-color: #a3a3a3;
}

.notification-close {
    cursor: pointer;
    transform: translateX(-6px);
    font-size: 12px;
    color: #333;
    padding: 0 6px;
    flex-shrink: 0;
}

/* Popup */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999;
}

.popup {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 95vw;
    height: 400px;
    max-width: 600px;
    padding: 20px;
    background-image: linear-gradient(#efad63, #d55e31);
    border: 1px solid #ccc;
    border-radius: 15px;
    color: #fff;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.popup-logo {
    width: 131px;
    height: 29px;
    object-fit: contain;
}

.biao {
    font-size: 18px;
    font-weight: 500;
    margin: 0 5px 3px;
    transform: translateY(-6px);
}

.wen {
    width: 100%;
    height: 260px;
    padding: 0 7px;
    font-size: 15px;
    text-align: justify;
    overflow: auto;
    overflow-wrap: break-word;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wen::-webkit-scrollbar {
    display: none;
}

.wen p {
    margin-bottom: 6px;
    line-height: 1.5;
}

.ann {
    padding: 0;
    font-size: 14px;
    font-weight: 400;
    color: #fff;
    height: 40px;
    line-height: 40px;
    cursor: pointer;
    border-radius: 6px;
    background: #3d9df1;
    margin-top: 8px;
    border: none;
}

/* Chat body */
.chat-body {
    position: relative;
    flex: 1;
    min-height: 0;
    background-color: #f5f8fa;
}

.chat-box {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    word-wrap: break-word;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

.chat-system {
    padding: 1px 28px;
    background-color: #e2e2e2;
    border-radius: 3px;
    color: #333;
    word-break: break-all;
    font-size: 13px;
    display: inline-block;
    max-width: 100%;
    box-shadow: 3px 3px 9px rgba(158, 158, 158, 0.15);
}

.clearfloat {
    zoom: 1;
    margin: 8px;
}

.clearfloat1 {
    display: flex;
    justify-content: center;
    align-items: center;
}

.author-name {
    text-align: center;
    margin: 15px 0 5px;
    color: #888;
}

.author-name.kefu-author {
    text-align: left;
    margin: 10px 8px 4px 51px;
}

.author-name-right {
    text-align: right;
    padding-right: 48px;
}

.author-name .chat-date {
    opacity: 0.6;
    font-size: 10px;
    font-weight: 400;
    color: #888;
}

.msg-agent-tag {
    display: inline-block;
    font-size: 10px;
    color: #fff;
    background: #ef8c4a;
    border-radius: 2px;
    padding: 1px 5px;
    margin-right: 4px;
    vertical-align: middle;
    font-weight: 500;
}

.msg-agent-name {
    font-size: 12px;
    color: #666;
    margin-right: 6px;
    vertical-align: middle;
}

.agent-profile-wrap {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.agent-profile-card {
    position: relative;
    min-height: 40px;
    height: 54px;
    padding: 8px 15px;
    border-radius: 10px;
    width: 40%;
    max-width: 180px;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    margin: 15px;
    align-items: center;
    justify-content: flex-end;
    box-shadow: none;
}

.agent-profile-avatar-wrap {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    padding-bottom: 40px;
    box-sizing: content-box;
}

.agent-profile-avatar {
    width: 35px;
    height: 35px;
    background-color: #fff;
    padding: 5px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.agent-profile-name {
    font-size: 13px;
    color: #333;
    font-weight: 600;
    line-height: 1.2;
}

.agent-profile-role {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    line-height: 1.2;
}

.clearfloat .left {
    text-align: left;
}

.clearfloat .left .chat-avatars {
    margin-right: 8px;
}

.clearfloat .chat-avatars {
    display: inline-block;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #eee;
    vertical-align: top;
    overflow: hidden;
}

.clearfloat .chat-avatars > img {
    width: 35px;
    height: 35px;
    object-fit: cover;
    display: block;
}

.clearfloat .chat-message {
    padding: 8px 12px;
    border-radius: 4px;
    word-wrap: break-word;
    display: inline-block;
    position: relative;
    max-width: calc(100vw - 90px);
    font-size: 14px;
    line-height: 1.5;
    text-align: justify;
}

.clearfloat .left .chat-message {
    background: #fff;
    min-height: 14px;
    color: #000;
    border: 0.7px solid #e0dede;
}

.clearfloat .left .chat-message img {
    max-width: 200px;
    border-radius: 4px;
    display: block;
}

.clearfloat .right {
    float: right;
    text-align: right;
    margin-right: -8px;
}

.clearfloat .right .chat-message {
    background: #1e9fff;
    color: #fff;
    text-align: justify;
    min-height: 14px;
    margin-right: 8px;
    border-radius: 4px;
    border: none;
}

.clearfloat .right .chat-message img {
    max-width: 200px;
    border-radius: 4px;
    display: block;
}

.chat-recalled {
    font-style: normal;
    color: #98a6ad;
    font-size: 13px;
}
.chat-edited {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    font-style: normal;
    color: rgba(152, 166, 173, 0.95);
    font-weight: 400;
}
.clearfloat .right .chat-edited {
    color: rgba(255, 255, 255, 0.75);
}

/* Footer */
.chat-footer {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #f2f2f2;
    flex-shrink: 0;
    padding-bottom: 8px;
    padding-bottom: var(--mobile-safe-bottom);
}

.uxi_footer_zw {
    background-color: #f2f2f2;
}

.uxi_footer {
    display: flex;
    width: 100%;
    background-color: #f2f2f2;
    flex-direction: column;
    position: relative;
}

.uxi_footer .foot_line {
    border-bottom: 1px solid #dbdfe6;
    margin: 10px 24px;
}

.uxi_foot {
    flex: 1;
    display: flex;
}

.uxi_foot_cont {
    display: flex;
    justify-content: space-between;
    padding: 2px 24px 11px;
    flex: 1;
    align-items: flex-end;
}

.texteara_warp {
    flex: 1;
    padding-right: 5px;
    display: flex;
}

.uxi_foot textarea {
    border: 0;
    flex: 1;
    resize: none;
    font-size: 15px !important;
    background-color: #f2f2f2;
    color: #333;
    overflow: hidden;
    outline: none;
    overflow-y: auto;
    min-height: 50px;
    letter-spacing: -0.24px;
    line-height: 20px;
    font-family: inherit;
}

.uxi_foot textarea::placeholder {
    color: #bbb;
}

.send-btn-div {
    flex-shrink: 0;
}

.send_box span {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.send_box .huise {
    background: #f2f2f2;
    color: rgb(153, 153, 153);
    cursor: not-allowed;
}

.send_box span.active {
    background: var(--bscl);
    color: #fff;
    cursor: pointer;
}

.fasong {
    font-weight: 500;
    font-size: 13px;
}

.uxi_bar {
    height: 45px;
    padding: 0 24px 6px;
    background-color: #f2f2f2;
}

.tool_bar {
    display: flex;
    align-items: center;
    position: relative;
    height: 100%;
}

.tool_bar .sp {
    margin-right: 12px;
    cursor: pointer;
    color: #8894ab;
    display: inline-flex;
    align-items: center;
}

.tool_bar .sp svg {
    color: #8894ab;
    width: 22px;
    height: 22px;
}

.upload-label {
    display: inline-flex;
    cursor: pointer;
}

.tool_bar input[type="file"] {
    display: none;
}

.footer-mz {
    position: absolute;
    right: 0;
    bottom: 6px;
    text-align: right;
}

.footer-logo {
    width: 138px;
    height: 31px;
    object-fit: contain;
}

/* Loading toast */
.weui-mask_transparent {
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: transparent;
}

.weui_loading_toast {
    position: fixed;
    z-index: 1001;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 120px;
    padding: 18px 20px;
    background: rgba(17, 17, 17, 0.7);
    border-radius: 8px;
    text-align: center;
    color: #fff;
    display: none;
}

.weui_loading_toast.weui-toast--visible {
    display: block;
}

.weui-loading {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinLoad 0.8s linear infinite;
}

@keyframes spinLoad {
    to { transform: rotate(360deg); }
}

.weui-toast_content {
    margin-top: 10px;
    font-size: 14px;
}

/* Emoji panel */
.emoji_box22 {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 250px;
    margin: 0 auto;
    background: #e7e7e7;
    border-radius: 12px 12px 0 0;
    z-index: 500;
    padding-bottom: var(--mobile-safe-bottom);
}

.emoji-container {
    height: calc(100% - 10px);
    overflow-y: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    align-content: start;
    box-sizing: border-box;
}

.emoji-container span {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 8px;
}

.emoji-container span:active {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.1);
}

.uxi_foot textarea:disabled {
    color: #999;
    cursor: not-allowed;
}
