/* AI同行书客服浮窗 — 全部 .cs- 前缀，避免污染主站 */
.cs-panel {
  position: fixed;
  right: 52px;
  top: 12vh;
  width: min(360px, calc(100vw - 72px));
  max-height: min(72vh, 640px);
  z-index: 1120;
  display: flex;
  flex-direction: column;
  background: #f7f4ef;
  color: #1f1a14;
  border: 1px solid rgba(40, 32, 24, 0.12);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(20, 16, 12, 0.18);
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
.cs-panel[hidden] { display: none !important; }

.cs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #1f1a14;
  color: #f7f4ef;
}
.cs-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cs-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #f7f4ef;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.85;
}
.cs-close:hover { opacity: 1; }

.cs-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.cs-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 4px;
}
.cs-chip {
  appearance: none;
  border: 1px solid rgba(40, 32, 24, 0.16);
  background: #fff;
  color: #1f1a14;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}
.cs-chip.is-on {
  background: #1f1a14;
  color: #f7f4ef;
  border-color: #1f1a14;
}

.cs-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
}
.cs-bubble {
  max-width: 92%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.cs-bubble.is-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(40, 32, 24, 0.08);
}
.cs-bubble.is-user {
  align-self: flex-end;
  background: #2c241c;
  color: #f7f4ef;
}

.cs-ticket {
  align-self: stretch;
  background: #fff;
  border: 1px solid rgba(40, 32, 24, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}
.cs-ticket h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}
.cs-ticket label {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #5c5348;
}
.cs-ticket input,
.cs-ticket textarea {
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
  border: 1px solid rgba(40, 32, 24, 0.16);
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  background: #fbfaf8;
}
.cs-ticket textarea { min-height: 72px; resize: vertical; }
.cs-ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.cs-btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  background: #1f1a14;
  color: #f7f4ef;
}
.cs-btn.ghost {
  background: transparent;
  border: 1px solid rgba(40, 32, 24, 0.2);
  color: #1f1a14;
}
.cs-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cs-foot {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(40, 32, 24, 0.08);
  background: #efeae3;
}
.cs-foot input {
  flex: 1;
  border: 1px solid rgba(40, 32, 24, 0.16);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}
.cs-foot button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: #1f1a14;
  color: #f7f4ef;
  font-size: 13px;
  cursor: pointer;
}
.cs-foot button:disabled { opacity: 0.5; cursor: not-allowed; }

.cs-login-hint {
  padding: 16px 14px;
  font-size: 13px;
  line-height: 1.6;
}
.cs-status {
  padding: 0 12px 8px;
  font-size: 12px;
  color: #7a6f62;
  min-height: 16px;
}

@media (max-width: 520px) {
  .cs-panel {
    right: 10px;
    left: 10px;
    width: auto;
    top: 10vh;
  }
}
