
.cw-composer__editable[data-v-488aa19a] {
  width: 100%;
  min-height: 22px;
  max-height: 120px;
  overflow-y: auto;
  outline: none;
  border: none;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--cw-text);
  padding: 2px 0;
  word-break: break-word;
  white-space: pre-wrap;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}
.cw-composer__editable[data-v-488aa19a]::-webkit-scrollbar {
  width: 5px;
}
.cw-composer__editable[data-v-488aa19a]::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
}
.cw-composer__editable[data-v-488aa19a]::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}
.cw-composer__editable[data-v-488aa19a]::-webkit-scrollbar-track {
  background: transparent;
}
.cw-composer__editable[data-v-488aa19a]:empty::before {
  content: attr(data-placeholder);
  color: #9aa3b2;
  pointer-events: none;
}
.cw-composer__editable[data-v-488aa19a] img,
.cw-composer__editable img[data-v-488aa19a] {
  max-width: 120px;
  border-radius: 6px;
  display: block;
  margin: 4px 0;
}
.cw-composer__attach[data-v-488aa19a] {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--cw-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.cw-composer__attach[data-v-488aa19a]:hover {
  background: #f1f5f9;
  color: var(--cw-text);
}
.cw-composer__attach svg[data-v-488aa19a] {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* ============================================================
   Chat Widget 全局样式（独立于 Element Plus，供组件共享，
   所有类以 cw- 前缀，避免污染宿主页面）
   ============================================================ */

.cw-root {
  --cw-primary: #B85A5F;
  --cw-primary-dark: #9C4C51;
  --cw-primary-light: #E8CACC;
  --cw-primary-soft: rgba(184, 90, 95, 0.12);
  --cw-primary-shadow: rgba(184, 90, 95, 0.32);
  --cw-primary-shadow-hover: rgba(184, 90, 95, 0.4);
  --cw-primary-faint: rgba(184, 90, 95, 0.05);
  --cw-bubble-agent: #f1f3f7;
  --cw-bubble-customer: var(--cw-primary);
  --cw-text: #1f2430;
  --cw-text-secondary: #5b6472;
  --cw-border: #e3e7ef;
  --cw-bg: #ffffff;
  --cw-radius: 12px;
  --cw-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, 'Noto Sans SC', sans-serif;
  font-family: var(--cw-font);
  color: var(--cw-text);
  line-height: 1.45;
}

.cw-root *,
.cw-root *::before,
.cw-root *::after {
  box-sizing: border-box;
}

/* ---------- Launcher ---------- */
.cw-launcher {
  position: fixed;
  right: 40px;
  bottom: 40px;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: var(--cw-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--cw-primary-shadow);
  z-index: 9999;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 180ms ease, border-radius 160ms ease;
  outline: none;
}

.cw-launcher:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 28px var(--cw-primary-shadow-hover);
}

.cw-launcher:focus,
.cw-launcher:focus-visible,
.cw-launcher:active {
  outline: none;
}

.cw-root button:focus,
.cw-root button:focus-visible {
  outline: none;
}

.cw-launcher:active {
  transform: scale(0.96);
}

.cw-launcher.is-open {
  border-radius: 16px;
  width: 60px;
  height: 60px;
}

.cw-launcher svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cw-launcher__avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.cw-launcher__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #f05247;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* ---------- Panel ---------- */
.cw-panel {
  position: fixed;
  right: 20px;
  bottom: 112px;
  width: 375px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--cw-bg);
  border-radius: var(--cw-radius);
  box-shadow: 0 18px 45px rgba(15, 31, 51, 0.18), 0 0 0 1px rgba(15, 31, 51, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 10000;
  /* 仅 opacity 过渡，不做 transform，避免二次弹开被放大 */
  will-change: opacity;
  contain: layout paint;
}

/* —— 掩盖“弹开两次”的动效：仅淡入淡出 + 极轻位移，无缩放，二次触发几乎不可见 —— */
.cw-panel-trans-enter-active {
  transition: opacity 180ms ease-out;
}
.cw-panel-trans-leave-active {
  transition: opacity 140ms ease-in;
}
.cw-panel-trans-enter-from {
  opacity: 0;
}
.cw-panel-trans-enter-to {
  opacity: 1;
}
.cw-panel-trans-leave-from {
  opacity: 1;
}
.cw-panel-trans-leave-to {
  opacity: 0;
}

.cw-panel__header {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--cw-primary), var(--cw-primary-dark));
  color: #fff;
  padding: 14px 16px 16px;
  position: relative;
  overflow: hidden;
}

