*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{height:100%;background:#F4F5F9;}
body{
    font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
    font-size:13px;color:#333;line-height:1.4;
    display:flex;flex-direction:column;
    height:100vh;height:100dvh;
    overflow:hidden;overscroll-behavior:none;-webkit-font-smoothing:antialiased;
}
img{display:block;border:0;}
button{font-family:inherit;cursor:pointer;border:0;background:none;color:inherit;}

/* ══════ 顶部：居中标题 + 两行灰字 ══════ */
.jm-head{
    flex:0 0 auto;position:relative;z-index:20;
    padding:calc(24px + env(safe-area-inset-top)) 16px 0;
    text-align:center;background:#F7F7F7;
}
.jm-title{
    font-size:18px;font-weight:700;line-height:27px;color:#1F1F1F;
    letter-spacing:.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.jm-sub{
    font-size:13px;line-height:19.5px;color:#999;font-weight:400;
}
.jm-sub:first-of-type{margin-top:14px;}

/* ══════ 公告条（滚动跑马灯） ══════ */
.jm-notice{
    flex:0 0 auto;position:relative;z-index:19;
    height:28px;margin:10px 12px 0;padding:0 6px 0 8px;
    display:flex;align-items:center;gap:6px;
    background:#FFF6E8;border-radius:8px;
}
.jm-notice.d-none{display:none;}
.jm-horn{flex:0 0 auto;width:14px;height:14px;color:#FF9900;}
.jm-notice-txt{
    flex:1 1 auto;min-width:0;height:100%;position:relative;overflow:hidden;
    -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 8px,#000 calc(100% - 8px),transparent 100%);
            mask-image:linear-gradient(90deg,transparent 0,#000 8px,#000 calc(100% - 8px),transparent 100%);
}
.jm-marquee{
    display:inline-block;white-space:nowrap;line-height:28px;
    font-size:12.5px;color:#E8730C;will-change:transform;
}
.jm-marquee>span{display:inline-block;padding-right:56px;}
.jm-marquee.run{animation:jmNoticeScroll var(--dur,14s) linear infinite;}
@keyframes jmNoticeScroll{
    0%{transform:translate3d(0,0,0);}
    100%{transform:translate3d(-50%,0,0);}
}
@media (prefers-reduced-motion: reduce){
    .jm-marquee.run{animation:none;transform:none;}
    .jm-marquee>span:last-child{display:none;}
}
.jm-notice-x{flex:0 0 auto;width:17px;height:17px;display:flex;align-items:center;justify-content:center;color:#C9A98A;}
.jm-notice-x svg{width:9px;height:9px;}

/* ══════ 聊天区 ══════ */
.chat-box{
    flex:1 1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch;
    padding:10px;position:relative;background:#F7F7F7;
}

/* 首屏引导卡（欢迎语 + 说明） */
.jm-guide{
    padding:10px 10px;margin:0;border-radius:10px;background:#fff;
    word-wrap:break-word;overflow-wrap:break-word;
}
.jm-guide-hi{font-size:14px;line-height:22.4px;color:#333;}
.jm-guide-txt{margin-top:8px;font-size:14px;line-height:22.4px;color:#333;}
.jm-guide-txt .hl{
    font-weight:700;
    background:linear-gradient(to bottom,transparent 70%,#FF9900 30%);
}
.jm-guide-btn{
    display:block;width:100%;height:39px;margin-top:12px;
    border-radius:20px;border:1px solid #FF9900;
    background:#FF9900;color:#fff;
    font-size:14px;font-weight:600;line-height:37px;text-align:center;
    transition:opacity .15s;
}
.jm-guide-btn:active{opacity:.82;}
.jm-faq{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    height:44px;line-height:44px;
    border-top:1px solid rgba(0,0,0,.06);
    font-size:14px;color:#1F1F1F;text-align:left;
}
.jm-faq:first-of-type{margin-top:8px;}
.jm-faq span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.jm-faq svg{flex:0 0 auto;width:20px;height:20px;color:#8C8C8C;}
.jm-faq:active{opacity:.6;}

/* 消息行 */
.jm-msg{display:flex;align-items:flex-start;margin-bottom:16px;}
.jm-me{justify-content:flex-end;}
.jm-msg-ava{
    flex:0 0 auto;width:36px;height:36px;border-radius:50%;
    background:#fff;overflow:hidden;margin:0 4px 0 8px;
}
.jm-msg-ava svg,.jm-msg-ava img{width:100%;height:100%;display:block;object-fit:cover;}
.jm-col{min-width:0;flex:1 1 auto;max-width:calc(100% - 56px);}
.jm-me .jm-col{flex:0 1 auto;display:flex;flex-direction:column;align-items:flex-end;max-width:75%;}
.jm-meta{display:flex;align-items:center;gap:6px;margin-bottom:4px;}
.jm-meta-name{font-size:12px;line-height:13.2px;color:#999;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* 气泡 */
.jm-bubble{
    padding:10px 12px;border-radius:10px;
    font-size:14px;line-height:22.4px;color:#333;
    white-space:pre-wrap;word-wrap:break-word;word-break:break-word;
    max-width:100%;
}
.jm-server .jm-bubble{background:#fff;}
.jm-me .jm-bubble{background:#FF9900;color:#fff;}
.jm-bubble a{color:#E8730C;text-decoration:none;word-break:break-all;}
.jm-me .jm-bubble a{color:#FFF6E8;text-decoration:underline;}
.jm-read{font-size:11px;color:#B3B3B3;margin:0 2px 4px;align-self:flex-end;}
.jm-img{max-width:150px;border-radius:8px;overflow:hidden;background:#fff;cursor:pointer;}
.jm-img img{width:100%;height:auto;display:block;}

/* ══════ 底部：输入栏 ══════ */
.jm-foot{
    flex:0 0 auto;background:#F7F9F9;position:relative;z-index:20;
    padding-bottom:env(safe-area-inset-bottom);
}
/* ══════ 快捷提问 ══════ */
.jm-quick{
    display:flex;gap:8px;padding:8px 12px 0;
    overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;
}
.jm-quick::-webkit-scrollbar{display:none;}
.jm-quick-btn{
    flex:0 0 auto;max-width:78vw;
    padding:7px 13px;border-radius:15px;border:1px solid #FFD9AC;background:#fff;
    color:#E8730C;font-size:12.5px;line-height:1.35;font-family:inherit;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
    box-shadow:0 1px 3px rgba(224,136,76,.08);
    -webkit-tap-highlight-color:transparent;transition:background .15s,border-color .15s;
}
.jm-quick-btn:active,.jm-quick-btn.on{background:#FFF3E6;border-color:#FF9900;}
.jm-quick-btn:disabled{opacity:.55;}

.jm-composer{
    display:flex;align-items:center;gap:10px;
    padding:8px 12px;
}
.jm-input{
    flex:1 1 auto;min-width:0;height:36px;border:0;border-radius:18px;outline:0;
    background:#fff;padding:8px 12px;
    font-size:14px;line-height:20px;color:#1F1F1F;font-family:inherit;-webkit-appearance:none;
}
.jm-input::placeholder{color:#CCC;font-size:14px;}
.jm-plus{
    flex:0 0 auto;width:40px;height:40px;border-radius:50%;
    display:flex;align-items:center;justify-content:center;color:#1F1F1F;
}
.jm-plus svg{width:24px;height:24px;}
.jm-plus.on{transform:rotate(45deg);}
.jm-plus:active{opacity:.6;}
.jm-plus.hide{display:none;}
.jm-send{
    flex:0 0 auto;min-width:56px;height:32px;padding:0 14px;border:0;border-radius:16px;
    display:none;align-items:center;justify-content:center;
    background:linear-gradient(180deg,#FFB020,#FF8000);color:#fff;
    font-size:14px;line-height:1;font-weight:600;font-family:inherit;
    box-shadow:0 1px 5px rgba(255,128,0,.35);
}
.jm-send.on{display:inline-flex;}
.jm-send:active{opacity:.8;}
.jm-send:disabled{opacity:.6;}

/* 工具面板 */
.jm-tools{
    display:none;align-items:center;gap:26px;
    padding:14px 16px 16px;border-top:1px solid #ECECEC;background:#fff;
}
.jm-tools.on{display:flex;}
.jm-tool{
    display:flex;flex-direction:column;align-items:center;gap:5px;
    font-size:11px;color:#666;
}
.jm-tool i{
    width:48px;height:48px;border-radius:12px;background:#F5F5F5;
    display:flex;align-items:center;justify-content:center;color:#4A4A4A;
}
.jm-tool svg{width:24px;height:24px;}
.jm-tool:active{opacity:.6;}

/* 表情面板 */
.jm-emoji{
    position:absolute;left:12px;right:12px;bottom:calc(100% + 4px);
    background:#fff;border:1px solid #EFEFEF;border-radius:10px;
    box-shadow:0 -2px 12px rgba(0,0,0,.09);padding:8px;
    display:none;grid-template-columns:repeat(8,1fr);gap:2px;
}
.jm-emoji.on{display:grid;}
.jm-emoji span{font-size:20px;line-height:32px;text-align:center;border-radius:6px;}
.jm-emoji span:active{background:#F5F5F5;}

/* 图片预览 */
.preview-overlay{position:fixed;inset:0;background:rgba(0,0,0,.92);z-index:9999;display:none;align-items:center;justify-content:center;}
.preview-img{max-width:92%;max-height:86%;border-radius:8px;}
.preview-close{position:absolute;top:calc(14px + env(safe-area-inset-top));right:18px;color:#fff;font-size:28px;line-height:1;}
#fileInput{display:none;}

/* ══════ 客服在线状态 ══════ */
.jm-st{
    display:flex;align-items:center;justify-content:center;gap:5px;
    font-size:13px;line-height:19.5px;color:#A9AEBB;font-weight:400;
}
.jm-st.d-none{display:none;}
.jm-st-dot{flex:0 0 auto;width:6px;height:6px;border-radius:50%;background:#BFC4D0;display:inline-block;}
.jm-offbar{
    flex:0 0 auto;display:flex;align-items:flex-start;gap:7px;
    margin:10px 12px 0;padding:9px 12px;border-radius:9px;
    background:#F1F2F5;color:#868C9B;font-size:12.5px;line-height:1.55;
}
.jm-offbar.d-none{display:none;}
.jm-offbar-dot{flex:0 0 auto;width:7px;height:7px;border-radius:50%;background:#B4B9C6;margin-top:6px;}
.jm-sysmsg{
    width:fit-content;max-width:80%;margin:12px auto 14px;padding:5px 11px;
    background:#F0F1F5;color:#8C92A1;border-radius:10px;
    font-size:11.5px;line-height:1.6;text-align:center;
}

/* 通用隐藏 */
.d-none{display:none !important;}
