@import url('open.iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.dxbl-grid {
    max-height: 85%
}

#water-marker {
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none; /* ȥ��������¼������ɴ�͸��div�����ײ�������div�� */
    background-size: 120px 120px;
    position: fixed;
    background-attachment: fixed;
}

.required-field:after {
    content: '*';
    color: red;
    margin-left: 2px;
}

.sidebar-nav {
    margin-bottom: 22px;
}

.dxbl-accordion-item-content {
    font-size: 14px;
    padding-left: 5px;
}

.icon-column-chooser {
    width: 16px;
    height: 16px;
    mask-image: url("icons/generic/columnchooser.svg");
    background-color: currentColor;
}

.icon-preferences {
    width: 16px;
    height: 16px;
    mask: url("icons/generic/preferences.svg");
    background-color: currentColor;
}

.icon-save {
    width: 16px;
    height: 16px;
    mask-image: url("icons/generic/save.svg");
    background-color: currentColor;
}

.icon-fieldchooser {
    width: 16px;
    height: 16px;
    mask-image: url("icons/generic/fieldchooser.svg");
    background-color: currentColor;
}

.disabledchooser input {
    pointer-events: none !important;
    background-color: white;
}

.red-color-su {
    color: red !important;
}

.dxbl-grid-empty-data > span {
    font-weight: 400 !important;
    font-size: 14px !important;
}

.main-chat-container {
    height: 100%;
}

.main-content {
    padding: 2px 0 21px 20px !important;
}

.main-chat {
    width: 100%;
    height: 100%;
}

.main-chat-container .dxbl-drawer-body {
    padding: 0 !important;
}

.main-chat-container .dxbl-drawer-content {
    padding-top: 20px !important;
    padding-right: 20px !important;
}

/* Read-only group chat history popup */
.chat-history-popup .dxbl-modal-content {
    min-height: 0;
    overflow: hidden;
}

.chat-history-popup-body {
    min-height: 0;
    padding: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: contain;
}