.cw-panel__header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.cw-panel__back {
  display: flex;
  align-items: center;
  justify-self: start;
}

.cw-panel__titles {
  text-align: center;
  min-width: 0;
}

.cw-panel__title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-panel__subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-panel__actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  flex-shrink: 0;
}

.cw-btn-end {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.cw-btn-end:hover {
  background: rgba(255, 255, 255, 0.26);
}

.cw-icon-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cw-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.cw-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cw-panel__close {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color 160ms ease, border-color 160ms ease, transform 200ms ease;
}

.cw-panel__close:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg);
}

.cw-panel__close:active {
  transform: rotate(90deg) scale(0.92);
}

.cw-panel__close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cw-panel__more {
  position: relative;
}

.cw-icon-btn--more svg {
  width: 16px;
  height: 16px;
}

.cw-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  background: #fff;
  border: 1px solid #e3e7ef;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 31, 51, 0.14), 0 0 0 1px rgba(15, 31, 51, 0.04);
  padding: 6px;
  z-index: 20;
  animation: cw-menu-in 140ms ease;
}

@keyframes cw-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cw-more-menu--panel {
  top: 52px;
  right: 12px;
  z-index: 30;
}

.cw-more-menu__item {
  appearance: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1f2430;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.cw-more-menu__item:hover {
  background: #f1f5f9;
}

.cw-more-menu__item--danger {
  color: #e11d48;
}

.cw-more-menu__item--danger:hover {
  background: #fef2f2;
  color: #be123c;
}

/* ---------- Body / message list ---------- */
.cw-panel {
  overscroll-behavior: contain;
}
.cw-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 10px 12px;
  background: #fbfcfe;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.cw-panel__body::-webkit-scrollbar {
  width: 5px;
}

.cw-panel__body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.cw-panel__body::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
  background-clip: padding-box;
}

.cw-panel__body::-webkit-scrollbar-track {
  background: transparent;
}

.cw-panel__body::-webkit-scrollbar-corner {
  background: transparent;
}

.cw-msg {
  display: flex;
  width: 100%;
  margin-bottom: 12px;
}

.cw-msg--agent {
  justify-content: flex-start;
}

.cw-msg--customer {
  justify-content: flex-end;
}

.cw-msg__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cw-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  margin-right: 8px;
}

.cw-msg__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cw-msg__meta {
  font-size: 11px;
  color: var(--cw-text-secondary);
  margin-bottom: 3px;
  padding-left: 2px;
}

.cw-msg__bubble {
  max-width: 300px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
}

.cw-msg--agent .cw-msg__bubble {
  background: var(--cw-bubble-agent);
  color: var(--cw-text);
  border-top-left-radius: 4px;
}

.cw-msg--customer .cw-msg__bubble {
  background: var(--cw-bubble-customer);
  color: #fff;
  border-top-right-radius: 4px;
}

.cw-msg__bubble :deep(img), .cw-msg__bubble img {
  max-width: 180px;
  border-radius: 6px;
  display: block;
  margin: 4px 0;
}
.cw-mail-msg__content :deep(img), .cw-mail-msg__content img {
  max-width: 200px;
  border-radius: 6px;
  display: block;
  margin: 4px 0;
}
.cw-msg__bubble a {
  color: inherit;
}

.cw-msg--customer .cw-msg__bubble a {
  color: #fff;
  text-decoration: underline;
}

.cw-msg__time {
  font-size: 10.5px;
  color: var(--cw-text-secondary);
  margin-top: 3px;
  padding-left: 2px;
}

.cw-msg--customer .cw-msg__time {
  text-align: right;
  padding-right: 2px;
}

