/* Reference messenger layout, scoped to the existing first-party support widget. */
.ts-root{--ts-accent:#2563eb;--ts-line:#e5eaf2;--ts-ink:#17253e;--ts-soft:#eff6ff;font-family:Arial,"PingFang SC","Microsoft YaHei",sans-serif}
.ts-root .ts-float-panel{right:0;bottom:68px;width:min(380px,calc(100vw - 44px));height:min(620px,calc(100dvh - 116px));border:0;border-radius:22px;background:#fff;box-shadow:0 18px 70px #162c4926,0 3px 12px #162c4912;animation:ts-reference-open .16s ease-out;isolation:isolate}
.ts-root .ts-float-panel.ts-expanded,.ts-root.ts-expanded .ts-float-panel{width:min(700px,calc(100vw - 44px));height:min(760px,calc(100dvh - 116px))}
.ts-root .ts-float-panel.ts-view-home{width:min(380px,calc(100vw - 44px));height:min(560px,calc(100dvh - 116px))}
.ts-root .ts-launcher:first-of-type{background:#2563eb;color:#fff;border:0;box-shadow:0 6px 20px #2563eb40}
.ts-root .ts-widget-close{position:absolute;right:0;bottom:0;display:grid;place-items:center;width:56px;height:56px;min-width:56px;margin:0;padding:0;border:0;border-radius:50%;background:#2563eb;color:#fff;box-shadow:0 6px 20px #2563eb30;font:36px/1 Arial,sans-serif;cursor:pointer;transition:background .15s}
.ts-root .ts-widget-close:hover{background:#1d4ed8}
.ts-root.ts-panel-open>.ts-widget-close{visibility:visible!important;pointer-events:auto!important}
.ts-root .ts-home{display:flex;flex:1;flex-direction:column;min-height:0;overflow:auto;background:#fff;scrollbar-width:thin}
.ts-root .ts-home-hero{position:relative;flex-shrink:0;min-height:0;padding:20px 24px 16px;background:linear-gradient(135deg,#eff6ff,#f8fbff 65%,#edf8f6);color:#17253e}
.ts-root .ts-home-topline{display:flex;align-items:center;justify-content:space-between;gap:12px;height:32px}
.ts-root .ts-home-mark{display:flex;align-items:center;gap:9px;min-width:0;color:#fff}
.ts-root .ts-home-mark img{display:block;width:36px;height:36px;object-fit:contain;border-radius:10px}
.ts-root .ts-home-mark strong,.ts-root .ts-home-mark span{font-size:13px;font-weight:600}
.ts-root .ts-home-heading{margin:12px 0 7px;font-size:24px;font-weight:700;line-height:1.3;letter-spacing:-.5px;color:#17253e}
.ts-root .ts-home-intro{margin:0;font-size:14px;font-weight:400;line-height:1.6;color:#62738c;overflow-wrap:anywhere}
.ts-root .ts-home-menu{position:relative;z-index:1;display:flex;flex-direction:column;flex-shrink:0;margin:0 20px;border:1px solid #e6ebf3;border-radius:16px;background:#fff;overflow:hidden}
.ts-root .ts-home-category{position:relative;display:flex;flex-direction:column;justify-content:center;gap:2px;width:100%;min-height:74px;margin:0;padding:13px 40px 13px 16px;border:0;border-radius:0;cursor:pointer;box-shadow:none;background:#fff;color:#142038;text-align:left;font-size:14px;line-height:1.35}
.ts-root .ts-home-category+.ts-home-category:before{position:absolute;top:0;left:16px;right:16px;height:1px;background:#e1e6ed;content:''}
.ts-root .ts-home-category-title{font-size:14px;font-weight:600}
.ts-root .ts-home-category-description{font-size:12px;color:#64738b;line-height:1.4;overflow-wrap:anywhere}
.ts-root .ts-home-start{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-shrink:0;min-height:52px;margin:14px 20px 12px;padding:13px 16px;border:0;border-radius:12px;background:#2563eb;color:#fff;font-size:14px;text-align:left;box-shadow:none;transition:background .15s}
.ts-root .ts-home-start:after{content:'↗';color:#fff;font-size:22px;line-height:1;transform:rotate(-5deg)}
.ts-root .ts-home-start:hover{background:#1d4ed8}
.ts-root .ts-home-tabs{display:flex;flex-shrink:0;min-height:58px;margin-top:auto;padding:4px 20px 6px;border:0;background:#fff}
.ts-root .ts-home-tab{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:44px;min-height:48px;margin:0;padding:3px 8px;border:0;border-radius:8px;background:none;color:#6d80a0;font-size:12px;line-height:1.4;text-decoration:none;box-shadow:none}
.ts-root .ts-home-tab svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.ts-root .ts-home-tab[aria-selected=true],.ts-root .ts-home-tab[aria-current=page]{color:#152136}
.ts-root .ts-home-tab[aria-selected=true] svg,.ts-root .ts-home-tab[aria-current=page] svg{fill:#dbeafe;stroke:#2563eb}
.ts-root .ts-home-tab:hover{background:#f5f8f7}
.ts-root .ts-widget-brand{display:flex;align-items:center;justify-content:center;flex-shrink:0;min-height:28px;margin:0;padding:6px 16px;border-top:1px solid #dfe5ee;background:#fff;color:#8492a8;font-size:10px;line-height:1.3;letter-spacing:.15px}
.ts-root .ts-view-chat .ts-widget-brand{display:none}
.ts-root .ts-float-head{display:flex;align-items:center;gap:4px;flex-shrink:0;min-height:63px;height:63px;padding:9px 13px;background:#fff;border:0;color:#182137;backdrop-filter:none;-webkit-backdrop-filter:none}
.ts-root .ts-float-head>img{display:none}
.ts-root .ts-head-title{flex:1;min-width:0;margin-left:1px}
.ts-root .ts-head-title strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;line-height:1.4;color:#182137}
.ts-root .ts-head-subtitle{display:block;margin-top:2px;color:#8a97a9;font-size:10px;line-height:1.3}
.ts-root .ts-back,.ts-root .ts-expand{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;margin:0;padding:0;border:0;border-radius:8px;background:transparent;color:#6c7f9e;font:24px/1 Arial,sans-serif;box-shadow:none}
.ts-root .ts-back:hover,.ts-root .ts-expand:hover{background:#f3f5f8}
.ts-root .ts-back svg,.ts-root .ts-expand svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.ts-root .ts-float-head .ts-login-chat,.ts-root .ts-float-head .ts-personal-status-toggle{display:none}
.ts-root .ts-chat-body{position:relative;display:flex;flex-direction:column;flex:1;min-height:0;padding:0;background:#fff}
.ts-root .ts-chat-log{min-height:0;padding:14px 20px 10px;gap:13px;background:#fff;scrollbar-width:thin;scrollbar-color:#ced5df transparent;scrollbar-gutter:stable}
.ts-root .ts-chat-empty{font-size:12px;line-height:1.5;color:#9aa5b7}.ts-root .ts-chat-empty:empty{display:none}
.ts-root .ts-message{max-width:88%;animation:ts-reference-message .12s ease-out}.ts-root .ts-history-message{animation:none}
.ts-root .ts-message-meta{margin:0 2px 4px;font-size:10px;line-height:1.4;color:#a2adbd}
.ts-root .ts-bubble,.ts-root .ts-message[data-sender=ai] .ts-bubble{padding:9px 12px;border:1px solid #e5e9ee;border-radius:3px 12px 12px;background:#f8fafb;color:#243047;font-size:14px;line-height:1.65;box-shadow:none}
.ts-root .ts-mine .ts-bubble{border-color:#dbeafe;border-radius:12px 3px 12px 12px;background:#eff6ff;color:#1e3a5f;box-shadow:none}
.ts-root .ts-message.ts-help-message{width:100%;max-width:100%;align-self:stretch;animation:none}
.ts-root .ts-help-bubble{padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;white-space:normal}
.ts-root .ts-help-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.ts-root .ts-help-question{position:static;width:100%;max-width:100%;min-height:40px;padding:7px 9px;border:1px solid #e3e8ed;border-radius:8px;background:#fff;color:#7d8ba1;font-size:12px;line-height:1.4;text-align:left;white-space:normal}
.ts-root .ts-help-question:after{content:none}.ts-root .ts-help-question:hover{background:#f2faf6;border-color:#cce6d8;color:#375c47}
.ts-root .ts-help-more,.ts-root .ts-help-guide{display:inline-flex;align-items:center;min-height:36px;margin:0 12px 0 0;padding:5px 0;border:0;background:none;color:#98a5b9;font-size:11px;font-weight:400;line-height:1.4;text-decoration:none}
.ts-root .ts-action-cards{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px;padding-top:8px;border-top:1px solid #e3e9e6;white-space:normal}
.ts-root .ts-action-card{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;padding:8px 10px;border:1px solid #d7e7de;border-radius:8px;background:#f6fcf8;color:#3e7255;font-size:12px;line-height:1.5;text-decoration:none;box-shadow:none}
.ts-root .ts-action-card:after{content:'↗';margin-left:10px;color:#74a88b}.ts-root .ts-action-card:hover{background:#edf8f1;border-color:#c1dacb}
.ts-root .ts-composer{position:relative;display:grid;grid-template-columns:40px minmax(0,1fr) 40px;grid-template-rows:auto;align-items:end;gap:6px;flex-shrink:0;min-height:62px;margin:10px 16px 16px;padding:8px;border:1px solid #e0e5ed;border-radius:14px;background:#f7f9fc;box-shadow:none}
.ts-root .ts-chat-input{grid-column:2;grid-row:1;resize:none;width:100%;min-width:0;height:40px;min-height:40px;max-height:112px;margin:0;padding:8px 2px;border:0;border-radius:0;background:transparent;color:#243047;font-size:14px;line-height:24px;overflow-y:auto;outline:0;box-shadow:none!important}
.ts-root .ts-chat-input::placeholder{color:#8b9bb5;font-size:14px}
.ts-root .ts-attach,.ts-root .ts-send{display:grid;place-items:center;width:40px;height:40px;min-height:40px;margin:0;padding:0;border:0;border-radius:10px;background:transparent;line-height:1;box-shadow:none}
.ts-root .ts-attach{grid-column:1;grid-row:1;justify-self:start;color:#7084a7;font-size:27px;font-weight:300}
.ts-root .ts-attach:hover{background:#f4f7fa;color:#405d83}
.ts-root .ts-send{grid-column:3;grid-row:1;align-self:end;color:#fff;background:#2563eb;font-size:0;font-weight:400}
.ts-root .ts-send:before{content:'↑';font-size:22px;line-height:1}
.ts-root .ts-send:hover:not(:disabled){background:#1d4ed8;color:#fff}.ts-root .ts-send:disabled{background:#e8ecf2;color:#a7b2c3;opacity:1}
.ts-root .ts-chat-status{flex-shrink:0;min-height:0;margin:0;padding:5px 20px;color:#929bad;background:transparent;font-size:11px;line-height:1.5}.ts-root .ts-chat-status:empty{display:none}
.ts-root .ts-image-notice{display:flex;align-items:center;gap:9px;flex-shrink:0;margin:0;padding:8px 20px;border:0;background:#fff;font-size:12px}
.ts-root .ts-image-preview{width:48px;height:48px;flex-shrink:0;object-fit:cover;border:1px solid #e1e6ee;border-radius:8px;background:#fff}.ts-root .ts-image-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8e9aaf}
.ts-root .ts-image-remove{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:0;border-radius:8px;background:transparent;color:#8e9aaf;font-size:22px;line-height:1}.ts-root .ts-image-remove:hover{background:#f3f6f9}
.ts-root .ts-chat-body.ts-drag-over:after{content:'松开添加图片';position:absolute;inset:8px;z-index:4;display:grid;place-items:center;pointer-events:none;border:2px dashed #83bc9d;border-radius:10px;background:#f3fbf7ed;color:#507c63;font-size:14px}
.ts-root .ts-thinking{display:flex;align-items:center;gap:8px;flex-shrink:0;padding:7px 21px 10px;color:#97a3b5;font-size:12px;line-height:1.5}.ts-root .ts-thinking-stalled .ts-thinking-dots{display:none}
.ts-root .ts-thinking-dots{display:inline-flex;align-items:center;gap:4px;height:14px}.ts-root .ts-thinking-dots i{width:4px;height:4px;border-radius:50%;background:#91b8a2;animation:ts-reference-dots 1.2s ease-in-out infinite}.ts-root .ts-thinking-dots i:nth-child(2){animation-delay:.16s}.ts-root .ts-thinking-dots i:nth-child(3){animation-delay:.32s}
.ts-root .ts-latest{position:absolute;bottom:92px;left:50%;z-index:1;transform:translateX(-50%);min-height:36px;padding:6px 12px;border:1px solid #dce5df;border-radius:18px;background:#fff;color:#6b8a76;font-size:12px;white-space:nowrap;box-shadow:0 2px 9px #263a2d12}
.ts-root .ts-history{align-self:center;min-height:32px;padding:6px 12px;color:#a0aabb;font-size:11px}
.ts-root button:focus-visible,.ts-root a:focus-visible,.ts-root textarea:focus-visible{outline:2px solid #6aa885;outline-offset:2px}
.ts-root .ts-composer:focus-within{border-color:#98abc5;box-shadow:0 0 0 3px #9eb3d51a}
.ts-root .ts-composer .ts-chat-input:focus,.ts-root .ts-composer .ts-chat-input:focus-visible{outline:none!important;box-shadow:none!important}
@keyframes ts-reference-open{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@keyframes ts-reference-message{from{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}
@keyframes ts-reference-dots{0%,60%,100%{opacity:.45;transform:translateY(0)}30%{opacity:1;transform:translateY(-2px)}}
@media(max-width:768px){
 .ts-root,.ts-root.ts-shop-root{--ts-widget-bottom-gap:max(14px,env(safe-area-inset-bottom,0px));right:12px;bottom:calc(var(--ts-keyboard-offset,0px) + var(--ts-keyboard-nav-inset,var(--ts-mobile-nav-inset,0px)) + var(--ts-widget-bottom-gap))}
 .ts-root .ts-float-panel,.ts-root.ts-shop-root .ts-float-panel,.ts-root .ts-float-panel.ts-expanded,.ts-root.ts-expanded .ts-float-panel{position:fixed;right:10px;bottom:calc(var(--ts-keyboard-offset,0px) + var(--ts-keyboard-nav-inset,var(--ts-mobile-nav-inset,0px)) + var(--ts-widget-bottom-gap) + 68px);width:min(420px,calc(100% - 20px));height:min(560px,calc(var(--ts-visual-height,100dvh) - var(--ts-keyboard-nav-inset,var(--ts-mobile-nav-inset,0px)) - var(--ts-widget-bottom-gap) - 92px));max-height:calc(var(--ts-visual-height,100dvh) - var(--ts-keyboard-nav-inset,var(--ts-mobile-nav-inset,0px)) - var(--ts-widget-bottom-gap) - 92px);border-radius:13px}
 .ts-root .ts-float-panel.ts-view-home,.ts-root.ts-shop-root .ts-float-panel.ts-view-home{width:min(420px,calc(100% - 20px));height:min(560px,calc(var(--ts-visual-height,100dvh) - var(--ts-keyboard-nav-inset,var(--ts-mobile-nav-inset,0px)) - var(--ts-widget-bottom-gap) - 92px))}
 .ts-root .ts-float-panel.ts-view-chat.ts-expanded{width:min(700px,calc(100% - 20px));height:calc(var(--ts-visual-height,100dvh) - var(--ts-keyboard-nav-inset,var(--ts-mobile-nav-inset,0px)) - var(--ts-widget-bottom-gap) - 92px)}
 .ts-root .ts-home-hero{padding-left:20px;padding-right:20px}
 .ts-root .ts-chat-log{padding:12px 18px 10px}
 .ts-root .ts-chat-input{font-size:16px;max-height:min(112px,max(40px,calc(var(--ts-visual-height,100dvh) - 300px)))}
 .ts-root .ts-message{max-width:91%}
 .ts-root .ts-help-question,.ts-root .ts-help-more,.ts-root .ts-help-guide,.ts-root .ts-latest{min-height:44px}
 .ts-root .ts-back,.ts-root .ts-expand{flex-basis:44px;min-height:44px}
}
@media(max-height:690px){
 .ts-root .ts-home-hero{min-height:144px;padding-top:16px;padding-bottom:18px}
 .ts-root .ts-home-heading{margin-top:12px}
}
@media(prefers-reduced-motion:reduce){
 .ts-root .ts-float-panel,.ts-root .ts-message,.ts-root .ts-thinking-dots i{animation:none!important}
 .ts-root button,.ts-root a,.ts-root textarea{transition:none!important}
}

.ts-root .ts-ai-note{display:none}
.ts-root .ts-image-notice{flex-wrap:wrap}
.ts-root .ts-image-ai-consent{display:flex;align-items:flex-start;gap:6px;width:100%;color:#738198;font-size:11px;line-height:1.5}
.ts-root .ts-image-ai-consent input{appearance:auto;width:16px;height:16px;flex-shrink:0;margin:1px 0 0;accent-color:#243047}

/* Hide only the legacy contact bubble while the first-party chat is open. */
body:has(> .ts-root.ts-panel-open) #page-container .float-container > .service-group{visibility:hidden;pointer-events:none}
body:has(> .ts-root.ts-panel-open) #page-container .float-container{pointer-events:none}
body:has(> .ts-root.ts-panel-open) #page-container .float-container > :not(.service-group){pointer-events:auto}

/* Compact contextual home: one clear primary action, no oversized empty hero. */
.ts-root .ts-home-availability{display:inline-flex;align-items:center;gap:6px;color:#526783;font-size:12px;line-height:20px}
.ts-root .ts-home-availability:before{content:'';width:6px;height:6px;background:#10b981;border-radius:50%}
.ts-root .ts-home-context{margin:12px 0 0;color:#74849c;font-size:11px;line-height:1.5;letter-spacing:.3px}
.ts-root .ts-home-category:hover{background:#f5f8ff}
.ts-root .ts-home-category:focus-visible{outline-offset:-3px}
.ts-root .ts-home-category svg{position:absolute;right:15px;top:calc(50% - 8px);width:16px;height:16px;fill:none;stroke:#91a0b5;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ts-root .ts-float-head{border-bottom:1px solid #edf0f5}
.ts-root .ts-home-menu{box-shadow:0 4px 18px #243c5b05}
.ts-root .ts-help-question{color:#526681;border-color:#e4eaf3;background:#fafcff}
.ts-root .ts-chat-log{overscroll-behavior:contain}
.ts-root .ts-home{overscroll-behavior:contain}
@media(max-width:768px){.ts-root .ts-float-panel,.ts-root.ts-shop-root .ts-float-panel{border-radius:20px}.ts-root .ts-home-category{min-height:70px}.ts-root .ts-home-menu{margin-top:0}.ts-root .ts-home-context{margin-top:12px}}
