/* V107 · 内部客服即时对话台 */
.customer-assistant-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 14px;
  padding: 22px 26px;
  border: 1px solid #d8e2f1;
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 16%, rgba(54, 205, 186, .13), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
  box-shadow: 0 16px 42px rgba(52, 75, 120, .08);
}

.customer-assistant-intro > div:first-child {
  min-width: 0;
}

.customer-assistant-intro > div:first-child > span {
  display: block;
  margin-bottom: 7px;
  color: #526be8;
  font: 700 10px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .16em;
}

.customer-assistant-intro h2 {
  margin: 0;
  color: #14213d;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.customer-assistant-intro p {
  max-width: 760px;
  margin: 9px 0 0;
  color: #63718d;
  font-size: 13px;
  line-height: 1.7;
}

.customer-assistant-intro-status {
  display: grid;
  grid-template-columns: 10px auto;
  align-items: center;
  gap: 3px 9px;
  flex: 0 0 auto;
  min-width: 250px;
  padding: 13px 16px;
  border: 1px solid #cfeae4;
  border-radius: 15px;
  background: rgba(239, 252, 249, .86);
}

.customer-assistant-intro-status i {
  grid-row: 1 / span 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #19b89e;
  box-shadow: 0 0 0 5px rgba(25, 184, 158, .11);
}

.customer-assistant-intro-status strong {
  color: #187d70;
  font-size: 12px;
}

.customer-assistant-intro-status span {
  color: #6c7d8a;
  font-size: 10px;
}

.customer-assistant-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px) auto;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 14px;
  padding: 8px 10px;
  border-color: #dae3f1;
  border-radius: 17px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 26px rgba(52, 75, 120, .06);
}

.customer-assistant-toolbar .customer-queue-tabs {
  min-width: 0;
}

.customer-assistant-toolbar .customer-search {
  width: 100%;
}

.customer-assistant-workspace {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(480px, 1fr) minmax(270px, 330px);
  gap: 14px;
  min-height: 620px;
  height: calc(100vh - 270px);
}

.customer-assistant-history,
.customer-assistant-chat,
.customer-assistant-evidence {
  min-width: 0;
  min-height: 0;
  border: 1px solid #d9e3f1;
  border-radius: 20px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 14px 34px rgba(52, 75, 120, .07);
  overflow: hidden;
}

.customer-assistant-history {
  display: flex;
  flex-direction: column;
}

.customer-assistant-history > header {
  height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid #e6ebf3;
}

.customer-assistant-history .customer-case-list {
  min-height: 0;
  padding: 8px;
  overflow: auto;
}

.customer-assistant-history .customer-case-card {
  gap: 6px;
  margin: 0 0 6px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  box-shadow: none;
}

.customer-assistant-history .customer-case-card:hover,
.customer-assistant-history .customer-case-card.active {
  border-color: #cfd9ff;
  background: #f2f5ff;
}

.customer-assistant-history .customer-case-card.active::before {
  width: 3px;
  background: #526be8;
}

.customer-assistant-history .customer-case-card-top {
  display: flex;
  justify-content: space-between;
}

.customer-assistant-history .customer-case-card-top time {
  color: #95a0b5;
  font-size: 9px;
}

.customer-assistant-history .customer-case-card > strong {
  overflow: hidden;
  color: #1b2947;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-assistant-history .customer-case-preview {
  display: -webkit-box;
  min-height: 30px;
  overflow: hidden;
  color: #72809a;
  font-size: 10px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.customer-assistant-history .customer-case-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #8b96aa;
  font-size: 9px;
}

.customer-assistant-chat {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.customer-assistant-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 10px 18px;
  border-bottom: 1px solid #e7ecf4;
}

.customer-assistant-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.customer-assistant-boundary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-bottom: 1px solid #e6ebf3;
  background: #f7f9fd;
  color: #6e7b92;
  font-size: 10px;
}

.customer-assistant-boundary strong {
  flex: 0 0 auto;
  color: #475675;
}