.cw-sys {
  text-align: center;
  font-size: 12px;
  color: var(--cw-text-secondary);
  margin: 12px 0;
  background: rgba(15, 31, 51, 0.04);
  border-radius: 999px;
  padding: 5px 10px;
  display: inline-block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.cw-empty {
  text-align: center;
  color: var(--cw-text-secondary);
  font-size: 13px;
  padding: 40px 20px;
}

/* ---------- 渠道选择 ---------- */
.cw-channel__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--cw-text);
  margin-bottom: 14px;
}

.cw-channel__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cw-channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--cw-bg);
  border: 1px solid var(--cw-border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: var(--cw-text);
  transition: border-color 160ms ease, box-shadow 180ms ease, transform 160ms ease;
}

.cw-channel-card:hover {
  border-color: var(--cw-primary);
  box-shadow: 0 4px 14px rgba(15, 31, 51, 0.08);
  transform: translateY(-1px);
}

.cw-channel-icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.cw-channel-icon--email {
  background: var(--cw-primary);
  color: #fff;
}

.cw-channel-icon--email svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cw-channel-icon--chat {
  background: #eef1f6;
  color: var(--cw-primary);
  font-size: 15px;
  font-weight: 600;
}

.cw-channel-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.cw-channel-online {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #41d98d;
  border: 2px solid #fff;
}

.cw-channel-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cw-channel-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--cw-text);
}

.cw-channel-card__desc {
  font-size: 12px;
  color: var(--cw-text-secondary);
  line-height: 1.4;
}

/* ---------- 可用性变更提示（客服离线后点击 chat 的邮件降级） ---------- */
.cw-availability-notice {
  background: #e6f0ff;
  border-left: 3px solid #3b82f6;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #3a5a8a;
  margin-bottom: 14px;
}

/* ---------- 邮件表单 ---------- */
.cw-email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cw-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cw-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--cw-text);
}

.cw-field__input {
  border: 1.5px solid var(--cw-border);
  border-radius: 9px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
  color: var(--cw-text);
  background: var(--cw-bg);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.cw-field__input:focus,
.cw-field__input:focus-visible {
  border-color: var(--cw-primary);
  box-shadow: 0 0 0 3px var(--cw-primary-soft);
  outline: none;
}

.cw-field__textarea {
  resize: none;
  min-height: 76px;
  line-height: 1.45;
}

.cw-email-form__submit {
  appearance: none;
  border: none;
  border-radius: 10px;
  background: var(--cw-primary);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 0;
  cursor: pointer;
  margin-top: 2px;
  transition: background-color 160ms ease;
}

.cw-email-form__submit:hover {
  background: var(--cw-primary-dark);
}

.cw-email-form__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- 邮件发送成功 ---------- */
.cw-panel__body--centered {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cw-sent {
  text-align: center;
  max-width: 260px;
}

.cw-sent__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cw-text);
  margin: 0 0 8px;
}

.cw-sent__text {
  font-size: 13px;
  color: var(--cw-text-secondary);
  line-height: 1.55;
  margin: 0 0 6px;
}

.cw-sent__link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--cw-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.cw-sent__link:hover {
  text-decoration: underline;
}

/* ---------- History ---------- */
.cw-mail-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--cw-border);
}

.cw-mail-msg:last-child {
  border-bottom: none;
}

.cw-mail-msg__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cw-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.cw-mail-msg__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cw-mail-msg__main {
  min-width: 0;
  flex: 1;
}

.cw-mail-msg__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.cw-mail-msg__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cw-text);
}

.cw-mail-msg__time {
  font-size: 11px;
  color: var(--cw-text-secondary);
}

.cw-mail-msg__content {
  font-size: 13px;
  color: var(--cw-text);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.cw-sys--inline {
  margin: 6px auto;
}

.cw-history-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--cw-bg);
  border: 1px solid var(--cw-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  font: inherit;
  color: var(--cw-text);
  transition: border-color 160ms ease, box-shadow 180ms ease, transform 160ms ease;
}

.cw-history-item:hover {
  border-color: var(--cw-primary);
  box-shadow: 0 4px 14px rgba(15, 31, 51, 0.08);
  transform: translateY(-1px);
}

