.mobile-service-hub,.mobile-service-sheet{display:none}
.float-service[hidden],.phone-card[hidden],.float-service:not([href]),.float-service[href="tel:"],.phone-card[href="tel:"]{display:none!important}
@media(max-width:768px){
  .has-mobile-service-hub .float-service,.has-mobile-service-hub .ai-float{display:none!important}
  .has-mobile-service-hub .ai-panel{right:8px;bottom:calc(76px + env(safe-area-inset-bottom));width:calc(100vw - 16px);height:min(520px,calc(100dvh - 150px))}
  .mobile-service-host{display:flex;min-width:0}
  .has-mobile-service-hub .mobile-tabbar{grid-template-columns:repeat(5,minmax(0,1fr))}
  .mobile-service-hub{display:flex;min-width:0;min-height:50px;align-items:center;justify-content:center;flex-direction:column;gap:2px;width:100%;padding:0;border:0;border-radius:10px;background:transparent;color:var(--muted);font:inherit;font-size:12px;line-height:1.2;cursor:pointer}
  .mobile-service-hub:hover,.mobile-service-hub[aria-expanded="true"]{background:var(--soft);color:var(--primary)}
  .mobile-service-hub i{font-size:16px;color:var(--primary)}
  .mobile-service-hub:hover i,.mobile-service-hub[aria-expanded="true"] i{color:var(--primary)}
  .mobile-service-sheet{position:fixed;right:8px;bottom:calc(76px + env(safe-area-inset-bottom));left:8px;z-index:35;display:block;padding:14px;border:1px solid var(--line);border-radius:18px;background:var(--card);box-shadow:0 24px 68px rgba(24,33,45,.28)}
  .mobile-service-sheet[hidden]{display:none}
  .mobile-service-open .dh-widget:not(.is-open){visibility:hidden;pointer-events:none}
  .mobile-service-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 2px 12px}
  .mobile-service-sheet-head strong,.mobile-service-sheet-head span{display:block}
  .mobile-service-sheet-head strong{font-size:17px}
  .mobile-service-sheet-head span{color:var(--muted);font-size:12px}
  .mobile-service-sheet-head button{width:36px;height:36px;border:0;border-radius:50%;background:var(--soft);color:var(--ink);font-size:22px;cursor:pointer}
  .mobile-service-action{display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;min-height:62px;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);font:inherit;text-align:left;cursor:pointer}
  .mobile-service-action[hidden]{display:none}
  .mobile-service-action>i:first-child{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:var(--soft);color:var(--primary)}
  .mobile-service-action span strong,.mobile-service-action span small{display:block}
  .mobile-service-action span small{margin-top:2px;color:var(--muted);font-size:12px}
  .mobile-service-action>i:last-child{color:var(--muted);font-size:12px}
  .mobile-service-open .mobile-service-hub{box-shadow:0 0 0 9999px rgba(24,33,45,.22)}
}
.ai-float{position:fixed;right:18px;bottom:78px;z-index:31;border:0;border-radius:999px;background:var(--primary);color:var(--on-primary);box-shadow:0 12px 34px rgba(24,33,45,.16);display:flex;align-items:center;gap:8px;padding:11px 15px;font-weight:800;cursor:pointer;font-family:inherit}.ai-float i{color:var(--on-primary)}.ai-panel{position:fixed;right:18px;bottom:132px;width:min(380px,calc(100vw - 28px));height:min(560px,calc(100vh - 160px));background:var(--card);border:1px solid var(--line);border-radius:8px;box-shadow:0 22px 60px rgba(24,33,45,.22);z-index:32;display:none;overflow:hidden}.ai-panel.show{display:flex;flex-direction:column}.ai-panel-head{background:var(--primary);color:var(--on-primary);padding:14px 16px;display:flex;justify-content:space-between;align-items:center;gap:12px}.ai-panel-head strong{display:block;font-size:16px}.ai-panel-head span{display:block;font-size:12px}.ai-close{border:0;background:var(--primary-dark);color:var(--on-primary);width:30px;height:30px;border-radius:50%;cursor:pointer}.ai-messages{flex:1;overflow:auto;padding:14px;background:var(--bg);display:flex;flex-direction:column;gap:10px}.ai-msg{display:flex}.ai-msg.user{justify-content:flex-end}.ai-bubble{max-width:82%;background:var(--card);border:1px solid var(--line);border-radius:8px;padding:10px 12px;font-size:14px;line-height:1.6;white-space:pre-wrap}.ai-msg.user .ai-bubble{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}.ai-quick{display:flex;gap:8px;overflow-x:auto;padding:10px 12px;border-top:1px solid var(--line);background:var(--card)}.ai-quick button{flex:0 0 auto;border:1px solid var(--line);background:var(--soft);color:var(--primary);border-radius:999px;padding:6px 10px;cursor:pointer}.ai-form{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line);background:var(--card)}.ai-form textarea{flex:1;resize:none;border:1px solid var(--line);border-radius:6px;padding:9px;min-height:42px;max-height:96px;font:inherit}.ai-form button{width:72px;border:0;border-radius:6px;background:var(--primary);color:var(--on-primary);font-weight:800;cursor:pointer}.ai-form button:disabled{background:var(--soft);color:var(--muted);cursor:not-allowed}.has-digital-human .float-service{bottom:260px;transition:opacity .18s ease,transform .18s ease}.has-digital-human .ai-float{bottom:312px;transition:opacity .18s ease,transform .18s ease}.has-digital-human .ai-panel{bottom:366px;max-height:calc(100dvh - 394px)}.digital-human-panel-open .float-service,.digital-human-panel-open .ai-float{opacity:0;pointer-events:none;transform:translateY(8px)}