.customer-assistant-thread {
  min-height: 0;
  padding: 20px;
  overflow: auto;
  background:
    linear-gradient(rgba(235, 240, 250, .54) 1px, transparent 1px),
    linear-gradient(90deg, rgba(235, 240, 250, .54) 1px, transparent 1px),
    #fbfcff;
  background-size: 28px 28px;
}

.customer-assistant-welcome {
  display: flex;
  gap: 12px;
  max-width: 700px;
  margin: 34px auto 22px;
}

.customer-assistant-welcome > div {
  padding: 18px 20px;
  border: 1px solid #dce4f2;
  border-radius: 5px 18px 18px 18px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(61, 82, 124, .08);
}

.customer-assistant-welcome strong {
  color: #192744;
  font-size: 17px;
}

.customer-assistant-welcome p {
  margin: 8px 0 0;
  color: #67758f;
  font-size: 12px;
  line-height: 1.75;
}

.customer-assistant-chat .customer-chat-prompts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 700px;
  margin: 0 auto;
}

.customer-assistant-chat .customer-chat-prompts button {
  min-height: 42px;
  border-color: #dbe3f0;
  background: rgba(255, 255, 255, .9);
  color: #40506e;
  font-size: 11px;
  text-align: left;
}

.customer-assistant-chat .customer-message {
  width: fit-content;
  max-width: min(82%, 720px);
  margin: 0 0 14px;
  border: 1px solid #dce4f0;
  border-radius: 5px 17px 17px 17px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(54, 75, 117, .06);
}

.customer-assistant-chat .customer-message.staff_query,
.customer-assistant-chat .customer-message.customer {
  margin-left: auto;
  border-color: #cfd8ff;
  border-radius: 17px 5px 17px 17px;
  background: #eef1ff;
}

.customer-assistant-chat .customer-message.ai_draft {
  border-left: 3px solid #35bba7;
  background: #fff;
}

.assistant-memory-used {
  color: #087f78 !important;
  background: #e8fbf7;
  border: 1px solid #bcebe2;
  border-radius: 999px;
  padding: 3px 8px;
}

.assistant-route-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0;
}

.assistant-route-strip small {
  color: #64748b;
  font-weight: 700;
}

.assistant-route-strip span {
  padding: 4px 8px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  line-height: 1;
}

.assistant-route-strip span.restricted {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
}

.assistant-triage-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.assistant-triage-reasons span {
  color: #42526b;
  background: #f4f7fb;
  border: 1px solid #e2e8f2;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
}

.assistant-clarification {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #f1d7a2;
  border-radius: 10px;
  background: #fffaf0;
}

.assistant-clarification strong {
  color: #8b5a00;
  font-size: 12px;
}

.assistant-clarification span {
  color: #624a24;
  font-size: 13px;
  line-height: 1.6;
}

.assistant-next-questions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.assistant-next-questions small {
  color: #7a879b;
  font-weight: 700;
  margin-right: 2px;
}

.assistant-next-questions button {
  border: 1px solid #d7def7;
  border-radius: 999px;
  color: #4655c7;
  background: #f7f8ff;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.assistant-next-questions button:hover {
  border-color: #8f9cf0;
  background: #eef0ff;
}

.customer-assistant-chat .customer-message.system {
  max-width: 100%;
  margin: 8px auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #8994a8;
}

.customer-assistant-chat .customer-message-content {
  white-space: pre-wrap;
}

.customer-assistant-composer {
  padding: 14px 16px 16px;
  border-top: 1px solid #e3e9f2;
  background: #fff;
}

.customer-assistant-composer textarea {
  display: block;
  width: 100%;
  min-height: 74px;
  resize: none;
  border: 1px solid #cfd9ea;
  border-radius: 14px;
  padding: 13px 14px;
  background: #fbfcff;
  color: #1b2947;
  font: inherit;
  line-height: 1.6;
  outline: none;
  box-sizing: border-box;
}

.customer-assistant-composer textarea:focus {
  border-color: #6a78eb;
  box-shadow: 0 0 0 4px rgba(82, 107, 232, .1);
}

.customer-assistant-composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.customer-assistant-composer-meta small {
  color: #8a96aa;
  font-size: 10px;
}

