/* 客服页 · 正规 Telegram Web A 源视觉（通道仍走 /api/cs） */
#screen-cs-user-chat.active {
  display: flex !important;
  flex-direction: column;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden !important;
  padding: 0 !important;
  background: #0e1621 !important;
  color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#screen-cs-user-chat .sub-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  margin: 0 !important;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 10px !important;
  background: #17212b !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  z-index: 50;
}

#screen-cs-user-chat .sub-title {
  flex: 1;
  padding: 0 8px !important;
  text-align: left !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #fff !important;
  letter-spacing: 0.01em;
}

#screen-cs-user-chat .back--top,
#screen-cs-user-chat .user-cs-clear-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 36px;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #6ab2f2 !important;
  font-size: 15px !important;
  box-shadow: none !important;
}

#screen-cs-user-chat .page-inner.user-cs-page {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(42, 171, 238, 0.08), transparent 45%),
    #0e1621 !important;
}

#screen-cs-user-chat .user-cs-agent-row {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 10px;
  background: #17212b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  -webkit-overflow-scrolling: touch;
}

#screen-cs-user-chat .user-cs-agent-btn {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 7px 12px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #242f3d !important;
  color: #c5d0db !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

#screen-cs-user-chat .user-cs-agent-btn--active,
#screen-cs-user-chat .user-cs-agent-btn.is-active {
  background: #2aabee !important;
  border-color: #2aabee !important;
  color: #fff !important;
}

#screen-cs-user-chat .cam-cs-panel.user-cs-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden;
}

#screen-cs-user-chat .cam-cs-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(23, 33, 43, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#screen-cs-user-chat .cam-cs-avatar-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: #2aabee;
  flex: 0 0 auto;
}

#screen-cs-user-chat .cam-cs-avatar-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#screen-cs-user-chat .cam-cs-meta {
  flex: 1;
  min-width: 0;
}

#screen-cs-user-chat .cam-cs-meta strong {
  display: block;
  font-size: 15px;
  color: #fff;
  font-weight: 600;
}

#screen-cs-user-chat .cam-cs-role {
  display: block;
  font-size: 12px;
  color: #6d7f8f;
  margin-top: 2px;
}

#screen-cs-user-chat .cam-cs-status {
  font-size: 12px;
  color: #4fae4e;
  font-weight: 600;
}

#screen-cs-user-chat #userCsChat.cam-cs-chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px 16px !important;
  background: transparent !important;
  -webkit-overflow-scrolling: touch;
}

#screen-cs-user-chat .cam-cs-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  margin: 0 0 8px;
}

#screen-cs-user-chat .cam-cs-msg-who {
  display: none; /* 正规飞机气泡不显示“我/客服”字样 */
}

#screen-cs-user-chat .cam-cs-msg-body {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

#screen-cs-user-chat .cam-cs-msg--agent {
  align-self: flex-start;
  align-items: flex-start;
}

#screen-cs-user-chat .cam-cs-msg--agent .cam-cs-msg-body {
  background: #182533;
  color: #f5f5f5;
  border-top-left-radius: 4px;
}

#screen-cs-user-chat .cam-cs-msg--user {
  align-self: flex-end;
  margin-left: auto;
  align-items: flex-end;
}

#screen-cs-user-chat .cam-cs-msg--user .cam-cs-msg-body {
  background: #2b5278;
  color: #fff;
  border-top-right-radius: 4px;
}

#screen-cs-user-chat .cam-cs-msg--system {
  align-self: center;
  max-width: 90%;
}

#screen-cs-user-chat .cam-cs-msg--system .cam-cs-msg-body {
  background: rgba(255, 255, 255, 0.06);
  color: #8b9aab;
  font-size: 12px;
  text-align: center;
  box-shadow: none;
  border-radius: 10px;
}

#screen-cs-user-chat .cam-cs-emoji-panel {
  background: #17212b !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#screen-cs-user-chat .cam-cs-compose.user-cs-compose {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #17212b !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

#screen-cs-user-chat .user-cs-toolbar {
  display: flex;
  gap: 4px;
  align-items: center;
}

#screen-cs-user-chat .cam-cs-compose-btn {
  min-width: 36px;
  height: 36px;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #6ab2f2 !important;
  font-size: 18px !important;
  box-shadow: none !important;
}

#screen-cs-user-chat .user-cs-inputbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

#screen-cs-user-chat .cam-cs-input {
  flex: 1;
  min-height: 40px;
  padding: 10px 14px !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: #242f3d !important;
  color: #f5f5f5 !important;
  font-size: 15px !important;
  outline: none !important;
  box-shadow: none !important;
}

#screen-cs-user-chat .cam-cs-input::placeholder {
  color: #6d7f8f;
}

#screen-cs-user-chat .cam-cs-compose-btn--send {
  min-width: 64px !important;
  height: 40px !important;
  padding: 0 14px !important;
  border-radius: 20px !important;
  background: #2aabee !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

#screen-cs-user-chat .cam-cs-msg-body img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
}
