.ai-consult,
.ai-consult * { box-sizing: border-box; }

.ai-consult {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  color: #111b36;
  font-family: var(--font-sans, "Microsoft YaHei UI", sans-serif);
}

.ai-consult-toggle {
  min-height: 52px;
  padding: 0 17px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f8faff;
  border: 1px solid rgba(247,249,253,.35);
  border-radius: 4px;
  background: #234fff;
  box-shadow: 0 18px 44px rgba(35,79,255,.22);
  cursor: pointer;
  transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .3s ease, opacity .25s ease;
}
.ai-consult-toggle:hover { transform: translateY(-3px); box-shadow: 0 24px 54px rgba(35,79,255,.30); }
.ai-consult-toggle > span:first-child {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #234fff;
  border-radius: 3px;
  background: #f7f9fd;
  font: 750 9px/1 var(--font-mono, monospace);
  letter-spacing: -.04em;
}
.ai-consult-toggle strong { font-size: 12px; }
.ai-consult-toggle i { width: 6px; height: 6px; border-radius: 50%; background: #b9cbff; box-shadow: 0 0 0 4px rgba(185,203,255,.15); }

.ai-consult-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(390px,calc(100vw - 32px));
  height: min(610px,calc(100svh - 116px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(34,58,111,.16);
  border-radius: 5px;
  background: rgba(247,249,253,.97);
  box-shadow: 0 34px 90px rgba(36,55,98,.22), inset 0 1px rgba(247,249,253,.9);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.985);
  transform-origin: right bottom;
  transition: opacity .22s ease, transform .4s cubic-bezier(.16,1,.3,1), visibility .22s;
}
.ai-consult.is-open .ai-consult-panel { opacity: 1; visibility: visible; transform: none; }
.ai-consult.is-open .ai-consult-toggle { opacity: 0; pointer-events: none; }

.ai-consult-head {
  min-height: 82px;
  padding: 18px 18px 15px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: #f8faff;
  background: #173fdc;
}
.ai-consult-head span { display: block; color: #cbd8ff; font: 8px/1 var(--font-mono, monospace); letter-spacing: .14em; }
.ai-consult-head h2 { margin: 9px 0 0; color: #f8faff; font-size: 19px; line-height: 1; letter-spacing: -.03em; }
.ai-consult-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  color: #f8faff;
  border: 1px solid rgba(247,249,253,.24);
  border-radius: 3px;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.ai-consult-log { min-height: 0; padding: 19px 18px; overflow-y: auto; overscroll-behavior: contain; }
.ai-message { max-width: 88%; margin: 0 0 12px; padding: 12px 14px; color: #34415c; border: 1px solid rgba(34,58,111,.10); border-radius: 3px; background: #e9eef8; font-size: 12px; line-height: 1.65; }
.ai-message--user { margin-left: auto; color: #f8faff; border-color: #234fff; background: #234fff; }
.ai-message small { display: block; margin-top: 7px; color: #71809a; font-size: 9px; }
.ai-message--user small { color: #cbd7ff; }
.ai-consult-suggestions { padding: 0 18px 13px; display: flex; flex-wrap: wrap; gap: 7px; }
.ai-consult-suggestions button {
  min-height: 36px;
  padding: 0 11px;
  color: #41506a;
  border: 1px solid rgba(35,79,255,.18);
  border-radius: 3px;
  background: #f3f6fc;
  font-size: 10px;
  cursor: pointer;
}
.ai-consult-suggestions button:hover { color: #173fdc; border-color: rgba(35,79,255,.42); }
.ai-consult-form { padding: 13px 14px 14px; border-top: 1px solid rgba(34,58,111,.11); background: #edf2fa; }
.ai-consult-form label { display: block; margin: 0 0 8px; color: #66758e; font-size: 9px; }
.ai-consult-entry { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ai-consult-entry input {
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  color: #111b36;
  border: 1px solid rgba(34,58,111,.17);
  border-radius: 3px;
  background: #f8fafd;
  outline: 0;
}
.ai-consult-entry input:focus { border-color: #315cff; box-shadow: 0 0 0 3px rgba(49,92,255,.10); }
.ai-consult-entry button,
.ai-consult-book {
  min-height: 46px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f8faff;
  border: 1px solid #234fff;
  border-radius: 3px;
  background: #234fff;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}
.ai-consult-book { margin-top: 9px; text-decoration: none; }
.ai-consult-note { margin: 9px 0 0; color: #77859d; font-size: 8px; line-height: 1.5; }

@media (max-width: 560px) {
  .ai-consult { right: 14px; bottom: 14px; }
  .ai-consult-panel { position: fixed; right: 12px; left: 12px; bottom: 12px; width: auto; height: min(620px,calc(100svh - 24px)); }
}

@media (prefers-reduced-motion: reduce) {
  .ai-consult-toggle,
  .ai-consult-panel { transition: none; }
}