.customer-assistant-evidence {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  overflow: auto;
}

.customer-knowledge-health,
.customer-assistant-evidence .customer-fact-card,
.customer-assistant-guide {
  flex: 0 0 auto;
  border: 1px solid #e0e7f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

.customer-knowledge-health {
  padding: 15px;
  background: linear-gradient(145deg, #f3fbf9, #f7f9ff);
}

.customer-knowledge-health > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.customer-knowledge-health > header span {
  color: #1c2d4d;
  font-size: 12px;
  font-weight: 800;
}

.customer-knowledge-health > header i {
  color: #168a78;
  font-size: 9px;
  font-style: normal;
}

.customer-knowledge-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 13px 0;
}

.customer-knowledge-numbers span {
  display: grid;
  gap: 2px;
  padding: 9px 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
  text-align: center;
}

.customer-knowledge-numbers strong {
  color: #1a2d50;
  font-size: 18px;
}

.customer-knowledge-numbers small {
  color: #8490a4;
  font-size: 8px;
}

.customer-knowledge-health ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.customer-knowledge-health li {
  display: grid;
  grid-template-columns: 7px 1fr auto;
  align-items: center;
  gap: 7px;
  color: #596984;
  font-size: 9px;
}

.customer-knowledge-health li i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #20b29c;
}

.customer-knowledge-health li.review i {
  background: #e3a526;
}

.customer-knowledge-health li b {
  color: #30425f;
  font-weight: 700;
}

.customer-knowledge-health > p {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid #dfe8ec;
  color: #78869b;
  font-size: 9px;
  line-height: 1.6;
}

.customer-assistant-evidence .customer-fact-card {
  padding: 14px;
}

.customer-assistant-evidence .assistant-scope {
  border-color: #d9e0fb;
  background: linear-gradient(145deg, #f7f8ff, #f3fbfa);
}

.customer-assistant-evidence .assistant-scope > strong {
  display: block;
  margin-top: 10px;
  color: #1c2d4d;
  font-size: 12px;
}

.customer-assistant-evidence .assistant-scope > p {
  margin: 5px 0 10px;
  color: #66758f;
  font-size: 10px;
  line-height: 1.55;
}

.customer-assistant-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.customer-assistant-modules i {
  padding: 4px 7px;
  border: 1px solid #dce4f5;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  color: #53627c;
  font-size: 8px;
  font-style: normal;
}

.customer-assistant-guide {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.customer-assistant-guide strong {
  color: #1c2d4d;
  font-size: 12px;
}

.customer-assistant-guide span {
  padding-left: 12px;
  color: #6d7a91;
  font-size: 10px;
  line-height: 1.5;
  position: relative;
}

.customer-assistant-guide span::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #526be8;
}

@media (max-width: 1380px) {
  .customer-assistant-workspace {
    grid-template-columns: 220px minmax(460px, 1fr) 290px;
  }
}

@media (max-width: 1120px) {
  .customer-assistant-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
    height: auto;
  }

  .customer-assistant-chat {
    min-height: 640px;
  }

  .customer-assistant-evidence {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .customer-knowledge-health {
    grid-row: span 2;
  }
}

@media (max-width: 760px) {
  .customer-assistant-intro {
    display: grid;
    padding: 18px;
  }

  .customer-assistant-intro-status {
    min-width: 0;
  }

  .customer-assistant-toolbar {
    grid-template-columns: 1fr;
  }

  .customer-assistant-workspace {
    grid-template-columns: 1fr;
  }

  .customer-assistant-history {
    max-height: 230px;
  }

  .customer-assistant-chat {
    min-height: 600px;
  }

  .customer-assistant-boundary,
  .customer-assistant-composer-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-assistant-chat .customer-chat-prompts,
  .customer-assistant-evidence {
    grid-template-columns: 1fr;
  }

  .customer-assistant-evidence {
    grid-column: auto;
  }

  .customer-assistant-chat .customer-message {
    max-width: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-assistant-intro *,
  .customer-assistant-chat * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
