/* 梦泽AI · 专属客服与官方群精致弹窗（QQ + Telegram 个人客服 + Telegram 官方群） */
.cs-hdr-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.cs-hdr-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.cs-footer-trigger {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cs-footer-trigger:hover {
  color: #1e3a8a;
  text-decoration: underline;
}

.cs-dialog {
  margin: auto;
  padding: 0;
  border: 1px solid rgba(197, 212, 247, 0.78);
  border-radius: 22px;
  width: min(880px, calc(100vw - 24px));
  max-height: min(90dvh, 780px);
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  color: #0f172a;
  box-shadow:
    0 24px 64px -16px rgba(16, 35, 71, 0.34),
    0 8px 24px -8px rgba(16, 35, 71, 0.16);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

.cs-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: cs-dialog-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-dialog::backdrop {
  background: rgba(12, 25, 52, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@keyframes cs-dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cs-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px 16px;
  background: linear-gradient(135deg, #102347 0%, #1c3a75 62%, #21498e 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(253, 230, 138, 0.22);
}

.cs-head-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.cs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(254, 243, 199, 0.16);
  border: 1px solid rgba(253, 230, 138, 0.35);
  color: #fde68a;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.cs-title {
  margin: 0;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.cs-subtitle {
  margin: 0;
  font-size: 13px;
  color: rgba(226, 236, 255, 0.88);
  line-height: 1.45;
}

.cs-close-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.cs-close-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: scale(1.04);
}

.cs-close-btn:focus-visible {
  outline: 2px solid #fde68a;
  outline-offset: 2px;
}

.cs-body {
  padding: 20px 24px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cs-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 2px 10px rgba(15, 35, 71, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.cs-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -10px rgba(16, 35, 71, 0.16);
}

.cs-card--qq {
  border-top: 3px solid #1890ff;
}

.cs-card--tg {
  border-top: 3px solid #229ed9;
}

.cs-card--channel {
  border-top: 3px solid #10b981;
}

.cs-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.cs-card-name {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  color: #0f172a;
}

.cs-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.cs-card--qq .cs-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.cs-card--tg .cs-badge {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.cs-card--channel .cs-badge {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.cs-card-desc {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.45;
  min-height: 36px;
}

.cs-qr-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 480 / 618;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid #e6ecf4;
  background: #f8fafc;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(15, 35, 71, 0.06);
}

.cs-qr-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 0;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease;
}

.cs-primary-btn:hover {
  filter: brightness(1.07);
}

.cs-primary-btn:active {
  transform: scale(0.985);
}

.cs-card--qq .cs-primary-btn {
  background: linear-gradient(135deg, #1677ff 0%, #1d4ed8 100%);
}

.cs-card--tg .cs-primary-btn {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.cs-card--channel .cs-primary-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.cs-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid #d7e1ef;
  background: #f8fafd;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.cs-copy-btn:hover {
  background: #eef4ff;
  border-color: #93b4f5;
  color: #1e3a8a;
}

.cs-copy-btn.is-copied {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.cs-foot-note {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 11px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cs-status-pill {
  font-size: 12px;
  font-weight: 650;
  color: #047857;
  min-height: 18px;
}

@media (max-width: 740px) {
  .cs-dialog {
    margin: auto 0 0;
    width: 100vw;
    max-width: 100vw;
    max-height: 90dvh;
    border-radius: 22px 22px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .cs-head {
    padding: 16px 18px 14px;
  }

  .cs-title {
    font-size: 17px;
  }

  .cs-body {
    padding: 14px 16px 20px;
  }

  .cs-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cs-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 13px;
    row-gap: 4px;
    padding: 12px;
    align-items: start;
  }

  .cs-qr-frame {
    grid-column: 1;
    grid-row: 1 / 4;
    margin-bottom: 0;
    width: 116px;
  }

  .cs-card-head {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 5px;
  }

  .cs-card-name {
    font-size: 14px;
  }

  .cs-card-desc {
    grid-column: 2;
    grid-row: 2;
    margin-bottom: 6px;
    min-height: 0;
    font-size: 12px;
  }

  .cs-actions {
    grid-column: 2;
    grid-row: 3;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    align-self: end;
  }

  .cs-primary-btn,
  .cs-copy-btn {
    width: auto;
    flex: 1 1 112px;
    height: 34px;
    font-size: 12px;
    padding: 0 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-dialog[open] {
    animation: none;
  }
  .cs-card,
  .cs-close-btn,
  .cs-primary-btn,
  .cs-copy-btn {
    transition: none;
  }
}
