/* ===================================
   在线客服样式
   =================================== */

/* ===== 客服悬浮按钮 ===== */
.customer-service-float {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.cs-float-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  box-shadow: 0 4px 16px rgba(79, 134, 247, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.cs-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(79, 134, 247, 0.5);
}

.cs-float-btn:active {
  transform: scale(0.95);
}

.cs-float-btn svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

.cs-float-btn .cs-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  background: #EF4444;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* 迷你按钮（收起状态） */
.cs-mini-btn {
  width: 48px;
  height: 48px;
}

/* ===== 客服弹窗 ===== */
.cs-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cs-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cs-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow: hidden;
}

.cs-modal-overlay.active + .cs-modal,
.cs-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* 弹窗头部 */
.cs-modal-header {
  background: var(--primary-gradient);
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cs-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
}

.cs-modal-title svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.cs-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cs-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.cs-modal-close svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

/* 弹窗内容 */
.cs-modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

/* 客服方式卡片 */
.cs-contact-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.cs-contact-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.cs-contact-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.cs-contact-card .card-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.cs-contact-card .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.cs-contact-card .card-desc {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* 微信二维码区域 */
.cs-wechat-section {
  background: linear-gradient(135deg, #07C160 0%, #06AD56 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
}

.cs-wechat-section .wechat-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cs-wechat-qr {
  width: 160px;
  height: 160px;
  background: #fff;
  border-radius: var(--radius-md);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.cs-wechat-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cs-wechat-qr-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
}

.cs-wechat-qr-placeholder svg {
  width: 48px;
  height: 48px;
  fill: #07C160;
  margin-bottom: 8px;
}

.cs-wechat-tip {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* 工作时间 */
.cs-worktime {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.cs-worktime-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-worktime-title svg {
  width: 18px;
  height: 18px;
  fill: var(--primary);
}

.cs-worktime-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-worktime-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.cs-worktime-item .day {
  color: var(--gray-600);
}

.cs-worktime-item .time {
  color: var(--gray-800);
  font-weight: 500;
}

.cs-worktime-item.off .time {
  color: #EF4444;
}

.cs-worktime-item .online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  margin-right: 6px;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* FAQ快捷入口 */
.cs-faq-section {
  border-top: 1px solid var(--gray-200);
  padding-top: 20px;
}

.cs-faq-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-faq-title svg {
  width: 18px;
  height: 18px;
  fill: var(--primary);
}

.cs-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-faq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
  color: var(--gray-700);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.cs-faq-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.cs-faq-item svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.cs-faq-more {
  text-align: center;
  margin-top: 12px;
}

.cs-faq-more a {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
}

.cs-faq-more a:hover {
  text-decoration: underline;
}

/* 响应式 */
@media (max-width: 768px) {
  .customer-service-float {
    right: 16px;
    bottom: 80px;
  }
  
  .cs-float-btn {
    width: 52px;
    height: 52px;
  }
  
  .cs-float-btn svg {
    width: 24px;
    height: 24px;
  }
  
  .cs-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 32px);
  }
  
  .cs-modal-body {
    padding: 16px;
  }
  
  .cs-contact-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .cs-contact-card {
    padding: 12px;
  }
  
  .cs-contact-card .card-icon {
    font-size: 1.5rem;
  }
  
  .cs-wechat-section {
    padding: 16px;
  }
  
  .cs-wechat-qr {
    width: 120px;
    height: 120px;
  }
}
