/* ═══════════════════════════════════════════════════════════
   Advisor Widget - 专属顾问悬浮窗组件
   ═══════════════════════════════════════════════════════════ */

/* CSS Variables (if not already defined) */
:root {
  --advisor-gold: #C9A96E;
  --advisor-gold-dark: #8B6F47;
  --advisor-navy: #1A2332;
  --advisor-cream: #F5F0E8;
}

/* Widget Container */
.advisor-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

/* Floating Button */
.advisor-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--advisor-gold) 0%, var(--advisor-gold-dark) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(201, 169, 110, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.advisor-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(201, 169, 110, 0.5);
}

.advisor-btn svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.advisor-btn-text {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--advisor-gold);
  white-space: nowrap;
  font-weight: 500;
}

/* Pulse Animation */
.advisor-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--advisor-gold);
  opacity: 0;
  animation: advisorPulse 2s ease-in-out infinite;
}

@keyframes advisorPulse {
  0%, 100% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.1);
  }
}

/* Panel */
.advisor-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 360px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
}

.advisor-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Panel Header */
.advisor-panel-header {
  background: var(--advisor-navy);
  padding: 24px;
  text-align: center;
}

.advisor-panel-title {
  font-family: "Noto Serif SC", serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--advisor-cream);
  margin-bottom: 8px;
}

.advisor-panel-subtitle {
  font-size: 0.875rem;
  color: rgba(245, 240, 232, 0.7);
}

.advisor-panel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--advisor-cream);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.advisor-panel-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Panel Content */
.advisor-panel-content {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 240px);
}

/* Contact Cards */
.advisor-contact-card {
  padding: 20px;
  border: 1px solid #E5E0D8;
  border-radius: 12px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.advisor-contact-card:hover {
  border-color: var(--advisor-gold);
  box-shadow: 0 4px 12px rgba(201, 169, 110, 0.1);
}

.advisor-contact-card:last-child {
  margin-bottom: 0;
}

.advisor-contact-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.advisor-contact-icon {
  width: 40px;
  height: 40px;
  background: rgba(201, 169, 110, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.advisor-contact-icon svg {
  width: 20px;
  height: 20px;
  color: var(--advisor-gold);
}

.advisor-contact-info h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #2C2C2C;
  margin-bottom: 4px;
}

.advisor-contact-info p {
  font-size: 0.8125rem;
  color: #666;
}

/* Contact Actions */
.advisor-contact-actions {
  display: flex;
  gap: 12px;
}

.advisor-contact-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.advisor-contact-btn-primary {
  background: var(--advisor-gold);
  color: #fff;
}

.advisor-contact-btn-primary:hover {
  background: var(--advisor-gold-dark);
}

.advisor-contact-btn-secondary {
  background: rgba(201, 169, 110, 0.1);
  color: var(--advisor-gold);
}

.advisor-contact-btn-secondary:hover {
  background: rgba(201, 169, 110, 0.2);
}

/* QR Code */
.advisor-qrcode {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 8px;
  text-align: center;
}

.advisor-qrcode.show {
  display: block;
}

.advisor-qrcode-placeholder {
  width: 160px;
  height: 160px;
  margin: 0 auto 12px;
  background: #fff;
  border: 2px dashed #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.875rem;
}

.advisor-qrcode-img {
  width: 160px;
  height: 160px;
  margin: 0 auto 12px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: block;
}

.advisor-qrcode-tip {
  font-size: 0.75rem;
  color: #999;
  margin: 0;
}

/* Message Form */
.advisor-form {
  margin-top: 12px;
}

.advisor-form-group {
  margin-bottom: 12px;
}

.advisor-form-group label {
  display: block;
  font-size: 0.8125rem;
  color: #666;
  margin-bottom: 6px;
}

.advisor-form-group input,
.advisor-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E5E0D8;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.3s ease;
}

.advisor-form-group input:focus,
.advisor-form-group textarea:focus {
  outline: none;
  border-color: var(--advisor-gold);
}

.advisor-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.advisor-form-submit {
  width: 100%;
  padding: 12px;
  background: var(--advisor-gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.advisor-form-submit:hover {
  background: var(--advisor-gold-dark);
}

/* Success Message */
.advisor-success {
  display: none;
  text-align: center;
  padding: 24px;
}

.advisor-success.show {
  display: block;
}

.advisor-success-icon {
  width: 48px;
  height: 48px;
  background: rgba(76, 175, 80, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.advisor-success-icon svg {
  width: 24px;
  height: 24px;
  color: #4CAF50;
}

.advisor-success h4 {
  font-size: 1rem;
  color: #2C2C2C;
  margin-bottom: 8px;
}

.advisor-success p {
  font-size: 0.875rem;
  color: #666;
}

/* Toast */
.advisor-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--advisor-navy);
  color: var(--advisor-cream);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
}

.advisor-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .advisor-widget {
    bottom: 16px;
    right: 16px;
  }

  .advisor-btn {
    width: 52px;
    height: 52px;
  }

  .advisor-btn svg {
    width: 24px;
    height: 24px;
  }

  .advisor-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }

  .advisor-panel.open {
    transform: translateY(0);
  }

  .advisor-panel-content {
    max-height: calc(80vh - 120px);
  }
}