body.dxbl-modal-open dxbl-modal-root {
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.dxbl-modal-open .chat-group-grid .dxbl-scroll-viewer-content {
    overflow: hidden !important;
}

body.dxbl-modal-open .chat-group-grid dxbl-scroll-bar {
    visibility: hidden !important;
    pointer-events: none !important;
}

.chat-history-popup .dxbl-modal-content,
.chat-history-popup .dxbl-modal-body,
.chat-history-viewer {
    overscroll-behavior: contain;
}

.chat-history-chat .dxbl-chatui-scrollviewer .dxbl-scroll-viewer-content {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

.chat-history-viewer {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #f4f7f9;
}

.chat-history-placeholder {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 320px;
    padding: 32px;
    color: #5f6c7b;
    font-size: 14px;
}

.chat-history-error {
    color: #9f2f39;
}

.chat-history-load-state,
.chat-history-count {
    display: flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border-bottom: 1px solid #dfe5ea;
    background: #ffffff;
    color: #687586;
    font-size: 12px;
}

.chat-history-count {
    flex-basis: 32px;
    border-top: 1px solid #dfe5ea;
    border-bottom: 0;
}

.chat-history-inline-error {
    color: #a12b34;
}

.chat-history-chat {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    background: #f4f7f9;
}

.chat-history-chat .dxbl-loading-panel-target-content,
.chat-history-chat .dxbl-chatui {
    height: 100%;
    min-height: 0;
}

.chat-history-chat .dxbl-chatui-submitarea,
.chat-history-chat .dxbl-chatui-message-buttons-container {
    display: none !important;
}

.chat-history-chat .dxbl-chatui-messages {
    gap: 18px;
    padding: 24px 28px 30px;
}

.chat-history-message {
    display: block;
    width: calc(100% - 48px);
    max-width: 760px;
    color: #1f2933;
}

.chat-history-customer-message {
    align-self: flex-start;
}

.chat-history-support-message {
    align-self: flex-end;
}

.chat-history-message-column {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.chat-history-support-message .chat-history-message-column {
    align-items: flex-end;
}

.chat-history-message-meta {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 30px;
    align-items: center;
    gap: 7px;
    color: #74808c;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
}

.chat-history-support-message .chat-history-message-meta {
    flex-direction: row-reverse;
}

.chat-history-message-avatar {
    position: relative;
    display: flex;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #cfdae2;
    border-radius: 50%;
    background: #ffffff;
    color: #3d4b57;
    font-size: 12px;
    font-weight: 600;
}

.chat-history-message-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-history-support-message .chat-history-message-avatar {
    border-color: #c8d8eb;
    background: rgb(231, 239, 249);
    color: #315b86;
}
.chat-history-message-sender {
    min-width: 0;
    overflow: hidden;
    max-width: 220px;
    flex: 0 1 auto;
    color: #34414d;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-history-message-role,
.chat-history-system-label {
    flex: 0 0 auto;
    padding: 1px 6px;
    border-radius: 4px;
    background: #e9edf1;
    color: #596673;
    font-size: 11px;
    line-height: 17px;
}

.chat-history-support-message .chat-history-message-role {
    background: #dce8f6;
    color: #315f8c;
}

.chat-history-message-meta time {
    flex: 0 0 auto;
    color: #88939e;
    font-variant-numeric: tabular-nums;
}

.chat-history-message-bubble {
    width: fit-content;
    max-width: calc(100% - 37px);
    margin-left: 37px;
    padding: 8px 16px;
    border: 0;
    border-radius: 6px;
    background: rgb(244, 244, 243);
    box-shadow: none;
}

.chat-history-support-message .chat-history-message-bubble {
    margin-right: 37px;
    margin-left: 0;
    background: rgb(231, 239, 249);
}

.chat-history-message-content,
.chat-history-message-fallback {
    overflow-wrap: anywhere;
    color: #1f2924;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.chat-history-support-message .chat-history-message-content {
    color: #26323b;
}

.chat-history-message-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.chat-history-text-part {
    white-space: pre-wrap;
}

.chat-history-inline-emoji {
    display: inline-block;
    width: 1.25rem;
    height: 1.2rem;
    margin: 0 1px;
    background-image: url("/images/icons/wx_emoji_v1.0.png");
    background-repeat: no-repeat;
    background-size: 22.5rem 14.8rem;
    vertical-align: -0.24rem;
}

.chat-history-media-link {
    position: relative;
    display: block;
    overflow: hidden;
    width: fit-content;
    max-width: min(420px, 100%);
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: #e8ecef;
    cursor: zoom-in;
    font: inherit;
}

.chat-history-media-link img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.chat-history-media-link.chat-history-emoji img {
    max-width: 128px;
    max-height: 128px;
}

.chat-history-media-fallback {
    display: none;
    padding: 12px;
    color: #596673;
    font-size: 12px;
}

.chat-history-media-error img {
    display: none;
}

.chat-history-media-error .chat-history-media-fallback {
    display: block;
}

.chat-history-video-wrap {
    display: flex;
    max-width: min(480px, 100%);
    flex-direction: column;
    gap: 5px;
}

.chat-history-video-wrap video {
    display: block;
    width: 100%;
    max-height: 320px;
    border-radius: 5px;
    background: #121619;
}

.chat-history-download-link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 5px;
    color: #426f9f;
    font-size: 12px;
    text-decoration: none;
}

.chat-history-download-link:hover {
    color: #244f7c;
    text-decoration: underline;
}

.chat-history-audio-wrap {
    display: grid;
    min-width: min(320px, 100%);
    max-width: 100%;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 6px 8px;
}

.chat-history-audio-wrap audio {
    width: 100%;
    min-width: 220px;
    height: 36px;
}

.chat-history-audio-wrap > a {
    grid-column: 2;
}

.chat-history-image-preview {
    position: absolute;
    z-index: 20;
    inset: 0;
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: 48px minmax(0, 1fr);
    overflow: hidden;
    background: rgb(17 24 31 / 94%);
    color: #ffffff;
    outline: none;
}

.chat-history-image-preview-toolbar {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 14px 0 18px;
    border-bottom: 1px solid rgb(255 255 255 / 16%);
    background: rgb(17 24 31 / 92%);
    font-size: 14px;
    font-weight: 600;
}

.chat-history-image-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-history-image-preview-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.chat-history-preview-action,
.chat-history-preview-back {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 4px;
    background: rgb(255 255 255 / 8%);
    color: #ffffff;
    text-decoration: none;
}

.chat-history-preview-action {
    padding: 0 10px;
    font-size: 12px;
}

.chat-history-preview-back {
    width: 32px;
    padding: 0;
    cursor: pointer;
}

.chat-history-preview-action:hover,
.chat-history-preview-back:hover {
    border-color: rgb(255 255 255 / 45%);
    background: rgb(255 255 255 / 16%);
    color: #ffffff;
}

.chat-history-image-preview-stage {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
}

.chat-history-image-preview-stage img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

.chat-history-preview-error {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #e8edf2;
    font-size: 13px;
    text-align: center;
}

.chat-history-file,
.chat-history-external-link {
    display: flex;
    max-width: 100%;
    align-items: center;
    gap: 9px;
    color: #2d5f91;
    text-decoration: none;
}

.chat-history-file {
    min-width: min(280px, 100%);
    padding: 10px 12px;
    border: 1px solid #ced8e1;
    border-radius: 5px;
    background: rgb(255 255 255 / 65%);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.chat-history-file:hover,
.chat-history-external-link:hover {
    color: #1f4f80;
    text-decoration: underline;
}

.chat-history-file-name,
.chat-history-external-link span:last-child {
    min-width: 0;
    overflow: hidden;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
}

.chat-history-evaluation-actions {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    padding-top: 2px;
}

.chat-history-evaluation-button {
    width: 24px;
    min-width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 4px;
    color: #677583;
    font-size: 13px;
}

.chat-history-evaluation-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: inherit;
    background-color: currentColor;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: 18px 18px;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 18px 18px;
}

.chat-history-evaluation-icon-good {
    mask-image: url("/images/like1.svg");
    -webkit-mask-image: url("/images/like1.svg");
}

.chat-history-evaluation-icon-bad {
    mask-image: url("/images/nolike1.svg");
    -webkit-mask-image: url("/images/nolike1.svg");
}

.chat-history-evaluation-button:hover {
    background: rgb(49 93 136 / 8%);
    color: #315d88;
}

.chat-history-evaluation-button.is-selected {
    font-weight: 600;
}

.chat-history-evaluation-button.is-good {
    background: rgb(38 115 77 / 9%);
    color: #26734d;
}

.chat-history-evaluation-button.is-bad {
    background: rgb(181 76 69 / 9%);
    color: #b54c45;
}

.chat-evaluation-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 4px 2px 2px;
}

.chat-evaluation-message-context {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 9px;
    padding: 10px 12px;
    border-left: 3px solid #4f7ca7;
    background: #f3f6f8;
    color: #56636f;
    font-size: 12px;
}

.chat-evaluation-message-meta {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.chat-evaluation-message-context strong {
    min-width: 0;
    overflow: hidden;
    color: #263746;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-evaluation-message-context time {
    color: #7b8791;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.chat-evaluation-context-label {
    padding: 2px 6px;
    border-radius: 3px;
    background: #dfeaf2;
    color: #365d7e;
}

.chat-evaluation-message-preview {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    padding-top: 8px;
    border-top: 1px solid #dce4ea;
    color: #495965;
}

.chat-evaluation-message-preview > .oi {
    flex: 0 0 auto;
    color: #70808e;
}

.chat-evaluation-message-preview > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-evaluation-layout {
    width: 100%;
}

.chat-evaluation-radio-item {
    min-width: 90px;
}

.chat-evaluation-comment {
    width: 100%;
}

.chat-evaluation-comment-meta {
    display: flex;
    min-height: 20px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-top: 5px;
    color: #7b8791;
    font-size: 12px;
}

.chat-evaluation-comment-meta .validation-message {
    color: #b42318;
}

.chat-evaluation-comment-meta > span:last-child {
    margin-left: auto;
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.chat-evaluation-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid #e1e6ea;
}
.chat-history-system-message {
    display: flex;
    max-width: min(82%, 680px);
    align-self: center;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #e9edf1;
    color: #65717c;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.chat-history-system-label {
    background: #dce2e7;
    color: #4f5d69;
}

.chat-history-system-content {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chat-history-system-message time {
    flex: 0 0 auto;
    color: #84909a;
    font-variant-numeric: tabular-nums;
}

.chat-history-message-fallback {
    width: calc(100% - 48px);
    align-self: flex-start;
    padding: 11px 14px;
    border: 1px solid #d8dee3;
    border-radius: 8px;
    background: #ffffff;
}
.chat-history-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    color: #738092;
}

.chat-detail-button {
    width: 32px;
    height: 32px;
}

@media (max-width: 720px) {
    .chat-history-load-state {
        padding: 0 8px;
    }

    .chat-history-chat .dxbl-chatui-messages {
        gap: 16px;
        padding: 18px 12px 24px;
    }

    .chat-history-message {
        width: 100%;
        max-width: 100%;
    }

    .chat-history-message-meta {
        gap: 5px;
    }

    .chat-history-message-sender {
        max-width: 118px;
    }

    .chat-history-message-bubble {
        max-width: calc(100% - 35px);
        margin-left: 35px;
        padding: 10px 12px;
    }

    .chat-history-support-message .chat-history-message-bubble {
        margin-right: 35px;
        margin-left: 0;
    }


    .chat-history-media-link img,
    .chat-history-video-wrap video {
        max-height: 240px;
    }

    .chat-history-audio-wrap audio {
        min-width: 0;
    }

    .chat-history-system-message {
        max-width: 94%;
        flex-wrap: wrap;
    }
}
