/* 客服模块 */
/* 功能说明：前台客服悬浮头像与聊天面板、后台会话列表与对话区的全部样式 */

/* ============================================================ 前台悬浮入口 */
.dmk {
    position: fixed;
    right: 28px;
    bottom: 40px;
    z-index: 3000;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.dmk *,
.dmk *::before,
.dmk *::after { box-sizing: border-box; }

/* 圆形头像按钮：主题红底 + 白色客服头像，外圈弧形文字 */
.dmk-fab {
    position: relative;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #ff5470, #ff2d51);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 0 3px #fff, 0 10px 26px rgba(255, 45, 81, .34), 0 2px 6px rgba(0, 0, 0, .12);
    animation: dmk-pop 4s cubic-bezier(.32, .72, 0, 1) infinite;
    -webkit-tap-highlight-color: transparent;
}

.dmk-fab:hover { background: linear-gradient(145deg, #ff415f, #f52045); }
.dmk-fab:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(255, 45, 81, .35); }

.dmk-fab__core {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dmk-fab__core svg { width: 32px; height: 32px; display: block; }

/* 弧形文字：半圆路径绕在头像上方，文字沿路径居中 */
.dmk-fab__arc {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 112px;
    height: 112px;
    transform: translate(-50%, -50%);
    overflow: visible;
    pointer-events: none;
    z-index: 2;
}

.dmk-fab__arc-text {
    fill: #ff2d51;
    stroke: #fff;
    stroke-width: 3.2px;
    paint-order: stroke;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    font-family: inherit;
}

/* 未读角标：白边红点数字，压在头像右上角 */
.dmk-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 10px;
    background: #ff2d51;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    z-index: 3;
}

/* 每 4 秒叫一下：放大 + 左右摆三下再静止，用幅度换注意 */
@keyframes dmk-pop {
    0%        { transform: scale(1) rotate(0deg); }
    4%        { transform: scale(1.18) rotate(-7deg); }
    8%        { transform: scale(1.02) rotate(6deg); }
    12%       { transform: scale(1.14) rotate(-5deg); }
    16%       { transform: scale(1.02) rotate(4deg); }
    20%       { transform: scale(1.08) rotate(-2deg); }
    24%       { transform: scale(1) rotate(0deg); }
    100%      { transform: scale(1) rotate(0deg); }
}

/* 同一节奏扩一圈光晕，抖完就收 */
.dmk-fab::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 50%;
    background: #ff2d51;
    opacity: 0;
    animation: dmk-ring 4s cubic-bezier(.32, .72, 0, 1) infinite;
}

@keyframes dmk-ring {
    0%        { opacity: .45; transform: scale(1); }
    8%        { opacity: 0;    transform: scale(1.55); }
    9%        { opacity: .45;  transform: scale(1); }
    17%       { opacity: 0;    transform: scale(1.55); }
    18%       { opacity: .45;  transform: scale(1); }
    26%, 100% { opacity: 0;    transform: scale(1.55); }
}

/* 面板打开时停掉，别在用户看对话时还晃 */
.dmk-panel.is-open ~ .dmk-fab,
.dmk:has(.dmk-panel.is-open) .dmk-fab,
.dmk:has(.dmk-panel.is-open) .dmk-fab::after {
    animation: none;
}

/* ------------------------------------------------------------ 聊天面板 */
.dmk-panel {
    position: absolute;
    right: 0;
    /* 留出悬浮头像上方弧形文字的高度，避免文字压到面板底边 */
    bottom: 92px;
    width: 400px;
    height: 560px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(20, 24, 40, .22), 0 6px 18px rgba(20, 24, 40, .08);
    opacity: 0;
    transform: translateY(12px) scale(.97);
    transform-origin: 100% 100%;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.dmk-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dmk-panel[hidden] { display: none; }

.dmk-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #ff2d51, #ff5c78);
    color: #fff;
}

.dmk-head__avatar {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dmk-head__avatar svg { width: 24px; height: 24px; display: block; }

.dmk-head__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.dmk-head__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dmk-head__text b { font-size: 14px; font-weight: 600; }

.dmk-head__text i {
    font-style: normal;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .82);
}

.dmk-close {
    flex: none;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dmk-close:hover { background: rgba(255, 255, 255, .3); }
.dmk-close svg { width: 15px; height: 15px; }

.dmk-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 12px 16px;
    background: #f5f6f8;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dmk-body::-webkit-scrollbar { width: 5px; }
.dmk-body::-webkit-scrollbar-thumb { background: #d9dce4; border-radius: 3px; }

.dmk-loading {
    margin: 8px 0 0;
    font-size: 12px;
    color: #9aa0ae;
    text-align: center;
}

.dmk-empty {
    margin: auto;
    padding: 0 24px;
    font-size: 12.5px;
    line-height: 1.8;
    color: #9aa0ae;
    text-align: center;
}

/* 消息行：访客靠右红底白字，客服靠左白底黑字 */
.dmk-msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
}

.dmk-msg--kefu { align-self: flex-start; align-items: flex-start; }
.dmk-msg--user { align-self: flex-end; align-items: flex-end; }

.dmk-bubble {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(20, 24, 40, .05);
}

.dmk-msg--kefu .dmk-bubble {
    background: #fff;
    color: #2b3040;
    border-top-left-radius: 4px;
}

.dmk-msg--user .dmk-bubble {
    background: #ff2d51;
    color: #fff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(255, 45, 81, .24);
}

.dmk-time {
    margin-top: 4px;
    padding: 0 2px;
    font-size: 11px;
    color: #a3a8b4;
}

.dmk-tip {
    flex: none;
    margin: 0;
    padding: 6px 14px;
    background: #fff3f5;
    border-top: 1px solid #ffe1e7;
    color: #d92b4b;
    font-size: 12px;
}

.dmk-tip[hidden] { display: none; }

.dmk-foot {
    flex: none;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #eceef3;
}

.dmk-input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    height: 40px;
    min-height: 40px;
    max-height: 96px;
    padding: 9px 11px;
    border: 1px solid #e3e6ec;
    border-radius: 9px;
    background: #fafbfc;
    color: #2b3040;
    font: inherit;
    font-size: 13px;
    line-height: 20px;
    resize: none;
    overflow-y: hidden;
    outline: none;
}

.dmk-input:focus {
    border-color: #ff2d51;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 45, 81, .1);
}

.dmk-send {
    flex: none;
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 9px;
    background: #ff2d51;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.dmk-send:hover { background: #ef2346; }
.dmk-send:disabled { background: #f6b3c1; cursor: not-allowed; }

@media (max-width: 640px) {
    .dmk { right: 16px; bottom: 26px; }
    .dmk-panel { width: calc(100vw - 32px); max-width: 340px; }
}

@media (prefers-reduced-motion: reduce) {
    .dmk-fab { animation: none; }
}

/* ============================================================ 后台客服页 */
.csx {
    display: flex;
    gap: 16px;
    height: calc(100vh - 132px);
    min-height: 520px;
    align-items: stretch;
}

.csx .is-hidden { display: none !important; }

/* 左栏：会话列表 */
.csx-side {
    width: 300px;
    flex: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--adm-line);
    border-radius: 10px;
}

.csx-side__head {
    flex: none;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f0f2f6;
}

.csx-side__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--adm-text);
}