/* SDK 会在挂载时追加样式；以接入层的选择器优先级保持当前站点配色。 */
body .dh-widget{
  --dh-ink:var(--ink);
  --dh-paper:var(--bg);
  --dh-line:var(--line);
  --dh-live-accent:var(--primary);
  --dh-image-unavailable:"图片暂不可用";
  color:var(--ink);
}
body .dh-widget ::selection,.ai-panel ::selection{background:var(--primary);color:var(--on-primary)}
body .dh-widget :is(button,input,a):focus-visible,
:is(.ai-float,.ai-panel button,.ai-panel textarea,.mobile-service-hub,.mobile-service-sheet button,.mobile-service-sheet a):focus-visible{
  outline:3px solid var(--primary);outline-offset:3px;
}
body .dh-widget .dh-panel :is(button,input,a):focus-visible{outline-color:var(--footer-ink)}
body .dh-widget :is(.dh-goods-sheet,.dh-current-product,.dh-share-link) :is(button,input,a):focus-visible,
body .dh-widget .dh-share-link:focus-visible{outline-color:var(--primary)}
body .dh-widget :is(.dh-orbit,.dh-live-view,.dh-anchor-avatar,.dh-product-image,.dh-good-image){background:var(--soft)}
body .dh-widget .dh-orbit{box-shadow:0 12px 35px rgba(24,33,45,.22)}
body .dh-widget .dh-orbit-label{background:var(--soft);color:var(--primary)}
body .dh-widget :is(.dh-enter-label,.dh-play-symbol){background:var(--primary);color:var(--on-primary)}
body .dh-widget .dh-play-symbol{border-color:var(--on-primary)}
body .dh-widget .dh-play-symbol::after{border-left-color:var(--on-primary)}
body .dh-widget .dh-orbit:hover :is(.dh-enter-label,.dh-play-symbol){background:var(--primary-dark)}
body .dh-widget .dh-panel{background:var(--footer-bg);color:var(--footer-ink);box-shadow:0 20px 70px rgba(24,33,45,.24)}
/* 画面遮罩仅使用中性明暗；不为人物、商品图片或视频加主题滤镜。 */
body .dh-widget .dh-panel::after{background:linear-gradient(180deg,transparent,rgba(0,0,0,.1) 12%,rgba(0,0,0,.82) 100%)}
body .dh-widget :is(.dh-anchor,.dh-close,.dh-message,.dh-sound,.dh-auto-toggle,.dh-room-feedback){background:var(--footer-bg);color:var(--footer-ink)}
body .dh-widget :is(.dh-anchor-name,.dh-room-status,.dh-skeleton){color:var(--footer-ink)}
body .dh-widget .dh-room-status::before{background:var(--footer-ink)}
body .dh-widget :is(.dh-caption,.dh-thread){scrollbar-color:var(--footer-muted) transparent}
body .dh-widget .dh-message--visitor,
body .dh-widget .dh-message--visitor::before,
body .dh-widget .dh-message--guide::before{color:var(--footer-ink)}
body .dh-widget :is(.dh-follow,.dh-product-speaking,.dh-product-detail,.dh-good-detail){background:var(--primary);color:var(--on-primary)}
body .dh-widget :is(.dh-follow[aria-pressed="true"],.dh-auto-toggle.is-paused,.dh-good-ask,.dh-goods-more){background:var(--soft);color:var(--primary);border-color:var(--line)}
body .dh-widget .dh-composer input{background:var(--footer-bg);color:var(--footer-ink);border-color:var(--footer-muted);caret-color:var(--footer-ink)}
body .dh-widget .dh-composer input::placeholder{color:var(--footer-muted)}
body .dh-widget .dh-composer button{background:var(--footer-bg);color:var(--footer-ink)}
body .dh-widget .dh-composer :is(.dh-goods-toggle,.dh-send){background:var(--primary);color:var(--on-primary)}
body .dh-widget .dh-composer .dh-like{background:var(--soft);color:var(--primary)}
body .dh-widget :is(.dh-current-product,.dh-goods-sheet,.dh-share-link){background:var(--card);color:var(--ink)}
body .dh-widget :is(.dh-goods-sheet h3,.dh-good-name){color:var(--ink)}
body .dh-widget :is(.dh-product-price,.dh-good-price){color:var(--primary-dark)}
body .dh-widget .dh-goods-close{background:var(--soft);color:var(--primary)}
body .dh-widget .dh-goods-list{scrollbar-color:var(--primary) var(--soft)}
body .dh-widget :is(.dh-good-item,.dh-share-link,.dh-share-link input){border-color:var(--line)}
body .dh-widget .dh-share-link input{background:var(--card);color:var(--ink);caret-color:var(--primary)}
body .dh-widget .dh-heart{color:var(--footer-ink)}
body .dh-widget :is(.dh-follow,.dh-close,.dh-sound,.dh-auto-toggle,.dh-product-detail,.dh-good-detail,.dh-good-ask,.dh-goods-more,.dh-goods-close):hover:not(:disabled),
body .dh-widget .dh-composer button:hover:not(:disabled){background:var(--primary-dark);color:var(--on-primary)}
body .dh-widget .dh-panel button:disabled{background:var(--soft);color:var(--muted);opacity:1}
body .dh-widget .dh-error{background:var(--danger);color:var(--on-primary)}
/* 人物优先：字幕、商品横卡、播放、输入各占一层，不再把商品竖挂在人脸旁。 */
body .dh-widget .dh-current-product{left:12px;right:12px;bottom:108px;width:auto;height:72px;display:grid;grid-template-columns:56px minmax(0,1fr) auto;grid-template-rows:12px 18px 20px;column-gap:10px;row-gap:2px;padding:8px;border-radius:12px}
body .dh-widget .dh-product-image{grid-column:1;grid-row:1/4;width:56px;height:56px;object-fit:contain;border-radius:6px}
body .dh-widget .dh-product-speaking{grid-column:2;grid-row:1;width:fit-content;padding:0;background:transparent;color:var(--primary-dark);font-size:10px;line-height:12px}
body .dh-widget .dh-product-name{grid-column:2;grid-row:2;margin:0;font-size:12px;line-height:18px;-webkit-line-clamp:1;overflow-wrap:anywhere}
body .dh-widget .dh-product-price{grid-column:2;grid-row:3;padding:0;font-size:14px;line-height:20px}
body .dh-widget .dh-product-detail{grid-column:3;grid-row:1/4;align-self:center;min-height:36px;padding:8px 10px;font-size:12px;line-height:20px;white-space:nowrap}
body .dh-widget .dh-caption{bottom:192px;max-height:42px;padding:0 2px;background:transparent;color:var(--footer-ink);text-shadow:0 1px 2px rgba(0,0,0,.95),0 2px 6px rgba(0,0,0,.7)}
body .dh-widget .dh-thread{bottom:242px;right:12px;max-height:clamp(20px,calc(100% - 530px),92px)}
body .dh-widget .dh-sound-row{bottom:64px}
body .dh-widget .dh-composer{bottom:12px;gap:6px}
body .dh-widget .dh-composer button{width:40px;height:44px;border-radius:12px}
body .dh-widget .dh-composer input{border-radius:12px}
/* SDK 隐藏原图失败的 img；在同一图位说明失败，不伪造商品图。 */
body .dh-widget .dh-current-product:has(>.dh-product-image[hidden])::before,
body .dh-widget .dh-good-item:has(>.dh-good-image[hidden])::before{content:var(--dh-image-unavailable);display:grid;place-items:center;flex:none;width:56px;height:56px;padding:4px;background:var(--soft);color:var(--muted);font-size:11px;line-height:16px;text-align:center;border-radius:6px}
body .dh-widget .dh-current-product:has(>.dh-product-image[hidden])::before{grid-column:1;grid-row:1/4}
body .dh-widget .dh-good-item:has(>.dh-good-image[hidden])::before{width:66px;height:76px}
html:lang(zh-TW) .dh-widget{--dh-image-unavailable:"圖片暫不可用"}
html:lang(en) .dh-widget{--dh-image-unavailable:"Image unavailable"}
html:lang(ja) .dh-widget{--dh-image-unavailable:"画像を表示できません"}
html:lang(ko) .dh-widget{--dh-image-unavailable:"이미지 없음"}
html:lang(es) .dh-widget{--dh-image-unavailable:"Imagen no disponible"}
.ai-float:hover,.ai-form button:hover:not(:disabled){background:var(--primary-dark);color:var(--on-primary)}
.ai-close:hover{background:var(--soft);color:var(--primary)}
.ai-quick button:hover,.mobile-service-action:hover{background:var(--soft);border-color:var(--primary)}
.ai-panel textarea{color:var(--ink);caret-color:var(--primary)}
.ai-panel textarea::placeholder{color:var(--muted);opacity:1}
.ai-messages,.ai-quick{scrollbar-color:var(--primary) var(--soft)}

/* 手机端双入口上下分层：客服紧邻底部导航，购物助手固定在其上方。 */
@media(max-width:560px){
  .float-service{bottom:calc(78px + env(safe-area-inset-bottom))}
  .ai-float{right:10px;bottom:calc(126px + env(safe-area-inset-bottom));padding:8px 10px;font-size:12px}
  .ai-panel{right:8px;bottom:calc(180px + env(safe-area-inset-bottom));width:calc(100vw - 16px);height:min(520px,calc(100dvh - 205px))}
  .has-digital-human .float-service{bottom:calc(206px + env(safe-area-inset-bottom))}
  .has-digital-human .ai-float{bottom:calc(254px + env(safe-area-inset-bottom))}
  .has-digital-human .ai-panel{bottom:calc(308px + env(safe-area-inset-bottom));height:min(520px,calc(100dvh - 328px))}
}
