@charset "utf-8";

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ai-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  font-family: "Bahnschrift", "Arial Narrow", "Microsoft YaHei", sans-serif;
}

.ai-assistant-toggle {
  display: flex;
  min-width: 190px;
  min-height: 62px;
  padding: 8px 18px 8px 9px;
  border: 1px solid rgba(80, 219, 215, 0.36);
  border-radius: 34px;
  background: #0a2029;
  box-shadow: 0 18px 42px rgba(7, 26, 34, 0.28);
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  gap: 11px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.ai-assistant-toggle:hover,
.ai-assistant-toggle:focus-visible {
  background: #113743;
  box-shadow: 0 22px 48px rgba(7, 26, 34, 0.34);
  color: #ffffff;
  transform: translateY(-2px);
}

.ai-assistant-toggle-icon {
  display: grid;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #20b8ba, #147d85);
  place-items: center;
}

.ai-assistant-toggle-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.ai-assistant-toggle-copy {
  display: block;
  text-align: left;
}

.ai-assistant-toggle-copy strong,
.ai-assistant-toggle-copy small {
  display: block;
}

.ai-assistant-toggle-copy strong {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ai-assistant-toggle-copy small {
  margin-top: 1px;
  color: #93abb3;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 10px;
}

.ai-assistant-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  display: grid;
  width: min(390px, calc(100vw - 30px));
  height: min(590px, calc(100vh - 118px));
  overflow: hidden;
  border: 1px solid #d7e1e3;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(8, 29, 38, 0.27);
  grid-template-rows: auto 1fr auto auto auto;
  transform-origin: right bottom;
  animation: ai-panel-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

@keyframes ai-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-assistant-header {
  display: flex;
  min-height: 78px;
  padding: 14px 15px 14px 17px;
  background:
    radial-gradient(circle at 85% 10%, rgba(57, 206, 204, 0.22), transparent 30%),
    #0a2029;
  color: #ffffff;
  align-items: center;
  justify-content: space-between;
}

.ai-assistant-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-assistant-mark {
  display: grid;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(108, 230, 226, 0.42);
  border-radius: 12px;
  background: rgba(34, 175, 181, 0.14);
  color: #70e4e1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  place-items: center;
}

.ai-assistant-identity strong,
.ai-assistant-identity small {
  display: block;
}

.ai-assistant-identity strong {
  font-size: 15px;
  letter-spacing: 0.025em;
}

.ai-assistant-identity small {
  margin-top: 3px;
  color: #9eb2b9;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 10px;
}

.ai-assistant-identity small span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  background: #57d6a0;
  box-shadow: 0 0 0 3px rgba(87, 214, 160, 0.13);
}

.ai-assistant-close {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: #c8d5d9;
  font: 300 24px/1 Arial, sans-serif;
  cursor: pointer;
  place-items: center;
}

.ai-assistant-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.ai-assistant-messages {
  padding: 20px 17px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(rgba(242, 247, 247, 0.86), rgba(255, 255, 255, 0.96)),
    repeating-linear-gradient(90deg, transparent 0, transparent 23px, rgba(20, 99, 105, 0.05) 24px);
  scroll-behavior: smooth;
}

.ai-message {
  display: flex;
  margin-bottom: 12px;
}

.ai-message > div {
  max-width: 87%;
  padding: 11px 13px;
  border-radius: 13px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-message-assistant > div {
  border: 1px solid #dce6e8;
  border-top-left-radius: 3px;
  background: #ffffff;
  color: #34464e;
  box-shadow: 0 7px 18px rgba(18, 48, 59, 0.06);
}

.ai-message-user {
  justify-content: flex-end;
}

.ai-message-user > div {
  border-top-right-radius: 3px;
  background: #147f86;
  color: #ffffff;
}

.ai-message.is-typing > div {
  color: #75878e;
  animation: ai-pulse 1.2s ease-in-out infinite;
}

@keyframes ai-pulse {
  50% { opacity: 0.55; }
}

.ai-product-results {
  display: grid;
  margin: 2px 0 14px;
  gap: 7px;
}

.ai-product-card {
  display: grid;
  min-height: 66px;
  padding: 8px 10px 8px 8px;
  border: 1px solid #d8e3e5;
  border-radius: 10px;
  background: #ffffff;
  color: #21343c;
  grid-template-columns: 52px 1fr 24px;
  align-items: center;
  gap: 10px;
}

.ai-product-card:hover {
  border-color: #50b9ba;
  box-shadow: 0 10px 22px rgba(14, 68, 76, 0.1);
  color: #146f76;
  transform: translateY(-1px);
}

.ai-product-card img {
  width: 52px;
  height: 48px;
  padding: 3px;
  border-radius: 7px;
  background: #edf3f4;
  object-fit: contain;
}

.ai-product-card strong,
.ai-product-card small {
  display: block;
}

.ai-product-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-product-card small {
  margin-top: 3px;
  color: #7b8a90;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 9px;
}

.ai-product-arrow {
  color: #16878d;
  font-size: 15px;
  text-align: center;
}

.ai-inline-actions {
  display: flex;
  margin: -2px 0 14px;
  gap: 7px;
  flex-wrap: wrap;
}

.ai-inline-actions a {
  padding: 7px 10px;
  border: 1px solid #bcd5d7;
  border-radius: 16px;
  background: #ffffff;
  color: #14757b;
  font-size: 10px;
  font-weight: 700;
}

.ai-assistant-quick-actions {
  display: flex;
  padding: 10px 12px 7px;
  overflow-x: auto;
  border-top: 1px solid #e3eaec;
  background: #ffffff;
  gap: 6px;
}

.ai-assistant-quick-actions button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d7e2e4;
  border-radius: 18px;
  background: #f4f8f8;
  color: #43565e;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
}

.ai-assistant-quick-actions button:hover {
  border-color: #4bb4b6;
  background: #eaf7f6;
  color: #126d73;
}

.ai-assistant-form {
  display: grid;
  padding: 8px 12px 10px;
  background: #ffffff;
  grid-template-columns: 1fr 42px;
  align-items: end;
  gap: 8px;
}

.ai-assistant-form textarea {
  min-height: 44px;
  max-height: 92px;
  margin: 0;
  padding: 11px 12px;
  resize: none;
  border-color: #d3dfe1;
  border-radius: 10px;
  background: #f8fafa;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  line-height: 1.45;
}

.ai-assistant-form button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #0f858b;
  color: #ffffff;
  cursor: pointer;
  place-items: center;
}

.ai-assistant-form button:hover {
  background: #0a6970;
}

.ai-assistant-form button:disabled,
.ai-assistant-form textarea:disabled {
  cursor: wait;
  opacity: 0.58;
}

.ai-assistant-form svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.ai-assistant-note {
  margin: 0;
  padding: 0 14px 10px;
  background: #ffffff;
  color: #8a979c;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 8px;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 600px) {
  .ai-assistant {
    right: 12px;
    bottom: 12px;
  }

  .ai-assistant-toggle {
    min-width: 0;
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 7px;
  }

  .ai-assistant-toggle-icon {
    width: 42px;
    height: 42px;
  }

  .ai-assistant-toggle-copy {
    display: none;
  }

  .ai-assistant-panel {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 80px;
    left: 12px;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-assistant-panel {
    animation: none;
  }
}

