/* 联系客服：移动优先，卡片 + 会话气泡 + 二维码。 */
.cs-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 22px 60px;
}
.cs-hero { margin-bottom: 22px; }
.cs-hero h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}
.cs-hero p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 640px;
}

.cs-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.cs-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.cs-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 10px 30px -18px rgba(20, 24, 46, 0.25);
}
.cs-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 16px;
  color: var(--ink);
}
.cs-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.cs-dot-green {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

.cs-textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 13px 14px;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface-sunken);
  resize: vertical;
  transition: border-color .18s, box-shadow .18s;
  box-sizing: border-box;
}
.cs-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}
.cs-field-label {
  margin: 18px 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.cs-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.cs-chip {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 15px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s;
}
.cs-chip:hover { border-color: var(--accent); color: var(--accent); }
.cs-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cs-contact-wrap { margin-top: 12px; }
.cs-contact-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  box-sizing: border-box;
  background: var(--surface-sunken);
}
.cs-contact-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}
.cs-form-error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
}
.cs-submit {
  margin-top: 18px;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 13px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  box-shadow: 0 12px 24px -12px var(--accent);
}
.cs-submit:hover { transform: translateY(-1px); }
.cs-submit:active { transform: translateY(0); }
.cs-submit:disabled { opacity: .65; cursor: default; transform: none; }

/* 二维码 */
.cs-qr-frame {
  display: flex;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}
.cs-qr-img {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
}
.cs-qr-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.cs-qr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 10px;
  color: var(--faint);
  text-align: center;
  font-size: 13.5px;
}
.cs-qr-empty svg { width: 52px; height: 52px; }

/* 历史会话 */
.cs-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cs-history-head strong { font-size: 16px; color: var(--ink); }
.cs-history-head span { font-size: 13px; color: var(--muted); }
.cs-history-empty {
  margin: 0;
  padding: 26px;
  text-align: center;
  color: var(--faint);
  font-size: 14px;
  background: var(--surface-sunken);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.cs-thread {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-sunken);
  margin-bottom: 14px;
}
.cs-thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
}
.cs-transcript { display: flex; flex-direction: column; gap: 12px; }
.cs-bubble {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
}
.cs-bubble p { margin: 4px 0 6px; white-space: pre-wrap; word-break: break-word; }
.cs-bubble small { font-size: 11.5px; opacity: .75; }
.cs-bubble-role { font-size: 12px; font-weight: 700; }
.cs-bubble-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.cs-bubble-admin {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 5px;
}
.cs-bubble-admin .cs-bubble-role { color: var(--success); }
.cs-follow { display: flex; gap: 9px; margin-top: 14px; }
.cs-follow-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 15px;
  font: inherit;
  font-size: 13.5px;
  background: #fff;
}
.cs-follow-input:focus { outline: none; border-color: var(--accent); }
.cs-follow-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}
.cs-follow-btn:disabled { opacity: .6; }

.cs-loading {
  padding: 80px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* 平板 */
@media (max-width: 900px) {
  .cs-grid { grid-template-columns: 1fr; }
  .cs-col-side { order: -1; }
}
/* 手机 */
@media (max-width: 600px) {
  .cs-wrap { padding: 18px 14px 48px; }
  .cs-hero h1 { font-size: 22px; }
  .cs-card { padding: 18px 16px; border-radius: var(--radius); }
  .cs-bubble { max-width: 90%; }
  .cs-follow-btn { padding: 10px 15px; }
}

/* ===== 首屏客服回复弹窗 ===== */
.cp-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(13, 16, 32, 0.55);
  backdrop-filter: blur(6px);
  animation: cpfade .2s ease;
}
.cp-overlay[hidden] { display: none; }
@keyframes cpfade { from { opacity: 0; } to { opacity: 1; } }
.cp-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 30px 70px -24px rgba(10, 13, 30, 0.55);
  animation: cprise .28s cubic-bezier(.2, .8, .25, 1);
}
@keyframes cprise { from { transform: translateY(18px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.cp-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.cp-head-ic {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.cp-head-ic svg { width: 22px; height: 22px; }
.cp-head strong { display: block; font-size: 16.5px; color: var(--ink); }
.cp-head small { font-size: 12.5px; color: var(--muted); }
.cp-body { margin-bottom: 22px; }
.cp-context {
  margin: 0 0 12px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--surface-sunken);
  border-radius: 12px;
}
.cp-context:empty { display: none; }
.cp-reply {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.cp-actions { display: flex; gap: 11px; }
.cp-btn {
  flex: 1;
  border: none;
  border-radius: 13px;
  padding: 12px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}
.cp-btn:active { transform: scale(.98); }
.cp-btn-primary { background: var(--accent); color: #fff; box-shadow: 0 12px 22px -12px var(--accent); }
.cp-btn-ghost { background: var(--surface-sunken); color: var(--ink-soft); border: 1px solid var(--line); }
@media (max-width: 600px) {
  .cp-card { padding: 20px; border-radius: 18px; }
}
