.sc-window, .sc-launcher, .sc-inbox, .sc-lightbox { font-family: var(--font-sans); color: var(--ink); box-sizing: border-box; }
.sc-window *, .sc-inbox * { box-sizing: border-box; }
.sc-window[hidden], .sc-window [hidden], .sc-inbox [hidden], .sc-badge[hidden] { display: none !important; }
.sc-launcher { position: fixed; z-index: 1000; bottom: max(24px, env(safe-area-inset-bottom)); right: 24px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 15px 21px; background: var(--solid); color: var(--ink-on-solid); box-shadow: var(--shadow-pop); cursor: pointer; font-size: 14px; font-weight: 600; transition: transform 160ms; }
.sc-launcher:hover { transform: translateY(-2px); }
.sc-launcher-mark { display: block; width: 20px; height: 20px; }
.sc-button .icon { vertical-align: middle; }
.sc-tools .sc-button .icon { margin-right: 6px; }
.sc-badge { min-width: 21px; height: 21px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; }
.sc-window { position: fixed; right: 24px; bottom: 94px; z-index: 1001; width: 380px; height: min(590px, calc(100dvh - 120px)); display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-pop); overflow: hidden; animation: sc-in 160ms ease-out; }
.sc-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; }
.sc-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.sc-avatar { display: grid; place-items: center; height: 36px; width: 36px; border-radius: 12px; background: var(--accent); color: #fff; font-family: var(--font-serif); font-size: 24px; }
.sc-button { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; border-radius: 7px; padding: 7px 9px; font: inherit; font-size: 13px; }
.sc-button:hover { background: var(--bg-sunken); }
.sc-header > .sc-button { font-size: 24px; line-height: 24px; width: 38px; height: 38px; }
.sc-subtitle { margin: 0; padding: 0 18px 16px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.sc-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sc-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.sc-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px; background: var(--bg); scrollbar-width: thin; }
.sc-intro, .sc-login { text-align: center; padding: 30px 17px; margin: auto; }
.sc-intro h3, .sc-login h3 { font-size: 19px; font-weight: 600; margin: 17px 0 12px; }
.sc-intro p, .sc-login p { font-size: 13px; line-height: 1.8; color: var(--ink-2); margin: 10px 0; }
.sc-intro-mark { display: inline-grid; place-items: center; font: 36px var(--font-serif); width: 62px; height: 62px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 21px; color: var(--accent); }
.sc-login .sc-send { display: inline-block; margin: 14px 0 6px; text-decoration: none; }
.sc-muted { color: var(--ink-3) !important; font-size: 11px !important; }
.sc-rows { display: flex; flex-direction: column; gap: 18px; }
.sc-welcome { margin-bottom: 18px; }
.sc-welcome .sc-message-image { width: auto; height: auto; }
.sc-message { max-width: 86%; align-self: flex-start; min-width: 60px; }
.sc-own { align-self: flex-end; }
.sc-bubble { padding: 11px 13px; border: 1px solid var(--line); background: var(--surface); border-radius: 13px 13px 13px 3px; font-size: 13px; line-height: 1.75; overflow: hidden; }
.sc-own .sc-bubble { background: var(--solid); color: var(--ink-on-solid); border-color: var(--solid); border-radius: 13px 13px 3px 13px; }
.sc-bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sc-message-time { display: block; font-size: 10px; color: var(--ink-3); margin-top: 5px; }
.sc-own .sc-message-time { text-align: right; }
.sc-image-button { display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; width: 100%; }
.sc-message-image { display: block; max-height: 200px; max-width: 100%; border-radius: 7px; object-fit: contain; }
.sc-image-button + p { margin-top: 8px; }
.sc-older { display: block; margin: 0 auto 16px; color: var(--accent-ink); }
.sc-notice { font-size: 11px; color: var(--ink-3); padding: 8px 16px; margin: 0; min-height: 31px; border-top: 1px solid var(--line); }
.sc-composer { padding: 2px 14px 12px; background: var(--surface); }
.sc-input { display: block; border: 0; resize: none; padding: 8px 2px; width: 100%; max-height: 110px; background: transparent; color: var(--ink); font: 13px/1.7 var(--font-sans); }
.sc-input:focus { outline: 0; }
.sc-composer:focus-within { box-shadow: inset 0 -2px var(--accent); }
.sc-tools { display: flex; align-items: center; gap: 6px; }
.sc-keyhint { flex: 1; text-align: right; font-size: 9px !important; white-space: nowrap; }
.sc-send { background: var(--accent); border: 1px solid var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; font: 13px var(--font-sans); cursor: pointer; white-space: nowrap; }
.sc-send:disabled, .sc-button:disabled { opacity: .45; cursor: default; }
.sc-attachment { display: flex; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; }
.sc-attachment img { width: 42px; height: 42px; object-fit: cover; border-radius: 4px; }
.sc-attachment span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-lightbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 45px 12px 12px; max-width: 95vw; max-height: 95dvh; }
.sc-lightbox::backdrop { background: rgba(0,0,0,.7); }
.sc-lightbox > .sc-button { position: absolute; right: 8px; top: 4px; font-size: 24px; }
.sc-lightbox img { display: block; max-width: 88vw; max-height: 80dvh; object-fit: contain; }
.sc-launcher:focus-visible, .sc-button:focus-visible, .sc-send:focus-visible, .sc-image-button:focus-visible, .sc-thread:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sc-inbox { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 660px; max-height: 80dvh; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 16px; }
.sc-sidebar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.sc-filters { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.sc-filters input, .sc-filters select { width: 100%; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 7px; font: inherit; font-size: 12px; }
.sc-thread-list { overflow-y: auto; flex: 1; min-height: 0; }
.sc-thread { display: block; width: 100%; text-align: left; background: transparent; padding: 15px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.sc-thread[aria-current="true"] { background: var(--surface); box-shadow: inset 3px 0 var(--accent); }
.sc-thread strong, .sc-thread p { display: block; overflow-wrap: anywhere; font-size: 12px; margin: 0 0 5px; }
.sc-thread p { color: var(--ink-3); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.sc-thread-meta { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--ink-3); }
.sc-thread-meta .sc-badge { margin-left: auto; }
.sc-inbox-detail { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.sc-inbox-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 55px; }
.sc-inbox-heading strong { font-size: 13px; overflow-wrap: anywhere; }
.sc-inbox-host { flex: 1; min-height: 0; }
.sc-inbox-empty { padding: 48px 24px; text-align: center; color: var(--ink-3); font-size: 14px; }
@keyframes sc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .sc-launcher { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); padding: 13px 16px; }
  .sc-window { right: 8px; left: 8px; bottom: max(80px, calc(env(safe-area-inset-bottom) + 70px)); width: auto; height: min(620px, calc(100dvh - 100px)); border-radius: 14px; }
  .sc-keyhint { display: none; } .sc-tools { justify-content: space-between; }
  .sc-input { font-size: 16px; }
  .sc-inbox { grid-template-columns: 1fr; height: auto; max-height: none; }
  .sc-sidebar { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sc-inbox-detail { height: 580px; max-height: 80dvh; }
}
@media (prefers-reduced-motion: reduce) { .sc-window { animation: none; } .sc-launcher { transition: none; } }

.sc-jump { align-self: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--accent-ink); margin: -36px 0 5px; position: relative; font-size: 12px; }

/* 微信咨询弹窗 */
.business-cooperation-backdrop {
  z-index: 1010;
}

.business-cooperation-qr {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(55vh, 480px);
  margin-inline: auto;
  border-radius: var(--r-ctl);
  object-fit: contain;
}

/* 弹层锁定滚动 */
body.modal-open {
  overflow: hidden;
}