.cw-history-item__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cw-primary);
  margin-bottom: 6px;
}

.cw-history-item__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
}

.cw-status-check {
  color: #10b981;
  font-size: 12px;
  font-weight: 700;
}

.cw-detail-status {
  margin: 12px 4px;
  padding: 10px 12px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  border-radius: 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cw-detail-subject {
  font-size: 15px;
  font-weight: 700;
  color: var(--cw-text);
  padding: 12px 4px 8px;
  border-bottom: 1px solid var(--cw-border);
  margin-bottom: 8px;
}

.cw-detail-reply {
  flex-shrink: 0;
  border-top: 1px solid var(--cw-border);
  background: var(--cw-bg);
  padding: 10px 12px 12px;
}

.cw-detail-reply-btn {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-radius: 10px;
  background: var(--cw-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.cw-detail-reply-btn:hover {
  background: var(--cw-primary-dark);
  color: #fff;
}

.cw-detail-cancel {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--cw-text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.cw-detail-attach {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cw-attach-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.cw-attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--cw-border);
  border-radius: 8px;
  background: #fff;
  color: var(--cw-text-secondary);
  font-size: 12px;
  line-height: 1;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.cw-attach-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.cw-attach-count {
  font-size: 11px;
  color: var(--cw-text-secondary);
}

.cw-attach-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0;
}

.cw-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 10px;
  height: 28px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-size: 12px;
  line-height: 1;
  color: #374151;
  box-sizing: border-box;
}

.cw-attach-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}

.cw-attach-remove:hover {
  background: #d1d5db;
  color: #374151;
}

.cw-attach-remove svg {
  width: 8px;
  height: 8px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.cw-history-item__meta {
  font-size: 11.5px;
  color: var(--cw-text-secondary);
  margin-bottom: 6px;
}

.cw-history-item__preview {
  font-size: 13px;
  color: var(--cw-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-history-link {
  flex-shrink: 0;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--cw-primary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  padding: 10px 0 8px;
  cursor: pointer;
  border-top: 1px solid var(--cw-border);
  transition: background-color 160ms ease;
}

.cw-history-link:hover {
  background: var(--cw-primary-faint);
}

.cw-panel__body--welcome {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cw-history-link--welcome {
  margin-top: auto;
  padding-top: 20px;
  border-top: none;
  color: #1f2430;
  font-size: 13px;
  font-weight: 500;
}

.cw-history-link--welcome:hover {
  background: transparent;
  color: var(--cw-primary);
  text-decoration: underline;
}

.cw-loading {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.cw-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--cw-border);
  border-top-color: var(--cw-primary);
  border-radius: 50%;
  animation: cw-spin 700ms linear infinite;
}

@keyframes cw-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Composer ---------- */
.cw-composer {
  flex-shrink: 0;
  border-top: 1px solid var(--cw-border);
  background: var(--cw-bg);
  padding: 10px 12px 12px;
}

.cw-composer__box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1.5px solid var(--cw-border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.cw-composer__box:focus-within {
  border-color: var(--cw-primary);
  box-shadow: 0 0 0 3px var(--cw-primary-soft);
}

.cw-composer__box--error {
  border-color: #f05247;
}

.cw-composer__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.cw-composer__attach {
  flex-shrink: 0;
  margin-left: -5px;
  margin-right: auto;
}

.cw-composer__textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--cw-text);
  background: transparent;
  max-height: 120px;
  min-height: 22px;
  padding: 2px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

.cw-composer__textarea::-webkit-scrollbar {
  width: 5px;
}

.cw-composer__textarea::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
}

.cw-composer__textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}

.cw-composer__textarea::-webkit-scrollbar-track {
  background: transparent;
}

.cw-composer__textarea::placeholder {
  color: #9aa3b2;
}

.cw-composer__textarea:focus-visible {
  outline: none;
}

.cw-composer__send {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--cw-primary-light);
  color: var(--cw-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
  outline: none;
}

.cw-composer__send:focus,
.cw-composer__send:focus-visible {
  outline: none;
}

.cw-composer__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cw-composer__send:hover:not(:disabled) {
  background: var(--cw-primary);
  color: #fff;
}

.cw-composer__send:hover:not(:disabled) svg {
  stroke: #fff;
}

.cw-composer__send:active {
  transform: scale(0.92);
}

.cw-composer__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cw-composer__send svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cw-composer__hint {
  font-size: 11.5px;
  color: #f05247;
  margin: 6px 4px 0;
  min-height: 15px;
}

/* ---------- Review ---------- */
.cw-review {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  text-align: center;
  background: #fbfcfe;
}

.cw-review__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}

.cw-review__subtitle {
  font-size: 13px;
  color: var(--cw-text-secondary);
  margin: 0 0 18px;
}

/* 旧星级样式保留兼容，新表情样式优先 */
.cw-stars {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.cw-stars button {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  color: #d7dbe3;
  cursor: pointer;
  padding: 0;
  transition: transform 150ms ease, color 150ms ease;
}

.cw-stars button.is-active {
  color: #ffb45c;
}

.cw-stars button:hover {
  transform: scale(1.15);
}

.cw-review__faces {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 18px 0 22px;
}

.cw-review__face {
  appearance: none;
  border: 2px solid transparent;
  background: #f3f4f6;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: #9aa3b2;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, color 150ms ease;
}

.cw-review__face:hover {
  transform: scale(1.04);
  background: #fef3c7;
  border-color: #fbbf24;
  color: #6b7280;
}

.cw-review__face:hover .cw-face-bg {
  fill: #fde68a;
}

.cw-review__face:hover .cw-face-eye {
  fill: #6b7280;
}

.cw-review__face:hover .cw-face-mouth {
  stroke: #6b7280;
}

.cw-review__face:hover .cw-face-smile {
  fill: #6b7280;
}

.cw-review__face.is-active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #6b7280;
}

.cw-review__face-icon {
  width: 36px;
  height: 36px;
  display: block;
}

.cw-review__face-icon .cw-face-bg {
  fill: #e2e8f0;
  transition: fill 150ms ease;
}

.cw-review__face.is-active .cw-face-bg {
  fill: #fde68a;
}

.cw-review__face-icon .cw-face-eye {
  fill: #94a3b8;
  transition: fill 150ms ease;
}

.cw-review__face.is-active .cw-face-eye {
  fill: #6b7280;
}

.cw-review__face-icon .cw-face-mouth {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.5;
  stroke-linecap: round;
  transition: stroke 150ms ease;
}

.cw-review__face.is-active .cw-face-mouth {
  stroke: #6b7280;
}

.cw-review__face-icon .cw-face-smile {
  fill: #94a3b8;
  transition: fill 150ms ease;
}

.cw-review__face.is-active .cw-face-smile {
  fill: #6b7280;
}

.cw-review__hint {
  font-size: 11.5px;
  color: var(--cw-text-secondary);
  margin: -10px 0 14px;
}

.cw-review__input {
  width: 100%;
  border: 1.5px solid var(--cw-border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--cw-text);
  outline: none;
  resize: none;
  min-height: 64px;
  margin-bottom: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.cw-review__input:focus,
.cw-review__input:focus-visible {
  border-color: var(--cw-primary);
  box-shadow: 0 0 0 3px var(--cw-primary-soft);
  outline: none;
}

.cw-review__submit {
  width: 100%;
  appearance: none;
  border: none;
  border-radius: 10px;
  background: var(--cw-primary);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 0;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.cw-review__submit:hover {
  background: var(--cw-primary-dark);
}

.cw-review__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Detail reply sheet (如截图底部抽屉) ---------- */
.cw-detail-footer {
  flex-shrink: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--cw-border);
  background: #fff;
}

.cw-reply-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 31, 51, 0.32);
  display: flex;
  align-items: flex-end;
  z-index: 2;
}