.csx-total {
    padding: 2px 9px;
    border-radius: 10px;
    background: #fff1f4;
    color: #ff2d51;
    font-size: 12px;
    font-weight: 600;
}

.csx-search {
    flex: none;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f2f6;
}

.csx-search .admin-input {
    height: 34px;
    padding: 0 11px;
    font-size: 13px;
}

.csx-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

.csx-list::-webkit-scrollbar { width: 5px; }
.csx-list::-webkit-scrollbar-thumb { background: #d9dce4; border-radius: 3px; }

.csx-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--adm-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.csx-item:hover { background: #f7f8fb; }

.csx-item.is-active {
    background: #fff1f4;
    box-shadow: inset 3px 0 0 #ff2d51;
}

.csx-ava {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(140deg, #ff8fa3, #ff2d51);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.csx-ava--lg { width: 38px; height: 38px; font-size: 15px; }

.csx-item__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.csx-item__main b {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csx-item__main i {
    font-style: normal;
    font-size: 12px;
    color: #8a90a2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csx-item__meta {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.csx-item__meta small { font-size: 11px; color: #a3a8b4; }

.csx-unread {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ff2d51;
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.csx-list__empty {
    padding: 28px 12px;
    color: #a3a8b4;
    font-size: 13px;
    text-align: center;
}

/* 右栏：对话区 */
.csx-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--adm-line);
    border-radius: 10px;
}

.csx-top {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f6;
}

.csx-top__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.csx-top__text b {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csx-top__text i {
    font-style: normal;
    font-size: 12px;
    color: #8a90a2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csx-live {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 10px;
    background: #eaf7ee;
    color: #2f9e51;
    font-size: 12px;
}

.csx-live i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2f9e51;
}

.csx-msgs {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 16px;
    background: #f7f8fb;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.csx-msgs::-webkit-scrollbar { width: 5px; }
.csx-msgs::-webkit-scrollbar-thumb { background: #d9dce4; border-radius: 3px; }

.csx-msg {
    display: flex;
    flex-direction: column;
    max-width: 72%;
}

.csx-msg--user { align-self: flex-start; align-items: flex-start; }
.csx-msg--admin { align-self: flex-end; align-items: flex-end; }

.csx-bubble {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.csx-msg--user .csx-bubble {
    background: #fff;
    border: 1px solid #e8eaef;
    color: #2b3040;
    border-top-left-radius: 4px;
}

.csx-msg--admin .csx-bubble {
    background: #ff2d51;
    color: #fff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(255, 45, 81, .2);
}

.csx-msg__time {
    margin-top: 4px;
    padding: 0 2px;
    font-size: 11px;
    color: #a3a8b4;
}

.csx-msgs__empty {
    margin: auto;
    padding: 0 24px;
    color: #a3a8b4;
    font-size: 13px;
    text-align: center;
}

/* 没选会话时的整块提示 */
.csx-emptybox {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f7f8fb;
    color: #a3a8b4;
    font-size: 13px;
    text-align: center;
}

.csx-emptybox b { font-size: 15px; color: #5b6175; }

.csx-emptybox svg { width: 40px; height: 40px; color: #c3c8d4; }

/* 快捷短语 */
.csx-quick {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px 0;
    border-top: 1px solid #f0f2f6;
}

.csx-quick__btn {
    max-width: 100%;
    padding: 4px 11px;
    border: 1px solid #e8eaef;
    border-radius: 14px;
    background: #fafbfd;
    color: #5b6175;
    font: inherit;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.csx-quick__btn:hover {
    border-color: #ffb3c1;
    background: #fff5f7;
    color: #ff2d51;
}

/* 输入区 */
.csx-input {
    flex: none;
    padding: 10px 16px 14px;
    background: #fff;
}

.csx-textarea {
    width: 100%;
    min-height: 74px;
    max-height: 140px;
    padding: 10px 12px;
    border: 1px solid var(--adm-line);
    border-radius: 8px;
    color: var(--adm-text);
    font: inherit;
    font-size: 13.5px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.csx-textarea:focus {
    border-color: #ff2d51;
    box-shadow: 0 0 0 3px rgba(255, 45, 81, .1);
}

.csx-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.csx-hint {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: #a3a8b4;
}

.csx-tip {
    flex: none;
    font-size: 12px;
    color: #d92b4b;
}

.csx-tip[hidden] { display: none; }

@media (max-width: 1280px) {
    .csx-side { width: 260px; }
}

/* 聊天图片：气泡里等比缩略，点开看原图 */
.dmk-foot .dmk-pic {
    flex: none;
    width: 36px;
    height: 36px;
    margin: 0 4px 0 8px;
    align-self: center;
    border: 1px solid #ebeef5;
    border-radius: 8px;
    background: #fff;
    color: #8a90a2;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color .15s, border-color .15s;
}

.dmk-foot .dmk-pic:hover { color: #ff2d51; border-color: #ffc2cd; }
.dmk-foot .dmk-pic svg { width: 19px; height: 19px; }

.dmk-bubble--pic { padding: 4px; background: #fff; }
.dmk-msg--user .dmk-bubble--pic { background: #fff; }
.dmk-piclink { display: block; line-height: 0; }
.dmk-img {
    display: block;
    max-width: 180px;
    max-height: 180px;
    border-radius: 6px;
    object-fit: cover;
}

/* 后台客服会话里的图片气泡 */
.csx-bubble--pic { padding: 4px; background: #fff; }
.csx-bubble--pic a { display: block; line-height: 0; }
.csx-img {
    display: block;
    max-width: 220px;
    max-height: 220px;
    border-radius: 6px;
    object-fit: cover;
}
.csx-pic { margin-right: 4px; }

/* ============================================================ 未登录引导 */
.dmk-gate {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 18px;
    text-align: center;
}

.dmk-gate__title {
    margin: 0;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 600;
}

.dmk-gate__desc {
    margin: 8px 0 18px;
    color: #8a90a2;
    font-size: 12.5px;
    line-height: 1.6;
}

.dmk-gate__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 26px;
    border-radius: 18px;
    background: linear-gradient(90deg, #ff2d51, #ff6a3d);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(255, 45, 81, .24);
}

.dmk-gate__btn:hover { color: #fff; filter: brightness(1.05); }

/* ============================================================ 商品咨询询问 */
.dmk-product {
    align-self: stretch;
    padding: 12px 13px;
    border: 1px solid #ffe0e6;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(20, 24, 40, .06);
}

.dmk-product__title {
    margin: 0 0 8px;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 600;
}

.dmk-product__card {
    padding: 9px 11px;
    border-radius: 8px;
    background: #fff6f7;
}

.dmk-product__card b {
    display: block;
    color: #1a1a1a;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dmk-product__card span {
    display: block;
    margin-top: 3px;
    color: #8a90a2;
    font-size: 11.5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dmk-product__acts {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.dmk-product__yes,
.dmk-product__no {
    flex: 1;
    height: 30px;
    border-radius: 15px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.dmk-product__yes {
    border: 0;
    background: linear-gradient(90deg, #ff2d51, #ff6a3d);
    color: #fff;
}

.dmk-product__yes:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.dmk-product__no {
    border: 1px solid #e8eaef;
    background: #fff;
    color: #606266;
}

.dmk-product__no:hover {
    border-color: #ff2d51;
    color: #ff2d51;
}

/* ============================================================ 演出卡片消息 */
.dmk-bubble--card {
    padding: 0 !important;
    background: none !important;
    max-width: 100%;
}

.dmk-card {
    display: flex;
    gap: 10px;
    width: 268px;
    padding: 10px;
    border: 1px solid #eef1f3;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    transition: border-color .16s, box-shadow .16s;
}

.dmk-card:hover {
    border-color: #ffd0d8;
    box-shadow: 0 4px 14px rgba(255, 45, 81, .12);
}

.dmk-card__pic {
    flex: none;
    width: 62px;
    height: 82px;
    border-radius: 7px;
    overflow: hidden;
    background: #f4f6f9;
}

.dmk-card__pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dmk-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.dmk-card__title {
    color: #1a1a1a;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dmk-card__meta {
    margin-top: 4px;
    color: #8a90a2;
    font-size: 11.5px;
    font-style: normal;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dmk-card__price {
    margin-top: auto;
    color: #ff2d51;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
}

/* 后台客服端同一张卡片（气泡在深色背景里，卡片保持白底） */
.csx-bubble--card {
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    max-width: 100%;
}

/* 卡片自己带边框，气泡不要再叠一层背景与圆角 */
.csx-msg--user .csx-bubble--card {
    background: none;
    border: 0;
}

.csx-card {
    display: flex;
    gap: 10px;
    width: 280px;
    padding: 10px;
    border: 1px solid #eef1f3;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
}

.csx-card__pic {
    flex: none;
    width: 62px;
    height: 82px;
    border-radius: 7px;
    overflow: hidden;
    background: #f4f6f9;
}

.csx-card__pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.csx-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.csx-card__title {
    color: #1a1a1a;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.csx-card__meta {
    margin-top: 4px;
    color: #8a90a2;
    font-size: 11.5px;
    font-style: normal;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.csx-card__price {
    margin-top: auto;
    color: #ff2d51;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
}

/* 「有新消息」浮层：贴在消息区底部上方，用户翻历史时提示，点一下回到底部 */
.dmk-newtip {
    position: absolute;
    left: 50%;
    bottom: 68px;
    transform: translateX(-50%);
    padding: 7px 16px;
    border: 0;
    border-radius: 15px;
    background: #fff;
    color: #ff2d51;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(20, 24, 40, .18);
    z-index: 3;
}

.dmk-newtip:hover {
    background: #fff5f6;
}

.dmk-newtip[hidden] {
    display: none;
}

/* 客服来信提醒：浮在悬浮按钮上方，点一下打开聊天 */
.dmk-alert {
    position: fixed;
    right: 34px;
    bottom: 112px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 18px;
    background: #fff;
    color: #ff2d51;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(20, 24, 40, .16);
    z-index: 9998;
    animation: dmk-alert-in .22s cubic-bezier(.23, 1, .32, 1);
}

.dmk-alert svg {
    width: 15px;
    height: 15px;
}

.dmk-alert[hidden] {
    display: none;
}

.dmk-alert:hover {
    background: #fff5f6;
}

@keyframes dmk-alert-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .dmk-alert { animation: none; }
}

/* 撤回后的气泡 */
.dmk-bubble--recalled {
    background: transparent;
    border: 1px dashed #dfe3ea;
    color: #9aa0ac;
    font-size: 12px;
}

/* TG 推广卡：聊天窗顶部一条，内容由站点设置决定 */
.dmk-promo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    margin: 0 12px 8px;
    padding: 10px;
    border-radius: 10px;
    background: linear-gradient(120deg, #fff1f4, #fff8f4);
}

.dmk-promo__pic {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.dmk-promo__pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dmk-promo__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.dmk-promo__text b {
    color: #1d2129;
    font-size: 13.5px;
}

.dmk-promo__text i {
    color: #8a90a2;
    font-size: 12px;
    font-style: normal;
    line-height: 1.5;
}

/* 聊天里的充值审核卡 */
.dmk-rechargecard {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 190px;
    padding: 2px 0;
}

.dmk-rechargecard b {
    font-size: 13px;
    color: #1d2129;
}

.dmk-rechargecard span {
    color: #6b7280;
    font-size: 12px;
}

.dmk-rechargecard em {
    color: #e0334f;
    font-style: normal;
    font-size: 13px;
    font-weight: 600;
}

/* 充值审核卡：用户气泡是红底，卡片单独做成白底，不然字看不清 */
.dmk-msg--user .dmk-bubble--recharge {
    background: #fff;
    color: #2b3040;
    padding: 10px 12px;
    border-radius: 10px;
    border-top-right-radius: 4px;
    box-shadow: 0 3px 10px rgba(20, 24, 40, .12);
}

.dmk-msg--user .dmk-bubble--recharge .dmk-rechargecard b {
    color: #1d2129;
}

.dmk-msg--user .dmk-bubble--recharge .dmk-rechargecard span {
    color: #6b7280;
}

.dmk-msg--user .dmk-bubble--recharge .dmk-rechargecard em {
    color: #e0334f;
}

/* 表情按钮与面板 */
.dmk-foot {
    position: relative;
}

.dmk-emoji {
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #e6e9ef;
    border-radius: 9px;
    background: #fff;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dmk-emoji svg {
    width: 20px;
    height: 20px;
}

.dmk-emopanel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    max-height: 200px;
    padding: 8px;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(20, 24, 40, .16);
    z-index: 20;
    overflow-y: auto;
}

.dmk-emopanel[hidden] {
    display: none;
}

.dmk-emobtn {
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.dmk-emobtn:hover {
    background: #f4f6fa;
}

/* 只发表情时放大显示 */
.dmk-bubble--emoji {
    font-size: 38px;
    line-height: 1.15;
    padding: 2px 6px;
    background: transparent !important;
    box-shadow: none;
}

/* 发卡片：聊天窗内底部升起的抽屉 */
.dmk-cardbtn {
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #e6e9ef;
    border-radius: 9px;
    background: #fff;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dmk-cardbtn svg {
    width: 20px;
    height: 20px;
}

.dmk-sheet {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    border-radius: 14px;
    overflow: hidden;
}

.dmk-sheet[hidden] {
    display: none;
}

.dmk-sheet__mask {
    position: absolute;
    inset: 0;
    background: rgba(14, 16, 26, .38);
    opacity: 0;
    transition: opacity .2s ease;
}

.dmk-sheet.is-open .dmk-sheet__mask {
    opacity: 1;
}

.dmk-sheet__panel {
    position: relative;
    width: 100%;
    max-height: 82%;
    padding: 8px 14px 14px;
    border-radius: 16px 16px 0 0;
    background: #f6f7f9;
    box-shadow: 0 -16px 36px rgba(12, 16, 30, .2);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform .24s cubic-bezier(.22, .8, .28, 1);
}

.dmk-sheet.is-open .dmk-sheet__panel {
    transform: translateY(0);
}

.dmk-sheet__bar {
    width: 34px;
    height: 4px;
    margin: 0 auto 8px;
    border-radius: 99px;
    background: #d8dce5;
}

.dmk-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px 9px;
}

.dmk-sheet__head b {
    font-size: 15px;
    color: #1d2129;
}

.dmk-sheet__close {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eceff4;
    color: #6b7280;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.dmk-sheet__tabs {
    display: flex;
    gap: 4px;
    padding: 3px;
    margin-bottom: 9px;
    border-radius: 10px;
    background: #e9ecf2;
}

.dmk-sheet__tabs button {
    flex: 1;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #5b6270;
    font-size: 13px;
    cursor: pointer;
    transition: background .18s, color .18s, box-shadow .18s;
}

.dmk-sheet__tabs button.is-active {
    background: #fff;
    color: #1d2129;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(20, 24, 40, .08);
}

.dmk-sheet__list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.dmk-pick {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.dmk-pick:hover {
    background: #fbfbfd;
}

.dmk-pick__pic {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f2f6;
}

.dmk-pick__pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dmk-pick__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.dmk-pick__info b {
    font-size: 13px;
    font-weight: 600;
    color: #1d2129;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dmk-pick__info i {
    font-style: normal;
    font-size: 11.5px;
    color: #8a90a2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dmk-pick__info em {
    align-self: flex-start;
    padding: 0 6px;
    border-radius: 99px;
    background: #fff1f4;
    color: #e03150;
    font-style: normal;
    font-size: 10.5px;
    line-height: 16px;
}

.dmk-pick__price {
    flex: none;
    color: #e03150;
    font-size: 12.5px;
    font-weight: 600;
}

.dmk-sheet__empty {
    margin: 0;
    padding: 24px 0 30px;
    text-align: center;
    color: #9aa0ac;
    font-size: 12.5px;
}

/* 电脑客服输入区改版：输入框整行，工具收到下方 */
.dmk-foot {
    display: block;
    padding: 10px 12px 10px;
    border-top: 1px solid #eef0f3;
    background: #fff;
}

.dmk-compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 4px 4px 4px 14px;
    border: 1px solid #eef0f4;
    border-radius: 20px;
    background: #f5f6f9;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.dmk-compose:focus-within {
    background: #fff;
    border-color: #ffd3db;
    box-shadow: 0 0 0 3px rgba(255, 45, 81, .08);
}

.dmk-compose .dmk-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    max-height: 104px;
    padding: 9px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 14px;
    line-height: 20px;
    resize: none;
    outline: none;
}

.dmk-compose .dmk-send {
    flex: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff5a6e, #ff2d51);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 12px rgba(255, 45, 81, .26);
    cursor: pointer;
}

.dmk-compose .dmk-send svg {
    width: 17px;
    height: 17px;
    margin-left: -1px;
}

.dmk-compose .dmk-send:disabled {
    opacity: .45;
    box-shadow: none;
}

.dmk-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 5px;
    padding-left: 2px;
}

.dmk-tools .dmk-cardbtn,
.dmk-tools .dmk-emoji,
.dmk-tools .dmk-pic {
    width: 32px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7c8392;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.dmk-tools .dmk-cardbtn svg,
.dmk-tools .dmk-emoji svg,
.dmk-tools .dmk-pic svg {
    width: 19px;
    height: 19px;
}

.dmk-tools .dmk-cardbtn:hover,
.dmk-tools .dmk-emoji:hover,
.dmk-tools .dmk-pic:hover {
    background: #f4f6fa;
    color: #ff2d51;
}

/* 电脑客服窗放大，工具条放到输入框上方 */
.dmk-panel {
    width: min(560px, calc(100vw - 32px));
    height: min(700px, calc(100vh - 120px));
}

.dmk-tools {
    margin: 0 0 6px;
    padding-left: 2px;
}

/* 聊天框上方快捷回复：三条等宽，超出省略 */
.dmk-quick {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 0 2px 7px;
}

.dmk-quickbtn {
    height: 30px;
    padding: 0 10px;
    border: 1px solid #eef0f4;
    border-radius: 999px;
    background: #f8f9fb;
    color: #5b6270;
    font: inherit;
    font-size: 12px;
    line-height: 28px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.dmk-quickbtn:hover {
    background: #fff1f4;
    border-color: #ffd6de;
    color: #e03150;
}

/* 聊天顶部商品卡 */
.dmk-promo--product {
    text-decoration: none;
    color: inherit;
}

.dmk-promo__price {
    margin-top: 2px;
    color: #e03150;
    font-style: normal;
    font-size: 12.5px;
    font-weight: 600;
}

/* 图文话术消息 */
.dmk-bubble--rich {
    max-width: 300px;
    padding: 9px 10px;
}

.dmk-rich__text {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.7;
    font-size: 13px;
}

.dmk-rich__imgs {
    display: grid;
    gap: 4px;
    margin-top: 7px;
}

.dmk-rich__imgs--1 { grid-template-columns: 1fr; }
.dmk-rich__imgs--2 { grid-template-columns: 1fr 1fr; }
.dmk-rich__imgs--3 { grid-template-columns: 1fr 1fr 1fr; }

.dmk-rich__pic {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 7px;
    overflow: hidden;
    background: #f0f2f6;
}

.dmk-rich__pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* 聊天图片：电脑端在页内查看，不另开网页 */
.dmk-imgview {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(10, 12, 18, .82);
    backdrop-filter: blur(3px);
    cursor: zoom-out;
}
.dmk-imgview[hidden] { display: none; }
.dmk-imgview img {
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .45);
    object-fit: contain;
    cursor: default;
}
.dmk-imgview__close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.dmk-imgview__close:hover { background: rgba(255, 255, 255, .2); }
