:root {
  --bg: #ededed;
  --panel: #f7f7f7;
  --mine: #95ec69;
  --theirs: #fff;
  --sys: #b2b2b2;
  --text: #111;
  --muted: #888;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
.app { display: flex; flex-direction: column; height: 100%; max-width: 720px; margin: 0 auto; background: var(--panel); min-height: 0; }
.top { padding: 12px 16px; background: #393a3e; color: #fff; }
.top .title { font-size: 17px; font-weight: 600; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.visitor-header-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 14px; margin-inline-start: auto; order: 1; }
.visitor-title-group { display: contents; }
@media (max-width: 640px) and (hover: none) and (pointer: coarse) {
  .visitor-header-tools { display: contents; }
  .visitor-title-group { display: flex; flex-wrap: wrap; flex-basis: 100%; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
  .visitor-title-group .visitor-mobile-notice { margin: 0; }
  .visitor-online-count:not([hidden]) + .visitor-mobile-notice { font-size: 12px; }
}
.visitor-layout {
  --visitor-chat-min: 340px;
  --visitor-splitter-width: 12px;
  --quick-reply-min: 320px;
  height: 100%;
}
.visitor-layout.has-quick-reply {
  display: grid;
  grid-template-columns:
    clamp(var(--visitor-chat-min), var(--visitor-chat-width, var(--visitor-chat-min)), calc(100% - var(--visitor-splitter-width) - var(--quick-reply-min)))
    var(--visitor-splitter-width)
    minmax(var(--quick-reply-min), 1fr);
  max-width: 1440px;
  margin: 0 auto;
}
.has-quick-reply .app { width: 100%; min-width: 0; max-width: none; }
.visitor-splitter { display: none; }
.is-dragging-splitter { cursor: col-resize; user-select: none; }
.has-quick-reply .visitor-splitter {
  position: relative;
  display: block;
  border-inline: 1px solid #ccd9d1;
  background: #e2ebe5;
  cursor: col-resize;
  touch-action: none;
}
.visitor-splitter::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 2px;
  height: 36px;
  margin: auto;
  border-radius: 2px;
  background: #6b9681;
  box-shadow: 3px 0 0 #6b9681, -3px 0 0 #6b9681;
}
.visitor-splitter:hover,
.visitor-splitter:focus-visible,
.is-dragging-splitter .visitor-splitter { background: #bad5c5; }
.visitor-splitter:focus-visible { outline: 2px solid #205f41; outline-offset: -2px; }
.visitor-actions { display: flex; align-items: center; gap: 9px; }
.visitor-actions button {
  border: 1px solid #747782;
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  background: #4b4c52;
  white-space: nowrap;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.visitor-actions button:hover { background: #575961; }
.visitor-actions button:disabled { opacity: .6; cursor: wait; }
.visitor-actions #quickReplyOpen:not(:disabled) { border-color: #8ba58e; background: #375449; }
.visitor-feature-notice { margin: 7px 0 0; color: #f0f5f1; font-size: 12px; line-height: 1.4; }
.visitor-feature-dialog {
  width: min(380px, calc(100% - 28px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 18px;
  border: 1px solid #e0e2e1;
  border-radius: 12px;
  box-shadow: 0 14px 60px #2224;
  background: #fff;
  color: #181c1b;
}
.visitor-feature-dialog::backdrop { background: #171d1c70; }
.visitor-feature-dialog > header,
.quick-reply-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.visitor-feature-dialog h2, .quick-reply-panel h2 { margin: 0; font-size: 17px; line-height: 1.5; }
.visitor-feature-dialog h3 { margin: 13px 0 8px; font-size: 14px; }
.visitor-feature-dialog p { margin: 9px 0; font-size: 13px; line-height: 1.55; }
.visitor-feature-dialog label { display: block; margin: 12px 0 6px; font-size: 13px; }
.visitor-feature-dialog input,
.quick-reply-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d3d9d6;
  border-radius: 7px;
  color: #19251f;
  background: #fff;
  font: inherit;
}
.visitor-feature-primary,
.visitor-feature-roles button,
.visitor-feature-dialog-actions button:not(.visitor-feature-primary),
.quick-reply-fold,
.quick-reply-panel-close {
  border: 1px solid #cfdbd4;
  border-radius: 7px;
  padding: 7px 11px;
  background: #f2f7f4;
  color: #17462d;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.visitor-feature-primary { border-color: #17633a; background: #17633a; color: #fff; }
.visitor-feature-primary:disabled,
.visitor-feature-roles button:disabled { opacity: .55; cursor: default; }
#quickReplyUnlock { display: block; margin: 10px 0 0 auto; }
#quickReplyCode::-ms-reveal { display: none; }
#quickReplyCode::-ms-clear { display: none; }
.visitor-feature-roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.visitor-feature-roles button { min-height: 42px; font-size: 17px; font-weight: 650; }
.visitor-feature-roles button:hover { background: #dbeee3; }
.visitor-feature-feedback { color: #4a5a52; }
.visitor-feature-dialog-actions { display: flex; justify-content: flex-end; margin-top: 10px; gap: 8px; }
#continueChatHelp { color: #243f34; font-weight: 650; }
.continue-chat-qr {
  display: block;
  width: min(100%, 256px);
  height: auto;
  margin: 14px auto;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #fff;
}
.continue-chat-qr[hidden] { display: none; }
.visitor-continue-card[open] {
  position: static;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  width: auto;
  max-width: none;
  max-height: none;
  margin: 8px 12px 2px;
  padding: 8px 10px;
  border-color: #d7ded9;
  box-shadow: 0 2px 8px #2221;
}
.visitor-continue-card .continue-chat-qr {
  flex: none;
  width: clamp(104px, 22vh, 160px);
  width: clamp(104px, 22dvh, 160px);
  max-width: 34vw;
  margin: 0;
}
.visitor-continue-content { flex: 1; min-width: 0; }
.visitor-continue-content > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.visitor-continue-content h2 { font-size: 15px; overflow-wrap: anywhere; }
.visitor-continue-content .visitor-feature-dialog-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 5px;
}
.visitor-feature-close {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: #edf0ee;
  color: #34443b;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.quick-reply-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-left: 1px solid #d7ded9;
  background: #f2f6f3;
}
.quick-reply-panel[hidden] { display: none; }
.quick-reply-panel-head { padding: 11px 12px; border-bottom: 1px solid #d7ded9; background: #e2f0e7; }
.quick-reply-panel-head > div { flex: 1 1 auto; }
.quick-reply-panel-head p { margin: 3px 0 0; font-size: 12px; color: #325b43; }
.quick-reply-panel-close { flex: none; white-space: nowrap; }
.quick-reply-panel-body { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.quick-reply-messages { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 12px; }
.quick-reply-messages li { width: fit-content; max-width: 91%; margin: 0 0 9px; }
.quick-reply-messages li[data-sender="staff"] { margin-left: auto; }
.quick-reply-message-label { display: block; margin: 0 4px 3px; color: #52645a; font-size: 11px; }
.quick-reply-messages li[data-sender="staff"] .quick-reply-message-label { text-align: right; }
.quick-reply-message-body {
  margin: 0;
  border-radius: 8px;
  padding: 8px 9px;
  background: #fff;
  color: #17231e;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.45;
}
.quick-reply-messages li[data-sender="staff"] .quick-reply-message-body { background: #dff1e4; }
.quick-reply-panel .visitor-feature-feedback { margin: 0; padding: 5px 12px; font-size: 12px; }
.quick-reply-payment-tools, .quick-reply-phrases {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 10px;
  overflow-x: auto;
}
.quick-reply-payment-tools { flex-wrap: wrap; border-bottom: 1px solid #d7ded9; background: #f7faf8; }
.quick-reply-phrases { padding-bottom: 5px; }
.quick-reply-payment-tools[hidden], .quick-reply-phrases[hidden] { display: none; }
.quick-reply-payment-tools button, .quick-reply-phrases button, .quick-reply-native-packages button {
  flex: none;
  border: 1px solid #cfdbd4;
  border-radius: 7px;
  padding: 5px 9px;
  color: #17462d;
  background: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.quick-reply-phrases button { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-reply-phrases span { flex: none; color: #52645a; font-size: 12px; }
.quick-reply-payment-tools button:disabled { opacity: .55; cursor: default; }
.quick-reply-payment-tools button:not(:disabled):hover, .quick-reply-phrases button:hover { background: #dfeee5; }
.quick-reply-native-packages { display: grid; gap: 7px; }
.quick-reply-native-packages button { text-align: left; padding: 8px 10px; font-size: 14px; }
.quick-reply-native-packages button[aria-pressed="true"] {
  color: #17462d;
  background: #e2f0e7;
  border-color: #39774f;
}
.quick-reply-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid #d7ded9; }
.quick-reply-form textarea { flex: 1; min-width: 0; max-height: 105px; resize: vertical; font-size: 14px; }
.quick-reply-fold { display: none; }
@media (max-width: 760px) {
  .visitor-layout.has-quick-reply { display: flex; flex-direction: column; }
  .has-quick-reply .app { flex: 1 1 0; height: auto; max-width: 720px; }
  .has-quick-reply .visitor-splitter { display: none; }
  .quick-reply-panel { flex: 0 1 auto; height: min(42dvh, 330px); border-left: 0; border-top: 1px solid #d7ded9; }
  .quick-reply-fold { display: inline-block; }
  .quick-reply-panel.is-collapsed { height: auto; }
  .quick-reply-panel.is-collapsed .quick-reply-panel-body { display: none; }
}
.product-notice { margin: 7px 0 0; color: #e2e4e8; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.visitor-status-badge { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 11px; line-height: 1.5; color: #fde68a; }
.visitor-status-badge[hidden] { display: none; }
.visitor-status-badge::before { content: ''; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #fbbf24; }
.visitor-status-badge[data-state="error"] { color: #fecaca; }
.visitor-status-badge[data-state="error"]::before { background: #f87171; }
.top .sub { line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 400px) { .top { padding: 10px 12px; } .composer textarea { min-width: 0; } }
.top .sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.msgs { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.row { display: flex; }
.row.mine { justify-content: flex-end; }
.row.system { justify-content: center; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 8px; background: var(--theirs); box-shadow: 0 1px 1px rgba(0,0,0,.06); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; line-height: 1.45; font-size: 15px; flex-shrink: 0; /* img-bubble-fix-20261109c */ }
.row.mine .bubble { background: var(--mine); }
.row.system .bubble { background: transparent; box-shadow: none; color: var(--sys); font-size: 12px; max-width: 92%; text-align: center; }
.meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.bubble img, .bubble video { display: block; max-width: 100%; border-radius: 6px; }

.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px; background: #f5f5f5; border-top: 1px solid #e5e5e5; }
.composer textarea { flex: 1; resize: none; border: 1px solid #ddd; border-radius: 8px; padding: 10px; font: inherit; min-height: 40px; max-height: 160px; overflow-y: auto; overflow-wrap: anywhere; word-break: break-word; line-height: 1.4; white-space: pre-wrap; }
.composer button, .icon-btn { border: 0; background: #07c160; color: #fff; border-radius: 8px; padding: 10px 14px; font: inherit; cursor: pointer; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #ddd; color: #333; font-size: 22px; }

.visitor-service-choices {
  flex: none;
  width: min(100%, 460px);
  padding: 12px;
  border: 1px solid #d5e2dd;
  border-radius: 10px;
  background: #fff;
  color: #183333;
}
.visitor-service-choices h2 { margin: 6px 0 10px; font-size: 16px; }
.visitor-service-customer { color: #b4232c; }
.visitor-service-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  margin: 0 0 10px;
  padding: 9px 11px;
  border: 1px solid #104a41;
  border-radius: 8px;
  background: #155d52;
  box-shadow: 0 2px 0 #0b3e36;
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.visitor-service-option-copy { display: grid; gap: 3px; }
.visitor-service-option[hidden] { display: none; }
.visitor-service-option strong { font-size: 15px; }
.visitor-service-action {
  padding: 4px 7px;
  border: 1px solid #9bd4c8;
  border-radius: 5px;
  background: #e9f7f2;
  color: #104a41;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
@media (hover: hover) { .visitor-service-option:not(:disabled):hover { background: #114e45; } }
.visitor-service-option:not(:disabled):active { background: #0d423a; box-shadow: none; transform: translateY(1px); }
.visitor-service-option:focus-visible { outline: 2px solid #155d52; outline-offset: 2px; }
.visitor-service-option:disabled { opacity: .66; cursor: wait; }
.visitor-service-note, .visitor-service-error { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.visitor-service-note { color: #435953; }
.visitor-service-error { color: #a1372b; }
.visitor-service-hint {
  margin: 0;
  padding: 6px 10px;
  background: #e9f4ef;
  color: #15574b;
  font-size: 13px;
  font-weight: 600;
}
.visitor-reception-status {
  flex: 0 0 auto;
  border-top: 1px solid #d5e8df;
  overflow-wrap: anywhere;
}
.visitor-reception-status[data-state="queued"] {
  border-top-color: #ebdebb;
  background: #fbf3df;
  color: #5b451b;
}
#visitorComposer[data-service-locked] textarea { background: #f1f5f3; cursor: not-allowed; }
#visitorComposer[data-service-locked] :is(#send, .icon-btn) { opacity: .58; cursor: not-allowed; }

/* 如何发截图 · 常驻 + 可折叠 */
.shot-bar {
  background: #fafafa;
  border-top: 1px solid #e8e8e8;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.shot-title {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}
.shot-fold {
  border: 0;
  background: transparent;
  color: #888;
  font: inherit;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.shot-fold:hover { background: #eee; color: #333; }
.shot-body { display: flex; flex-direction: column; gap: 6px; }
.shot-bar.is-collapsed { gap: 0; padding: 6px 10px; }
.shot-bar.is-collapsed .shot-body { display: none; }
.shot-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #444;
  line-height: 1.4;
}
.shot-os {
  font-weight: 600;
  color: #333;
  min-width: 7.5em;
  flex-shrink: 0;
}
.shot-keys { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.shot-keys .plus { color: #999; font-size: 11px; }
.shot-desc { color: #666; }
.shot-desc kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid #ccc;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #f7f7f7;
  font-size: 11px;
  font-family: inherit;
  color: #333;
  min-height: auto;
}
kbd {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border: 1px solid #cfcfcf;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: linear-gradient(#fff, #f3f3f3);
  font-size: 11px;
  font-family: inherit;
  color: #222;
  min-height: 22px;
}
.win-key {
  background: linear-gradient(#2b2b2b, #111);
  color: #fff;
  border-color: #333;
  font-weight: 600;
}
.win-key .win-svg { display: block; flex-shrink: 0; }
.shot-mobile { display: none; }

@media (max-width: 640px) {
  .shot-desktop { display: none; }
  .shot-mobile { display: flex; }
  .shot-bar { padding: 6px 10px; }
}

/* payment bubble */
.pay-bubble .pay-head { font-weight: 600; margin-bottom: 4px; }
.pay-bubble .pay-desc { font-size: 12px; color: #666; margin-bottom: 6px; }
.pay-bubble .pay-qr { max-width: 200px !important; margin: 6px 0; background: #fff; padding: 6px; border-radius: 8px; }
.pay-bubble .pay-tip { font-size: 12px; color: #888; }
.pay-bubble .pay-paid {
  display: inline-block; margin-top: 6px; padding: 4px 10px; border-radius: 999px;
  background: #dcfce7; color: #166534; font-weight: 600; font-size: 13px;
}

.row.conv-split .bubble { color: var(--muted); font-size: 11px; letter-spacing: 0.02em; }

/* img-bubble-fix-20261109c: full image, no nested scroll */
.bubble.is-media {
  padding: 0 !important;
  background: transparent !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  white-space: normal !important;
  border: 0 !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
}
.row.mine .bubble.is-media {
  background: transparent !important;
}
.bubble.is-media .meta {
  margin: 0 0 4px 2px;
  padding: 0 2px;
}
.bubble.is-media > img,
.bubble.is-media > video {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  max-width: min(720px, 100%) !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  background: transparent !important;
}

/* 20261117 header notice highlight */
.top .sub#assignee {
  display: block;
  margin-top: 6px;
  padding: 7px 10px 7px 30px;
  position: relative;
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 8px;
  color: #FFD54F;
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 1;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.top .sub#assignee::before {
  content: "⚠️";
  position: absolute;
  left: 9px;
  top: 7px;
  font-size: 14px;
  line-height: 1.5;
}
@media (max-width: 480px) {
  .top .sub#assignee { font-size: 13px; padding: 6px 8px 6px 28px; }
  .top .sub#assignee::before { left: 8px; top: 6px; }
}

/* img-clarity-20261110d: larger in-bubble preview + original-view lightbox */
.bubble.is-media {
  max-width: min(720px, 100%);
}
.bubble.is-media > img {
  cursor: pointer;
}
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: zoom-out;
}
.img-lightbox.hidden { display: none !important; }
.img-lightbox img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-out;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.visitor-online-count {
  display: inline-block;
  flex: none;
  color: #f3f4f6;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.visitor-online-count[hidden] { display: none; }
.visitor-online-count [data-online-count] { font-weight: 800; font-variant-numeric: tabular-nums; }
.visitor-online-count.is-online [data-online-count] {
  margin-inline: 1px;
  padding-inline: 3px;
  border-radius: 3px;
  background: #baf7ca;
  color: #163928;
}
.visitor-paid-report { display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:7px 0 0; font-size:12px; color:#245b44; }
.visitor-paid-report button { padding:7px 10px; border:1px solid #b1cdbf; border-radius:6px; background:#edf9f0; color:#224f3d; font:inherit; cursor:pointer; }
.visitor-paid-report button:disabled { opacity:.6; cursor:default; }
.quick-reply-static-code label { display:block; margin:8px 0; }
.quick-reply-static-code label[hidden] { display:none; }
.quick-reply-static-code select { width:100%; padding:8px; margin-top:4px; border:1px solid #b1cdbf; border-radius:6px; font:inherit; }
@media (max-width:640px) and (pointer:coarse) { .visitor-paid-report button { min-height:44px; } }