.cw-reply-sheet {
  width: 100%;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px 12px 12px;
  box-shadow: 0 -8px 24px rgba(15, 31, 51, 0.12);
  animation: cw-sheet-in 180ms ease;
}

@keyframes cw-sheet-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.cw-reply-sheet__hint {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
}

.cw-reply-sheet__field {
  position: relative;
  border: 1.5px solid var(--cw-primary);
  border-radius: 10px;
  padding: 8px 4px 8px 12px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cw-reply-sheet__textarea {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  resize: none;
  font: inherit;
  font-size: 13px;
  color: var(--cw-text);
  background: transparent;
  min-height: 64px;
  max-height: 120px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
  padding: 0;
  overscroll-behavior: contain;
}

.cw-reply-sheet__textarea::-webkit-scrollbar {
  width: 5px;
}

.cw-reply-sheet__textarea::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.cw-reply-sheet__textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
  background-clip: padding-box;
}

.cw-reply-sheet__textarea::-webkit-scrollbar-track {
  background: transparent;
}

.cw-panel.has-sheet .cw-panel__body {
  overflow: hidden;
}

.cw-reply-sheet__textarea::placeholder {
  color: #9aa3b2;
}

.cw-reply-sheet__icons {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
}

.cw-icon-btn--sheet {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  margin-left: auto;
}

