/* AI 导购浮窗 — 创设网络 */
.ai-launcher {
  background: var(--ink-2, #0d1524);
}

.ai-launcher.is-open {
  outline: 2px solid rgba(54, 191, 250, 0.55);
  outline-offset: 2px;
}

.ai-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(7, 11, 20, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ai-backdrop[hidden] {
  display: none;
}

.ai-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 45;
  width: min(92vw, 44rem);
  height: min(86vh, 40rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line, rgba(7, 11, 20, 0.1));
  box-shadow: 0 28px 80px rgba(7, 11, 20, 0.32);
  overflow: hidden;
}

.ai-panel[hidden] {
  display: none;
}

.ai-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.15rem 1.35rem;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(22, 93, 255, 0.18), transparent 55%),
    linear-gradient(145deg, #0d1524, #152238);
  color: #fff;
}

.ai-panel-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.ai-panel-head p {
  margin: 0.3rem 0 0;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.4;
}

.ai-head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ai-sound,
.ai-close {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 2px;
}

.ai-close {
  font-size: 1.6rem;
}

.ai-sound {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  min-width: 2rem;
}

.ai-sound.is-muted {
  opacity: 0.55;
  text-decoration: line-through;
}

.ai-sound:hover,
.ai-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ai-bubble.is-nudge {
  border-left: 3px solid var(--brand-cyan, #36bffa);
  background: #eef7ff;
}

.ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem 0.35rem;
  border-bottom: 1px solid var(--mist, #e9eef5);
  background: #f8fafc;
}

.ai-quick button {
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  color: var(--ink, #070b14);
  background: #fff;
  border: 1px solid var(--line, rgba(7, 11, 20, 0.1));
  letter-spacing: 0.02em;
  transition: border-color 0.2s, color 0.2s;
}

.ai-quick button:hover {
  border-color: rgba(22, 93, 255, 0.35);
  color: var(--brand-blue, #165dff);
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: linear-gradient(180deg, #f8fafc, #fff 40%);
}

.ai-bubble {
  max-width: 85%;
  padding: 0.85rem 1rem;
  font-size: 0.98rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-bubble.is-bot {
  align-self: flex-start;
  background: #eef3f9;
  color: var(--text, #121a28);
  border: 1px solid rgba(7, 11, 20, 0.06);
}

.ai-bubble.is-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #14a0a8, #165dff);
  color: #fff;
}

.ai-bubble .ai-link {
  color: var(--brand-blue, #165dff);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.ai-bubble .ai-link:hover {
  color: #0f46c7;
}

.ai-bubble.is-typing {
  color: var(--muted, #5a6a7e);
  font-size: 0.85rem;
}

.ai-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0 1.35rem 0.65rem;
}

.ai-cta-row a {
  flex: 1;
  min-width: 8rem;
  text-align: center;
  padding: 0.55rem 0.65rem;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--line, rgba(7, 11, 20, 0.1));
}

.ai-cta-call {
  background: var(--brand-grad, linear-gradient(135deg, #14a0a8, #165dff));
  color: #fff;
  border: 0 !important;
}

.ai-cta-wx {
  background: #fff;
  color: #07c160;
  border-color: rgba(7, 193, 96, 0.35) !important;
}

.ai-form {
  display: flex;
  gap: 0.55rem;
  padding: 0.85rem 1.35rem 1rem;
  border-top: 1px solid var(--mist, #e9eef5);
  background: #fff;
}

.ai-form input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line, rgba(7, 11, 20, 0.12));
  font: inherit;
  font-size: 0.98rem;
  outline: none;
}

.ai-form input:focus {
  border-color: rgba(22, 93, 255, 0.45);
}

.ai-form button {
  padding: 0.85rem 1.35rem;
  background: var(--ink, #070b14);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}

.ai-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ai-note {
  margin: 0;
  padding: 0 1.35rem 0.85rem;
  font-size: 0.72rem;
  color: var(--muted, #5a6a7e);
  text-align: center;
}

@media (max-width: 640px) {
  .ai-panel {
    width: min(96vw, 44rem);
    height: min(88vh, 40rem);
  }

  .ai-bubble {
    max-width: 92%;
  }
}
