/* 朗慧 AI 导购面板 — 对齐官网 coral/ink，非紫色 AI 套版 */
:root {
  --lhai-ink: #091d35;
  --lhai-slate: #35506e;
  --lhai-muted: #53677d;
  --lhai-line: #dbe6ef;
  --lhai-wash: #f3f7fb;
  --lhai-coral: #c74435;
  --lhai-coral-deep: #ab3329;
  --lhai-focus: #4c9fd3;
  --lhai-ok: #0f766e;
}

.lhai-panel {
  position: relative;
  margin: 28px auto 8px;
  width: min(1120px, calc(100% - 32px));
  border: 1px solid var(--lhai-line);
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(255,255,255,.97) 0%, rgba(243,247,251,.96) 100%),
    radial-gradient(120% 80% at 100% 0%, rgba(199,68,53,.06), transparent 55%);
  box-shadow: 0 18px 40px rgba(9, 29, 53, .06);
  overflow: hidden;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  color: var(--lhai-ink);
  animation: lhai-in .55s ease both;
}
@keyframes lhai-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.lhai-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--lhai-coral), #4c9fd3);
}
.lhai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 8px;
}
.lhai-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lhai-brand strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.lhai-brand span {
  color: var(--lhai-muted);
  font-size: .82rem;
  line-height: 1.55;
  max-width: 42em;
}
.lhai-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(199,68,53,.22);
  background: #fff0ed;
  color: var(--lhai-coral);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.lhai-body { padding: 8px 22px 18px; }
.lhai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.lhai-chip {
  appearance: none;
  border: 1px solid var(--lhai-line);
  background: #fff;
  color: var(--lhai-slate);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s, color .18s, transform .18s, background .18s;
}
.lhai-chip:hover, .lhai-chip:focus-visible {
  border-color: rgba(199,68,53,.45);
  color: var(--lhai-coral);
  background: #fff8f7;
  outline: none;
}
.lhai-chip:active { transform: translateY(1px); }
.lhai-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.lhai-input {
  width: 100%;
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--lhai-line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: .92rem;
  color: var(--lhai-ink);
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
}
.lhai-input:focus {
  outline: none;
  border-color: var(--lhai-focus);
  box-shadow: 0 0 0 3px rgba(76,159,211,.2);
}
.lhai-send {
  appearance: none;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--lhai-coral);
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(199,68,53,.22);
  transition: background .18s, transform .18s;
}
.lhai-send:hover { background: var(--lhai-coral-deep); transform: translateY(-1px); }
.lhai-send:disabled { opacity: .55; cursor: wait; transform: none; }
.lhai-stop { background: var(--lhai-ink); box-shadow: none; }
.lhai-stop:hover { background: #0c2744; }
.lhai-hint {
  margin: 6px 0 0;
  color: var(--lhai-muted);
  font-size: .72rem;
}
.lhai-honey {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.lhai-out {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--lhai-line);
  min-height: 0;
  display: none;
}
.lhai-out.is-on { display: block; animation: lhai-fade .35s ease both; }
@keyframes lhai-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lhai-out-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--lhai-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.lhai-answer {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .92rem;
  line-height: 1.7;
  color: var(--lhai-ink);
}
.lhai-answer.is-typing::after {
  content: "▍";
  margin-left: 2px;
  animation: lhai-blink 1s steps(1) infinite;
  color: var(--lhai-coral);
}
@keyframes lhai-blink { 50% { opacity: 0; } }
.lhai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.lhai-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--lhai-line);
  background: #fff;
  color: var(--lhai-ink);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 750;
  cursor: pointer;
  transition: border-color .18s, color .18s;
}
.lhai-link.primary {
  border-color: transparent;
  background: var(--lhai-ink);
  color: #fff;
}
.lhai-link:hover { border-color: rgba(199,68,53,.4); color: var(--lhai-coral); }
.lhai-link.primary:hover { background: #0c2744; color: #fff; border-color: transparent; }
.lhai-foot {
  padding: 0 22px 16px;
  color: var(--lhai-muted);
  font-size: .72rem;
  line-height: 1.55;
}
.lhai-err {
  margin-top: 10px;
  color: #b91c1c;
  font-size: .84rem;
  display: none;
}
.lhai-err.is-on { display: block; }

.lhai-actions .lhai-link.primary { order: -1; }
.lhai-row { grid-template-columns: 1fr auto auto; }

@media (max-width: 720px) {
  .lhai-panel { width: calc(100% - 24px); border-radius: 14px; }
  .lhai-head, .lhai-body, .lhai-foot { padding-left: 16px; padding-right: 16px; }
  .lhai-row { grid-template-columns: 1fr; }
  .lhai-send, .lhai-stop { width: 100%; }
  .lhai-brand span { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lhai-panel, .lhai-out, .lhai-answer.is-typing::after { animation: none; }
}