.cw-icon-btn--sheet:hover {
  background: #f1f5f9;
}

.cw-icon-btn--sheet svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.cw-reply-sheet__send {
  width: 100%;
  margin-top: 10px;
  padding: 12px 0;
  border: none;
  border-radius: 10px;
  background: var(--cw-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.cw-reply-sheet__send:hover:not(:disabled) {
  background: var(--cw-primary-dark);
  color: #fff;
}

.cw-reply-sheet__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- 移动端简单兼容 ---------- */
@media (max-width: 480px) {
  .cw-panel {
    right: 8px;
    bottom: 112px;
    width: calc(100vw - 16px);
    height: min(560px, calc(100vh - 128px));
    max-height: calc(100vh - 128px);
  }

  .cw-launcher {
    right: 40px;
    bottom: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cw-root * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .cw-panel-trans-enter-active,
  .cw-panel-trans-leave-active {
    transition: none !important;
  }
}

.cw-history-chat[data-v-95be96fa] {
  border: 1px solid #e3e7ef;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  margin: 6px 0;
}
.cw-history-chat__header[data-v-95be96fa] { display:flex; align-items:center; gap:8px;
}
.cw-history-chat__title[data-v-95be96fa] { font-size:13px; font-weight:600; color:#1f2430;
}
.cw-history-chat__review[data-v-95be96fa] { margin-left:auto; display:inline-flex; align-items:center;
}
.cw-hist-review-face[data-v-95be96fa] { width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; background:transparent; color:#6b7280; cursor: default;
}
.cw-hist-review-face svg[data-v-95be96fa] { width:28px; height:28px; display:block;
}
.cw-hist-review-face .hist-face-bg[data-v-95be96fa] { fill:#fde68a;
}
.cw-hist-review-face .hist-face-eye[data-v-95be96fa] { fill:#6b7280;
}
.cw-hist-review-face .hist-face-mouth[data-v-95be96fa] { fill:none; stroke:#6b7280; stroke-width:1.4; stroke-linecap:round;
}
.cw-hist-review-face .hist-face-smile[data-v-95be96fa] { fill:#6b7280;
}
.cw-hist-review-face.star-1[data-v-95be96fa],
.cw-hist-review-face.star-2[data-v-95be96fa],
.cw-hist-review-face.star-3[data-v-95be96fa] { background:transparent; color:#6b7280;
}
.cw-hist-review-face.star-1 .hist-face-bg[data-v-95be96fa],
.cw-hist-review-face.star-2 .hist-face-bg[data-v-95be96fa],
.cw-hist-review-face.star-3 .hist-face-bg[data-v-95be96fa] { fill:#fde68a;
}
.cw-hist-review-face.star-1 .hist-face-eye[data-v-95be96fa], .cw-hist-review-face.star-1 .hist-face-mouth[data-v-95be96fa],
.cw-hist-review-face.star-2 .hist-face-eye[data-v-95be96fa], .cw-hist-review-face.star-2 .hist-face-mouth[data-v-95be96fa],
.cw-hist-review-face.star-3 .hist-face-eye[data-v-95be96fa], .cw-hist-review-face.star-3 .hist-face-smile[data-v-95be96fa] { fill:#6b7280; stroke:#6b7280;
}
.cw-history-chat__time[data-v-95be96fa] { font-size:11px; color:#5b6472; margin-left:4px;
}
.cw-history-chat__divider[data-v-95be96fa] { height:1px; background:#e3e7ef; margin:8px 0 10px;
}
.cw-history-chat__list[data-v-95be96fa] { display:flex; flex-direction:column; gap:10px;
}
.cw-msg[data-v-95be96fa] { position: relative;
}
.cw-msg-bubble-wrap[data-v-95be96fa] { position: relative;
}
.cw-msg__time--hover[data-v-95be96fa] {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms;
}
.cw-msg--agent .cw-msg__time--hover[data-v-95be96fa] { left: calc(100% + 8px);
}
.cw-msg--customer .cw-msg__time--hover[data-v-95be96fa] { right: calc(100% + 8px);
}
.cw-msg:hover .cw-msg__time--hover[data-v-95be96fa] { opacity: 1;
}
.cw-history-chat .cw-msg__bubble[data-v-95be96fa] img { max-width: 180px; border-radius:6px; display:block; margin:4px 0;
}

.cw-no-agent-overlay[data-v-f79af6e4] { position: absolute; top: 56px; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 5;
}
.cw-sorry-card[data-v-f79af6e4] { background: #fff; border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,0.14); padding: 24px 20px 20px; max-width: 320px; width: 100%; text-align: center; position: relative;
}
.cw-sorry-icon[data-v-f79af6e4] { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%; background: #f1f5f9; display: flex; align-items: center; justify-content: center;
}
.cw-sorry-icon svg[data-v-f79af6e4] { width: 28px; height: 28px;
}
.cw-sorry-icon .cw-face-bg[data-v-f79af6e4] { fill: #e2e8f0;
}
.cw-sorry-icon .cw-face-eye[data-v-f79af6e4] { fill: #94a3b8;
}
.cw-sorry-icon .cw-face-mouth[data-v-f79af6e4] { fill: none; stroke: #94a3b8; stroke-width: 1.5; stroke-linecap: round;
}
.cw-sorry-title[data-v-f79af6e4] { font-size: 16px; font-weight: 700; color: #1e293b; margin: 0 0 8px;
}
.cw-sorry-text[data-v-f79af6e4] { font-size: 13px; color: #64748b; line-height: 1.5; margin: 0;
}
.cw-sorry-link[data-v-f79af6e4] { display: block; color: #2563eb; cursor: pointer; text-decoration: none; font-weight: 500;
}
.cw-sorry-link[data-v-f79af6e4]:hover { text-decoration: underline;
}
/* 客户侧还原原先 cw-msg 样式，hover 时间左右悬浮（客户左、客服/机器人右），操作日志无时间 */
.cw-msg[data-v-f79af6e4] { position: relative;
}
.cw-msg-bubble-wrap[data-v-f79af6e4] { position: relative;
}
.cw-msg__time--hover[data-v-f79af6e4] {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms;
}
.cw-msg--agent .cw-msg__time--hover[data-v-f79af6e4] { left: calc(100% + 8px);
}
.cw-msg--customer .cw-msg__time--hover[data-v-f79af6e4] { right: calc(100% + 8px);
}
/* bot 复用 agent 的右侧时间 */
.cw-msg:hover .cw-msg__time--hover[data-v-f79af6e4] { opacity: 1;
}
.cw-msg__bubble[data-v-f79af6e4] img, .cw-mail-msg__content[data-v-f79af6e4] img { max-width: 180px; border-radius: 6px; display: block; margin: 4px 0;
}
[data-v-f79af6e4] .cw-msg__bubble a,[data-v-f79af6e4] .cw-mail-msg__content a { cursor: pointer;
}
.cw-mail-atts[data-v-f79af6e4] { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px;
}
.cw-att-item[data-v-f79af6e4] { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #2563eb; font-size: 12px; cursor: pointer;
}
.cw-att-item[data-v-f79af6e4]:hover { background: #f1f5f9;
}
.cw-att-icon[data-v-f79af6e4] { font-size: 13px; line-height: 1;
}
.cw-att-name[data-v-f79af6e4] { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
