/* 在线客服组件样式 - 已优化为外部文件,可被浏览器缓存 */

.customer-service {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}
.customer-service.collapsed {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(100px) scale(0.8);
  pointer-events: none;
}
.service-panel {
  width: 220px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.service-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #fff;
}
.service-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
}
.collapse-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 14px;
}
.collapse-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}
.service-body {
  padding: 20px;
  text-align: center;
}
.qr-code {
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
  background: #f8f9fa;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 2px solid #e9ecef;
}
.qr-code img {
  width: 140px;
  height: 140px;
  object-fit: contain;
}
.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #6c757d;
  font-size: 12px;
}
.contact-info {
  margin-top: 8px;
}
.contact-item {
  padding: 8px 0;
  font-size: 14px;
  color: #495057;
}
.contact-item a {
  color: #e74c3c;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}
.contact-item a:hover {
  color: #c0392b;
  text-decoration: underline;
}
.contact-item.qq {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  margin-top: 4px;
}
.contact-item.qq .qq-number {
  color: #e74c3c;
  cursor: pointer;
  transition: all 0.3s ease;
}
.contact-item.qq .qq-number:hover {
  color: #c0392b;
}
.copy-tooltip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(44, 62, 80, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.copy-tooltip.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.service-icon-btn {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, box-shadow 0.3s ease;
  z-index: 9999;
  opacity: 0;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-tap-highlight-color: transparent;
}
.service-icon-btn.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.service-icon-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

/* 二维码长按提示 */
@media (max-width: 768px) {
  .qr-code img {
    -webkit-touch-callout: default; /* 允许长按二维码菜单 */
    user-select: none;
  }
}
.service-icon-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #e74c3c;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
@media (max-width: 768px) {
  .customer-service {
    left: 16px;
    right: auto;
    top: auto;
    bottom: 80px; /* 在左侧 */
    transform: scale(0.8); /* 整体缩放80% */
    transform-origin: left bottom;
  }
  .customer-service.collapsed {
    transform: translateX(-100px) scale(0.8);
  }
  .collapse-arrow {
    display: inline-block;
    transform: rotate(180deg); /* 移动端箭头向左 */
  }
  .service-panel { width: 200px; padding: 16px 12px 8px; background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px); }
  .qr-code { width: 140px; height: 140px; margin: 0 auto 12px; }
  .qr-code img { width: 120px; height: 120px; }
  .contact-info .contact-item:first-child { display: none; } /* 隐藏"合作建议"文字 */
  .contact-info { margin-top: 8px; line-height: 1.4; }
  .contact-info .contact-item { margin-bottom: 2px; }
  
  .service-icon-btn {
    left: 16px; /* 在左侧 */
    right: auto;
    top: auto;
    bottom: 24px; /* 与分类按钮对齐 */
    width: 46px; /* 与分类按钮同样大小 */
    height: 46px;
    font-size: 20px;
    transform: translate(0, 0) scale(0);
    opacity: 0;
  }
  .service-icon-btn.show {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  .service-icon-btn:hover {
    transform: translate(0, 0) scale(1.1);
  }
}

/* ===== 全站公告区域样式 ===== */
.site-notice {
  display: flex;
  gap: 16px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  width: 100%;
  box-sizing: border-box;
}
.notice-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 4px 0;
}
.notice-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}
.notice-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}
.notice-title svg {
  display: none;
}
.notice-body {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
}
.notice-body p {
  margin: 0 0 8px 0;
}
.notice-body p:last-child {
  margin-bottom: 0;
}
/* 移动端 */
@media (max-width: 768px) {
  .site-notice {
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    min-height: auto;
  }
  .notice-title {
    font-size: 15px;
    margin-bottom: 10px;
  }
  .notice-title::before {
    height: 16px;
  }
  .notice-body {
    font-size: 13px;
  }
}
