.ns-root {
  --ns-ink: #f3f7ff;
  --ns-ink-soft: #aebbd1;
  --ns-ink-faint: #718098;
  --ns-paper: #050912;
  --ns-white: #0c111d;
  --ns-night: #071225;
  --ns-night-deep: #030711;
  --ns-blue: #2172ff;
  --ns-cyan: #6de4ff;
  --ns-line: rgba(122, 157, 219, 0.14);
  --ns-shadow: 0 34px 90px rgba(0, 10, 36, 0.55), 0 4px 18px rgba(0, 8, 30, 0.34);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
}

.ns-root *,
.ns-root *::before,
.ns-root *::after {
  box-sizing: border-box;
}

.ns-root button,
.ns-root textarea,
.ns-root input {
  font: inherit;
}

.ns-root svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ns-launcher {
  position: fixed;
  z-index: 50;
  right: 28px;
  bottom: 27px;
  display: flex;
  height: 58px;
  align-items: center;
  gap: 11px;
  padding: 0 19px 0 11px;
  border: 1px solid rgba(130, 195, 255, 0.42);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(110deg, #0d4bd1, #1678ff 55%, #219fe9);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.26),
    0 13px 38px rgba(18, 93, 230, 0.36);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.ns-launcher:hover {
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.3),
    0 17px 42px rgba(18, 93, 230, 0.44);
  transform: translateY(-2px);
}

.ns-launcher.ns-launcher--hidden {
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
}

.ns-launcher-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #c5f5ff;
  background: rgba(3, 24, 66, 0.32);
}

.ns-launcher-icon svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.7;
}

.ns-launcher-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.ns-launcher-copy strong {
  font-size: 12px;
}

.ns-launcher-copy small {
  color: rgba(245, 251, 255, 0.65);
  font-size: 8px;
}

.ns-launcher-dot {
  width: 6px;
  height: 6px;
  margin-left: 4px;
  border-radius: 50%;
  background: #a7f7d0;
  box-shadow: 0 0 0 4px rgba(156, 255, 211, 0.12), 0 0 10px rgba(156, 255, 211, 0.7);
}

.ns-panel {
  position: fixed;
  z-index: 51;
  right: 27px;
  bottom: 98px;
  display: flex;
  width: min(392px, calc(100vw - 32px));
  height: min(668px, calc(100dvh - 124px));
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(119, 166, 245, 0.22);
  border-radius: 24px;
  color: var(--ns-ink);
  background: var(--ns-paper);
  box-shadow: var(--ns-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 210ms ease, transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ns-panel.ns-panel--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ns-header {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  padding: 18px 17px;
  border-bottom: 1px solid rgba(118, 164, 239, 0.12);
  color: #f4f9ff;
  background:
    radial-gradient(circle at 84% -20%, rgba(72, 172, 255, 0.3), transparent 54%),
    linear-gradient(110deg, #071022, #081a38);
}

.ns-header::after {
  position: absolute;
  top: -82px;
  right: -58px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(121, 190, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(121, 190, 255, 0.018);
  content: "";
}

.ns-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(101, 185, 255, 0.28);
  border-radius: 13px;
  color: #7de7ff;
  background: linear-gradient(145deg, #195ecb, #08204d);
  box-shadow: 0 7px 22px rgba(26, 105, 255, 0.22);
}

.ns-avatar svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.6;
}

.ns-heading {
  display: grid;
  gap: 4px;
}

.ns-heading strong {
  font-size: 13px;
  letter-spacing: 0.01em;
}

.ns-heading span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #72829a;
  font-size: 8px;
}

.ns-heading i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5df4b1;
  box-shadow: 0 0 0 4px rgba(93, 244, 177, 0.07), 0 0 9px rgba(93, 244, 177, 0.55);
}

.ns-close {
  position: relative;
  z-index: 1;
  display: grid;
  width: 32px;
  height: 32px;
  margin-left: auto;
  place-items: center;
  border: 1px solid rgba(135, 177, 245, 0.15);
  border-radius: 10px;
  color: #8fa0b9;
  background: rgba(15, 28, 51, 0.56);
  cursor: pointer;
}

.ns-close:hover {
  color: #fff;
  background: rgba(26, 52, 92, 0.72);
}

.ns-close svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}

.ns-messages {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 4px;
  background:
    linear-gradient(rgba(5, 9, 18, 0.95), rgba(5, 9, 18, 0.95)),
    repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(98, 137, 204, 0.055) 24px);
  scrollbar-color: rgba(88, 131, 207, 0.25) transparent;
  scrollbar-width: thin;
}

.ns-messages::-webkit-scrollbar {
  width: 6px;
}

.ns-messages::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(88, 131, 207, 0.2);
}

.ns-welcome {
  padding: 16px;
  border: 1px solid var(--ns-line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(39, 120, 255, 0.11), transparent 48%),
    #090e19;
}

.ns-welcome-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: #69dfff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ns-welcome-kicker i {
  width: 5px;
  height: 5px;
  border: 1px solid #58c8ff;
  border-radius: 50%;
  background: #2576ff;
  box-shadow: 0 0 9px #48a7ff;
}

.ns-welcome h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.ns-welcome > p {
  margin: 8px 0 0;
  color: #7f8ca2;
  font-size: 10px;
  line-height: 1.7;
}

.ns-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 14px;
}

.ns-quick {
  display: grid;
  gap: 5px;
  min-height: 65px;
  padding: 10px;
  border: 1px solid rgba(124, 159, 220, 0.14);
  border-radius: 10px;
  color: #eaf2ff;
  background: rgba(12, 19, 33, 0.88);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.ns-quick:hover {
  border-color: rgba(76, 162, 255, 0.38);
  background: rgba(18, 43, 80, 0.68);
  transform: translateY(-1px);
}

.ns-quick span {
  color: #65dfff;
  font-size: 12px;
  line-height: 1;
}

.ns-quick strong {
  font-size: 9px;
  line-height: 1.35;
}

.ns-quick small {
  color: #64728a;
  font-size: 7px;
}

.ns-conversation {
  display: grid;
  gap: 11px;
}

.ns-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.ns-row--user {
  justify-content: flex-end;
}

.ns-mini-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(91, 168, 255, 0.24);
  border-radius: 8px;
  color: #7de6ff;
  background: #0a2450;
}

.ns-mini-avatar svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.7;
}

.ns-bubble-wrap {
  display: grid;
  max-width: calc(100% - 35px);
  gap: 6px;
}

.ns-row--user .ns-bubble-wrap {
  max-width: 84%;
  justify-items: end;
}

.ns-bubble {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 13px;
  font-size: 10px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ns-message-text {
  white-space: pre-wrap;
}

.ns-message-meta {
  color: #536279;
  font-size: 6px;
}

.ns-row--user .ns-message-meta {
  text-align: right;
}

.ns-message-image {
  display: block;
  max-width: 245px;
  overflow: hidden;
  border: 1px solid rgba(126, 172, 240, 0.18);
  border-radius: 8px;
  background: #070c15;
}

.ns-message-image img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.ns-system-message {
  width: fit-content;
  max-width: 85%;
  margin: 4px auto 10px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #697991;
  background: rgba(17, 29, 49, 0.78);
  font-size: 7px;
  line-height: 1.55;
  text-align: center;
}

.ns-bubble--assistant {
  border: 1px solid rgba(121, 157, 219, 0.14);
  border-bottom-left-radius: 4px;
  color: #b9c5d8;
  background: #0b111d;
}

.ns-bubble--user {
  border: 1px solid rgba(126, 192, 255, 0.25);
  border-bottom-right-radius: 4px;
  color: #fff;
  background: linear-gradient(115deg, #1251c4, #1475ee);
  box-shadow: 0 8px 22px rgba(18, 92, 220, 0.18);
}

.ns-bubble--error {
  border-color: rgba(255, 118, 100, 0.24);
  color: #ffc7c0;
  background: #241114;
}

.ns-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ns-source {
  max-width: 185px;
  overflow: hidden;
  padding: 4px 6px;
  border: 1px solid rgba(110, 152, 222, 0.14);
  border-radius: 5px;
  color: #697991;
  background: rgba(8, 13, 23, 0.86);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ns-source b {
  margin-right: 4px;
  color: #59cfff;
  font-weight: 700;
}

.ns-handoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(70, 162, 255, 0.2);
  border-radius: 9px;
  color: #8d9bb0;
  background: rgba(25, 93, 190, 0.1);
  font-size: 8px;
}

.ns-handoff button {
  flex: none;
  padding: 6px 9px;
  border: 1px solid rgba(84, 178, 255, 0.32);
  border-radius: 6px;
  color: #85dfff;
  background: rgba(16, 71, 151, 0.22);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.ns-handoff button:disabled {
  cursor: default;
  opacity: 0.6;
}

.ns-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 46px;
  min-height: 36px;
}

.ns-typing i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #7294bf;
  animation: ns-pulse 1.1s infinite ease-in-out;
}

.ns-typing i:nth-child(2) { animation-delay: 120ms; }
.ns-typing i:nth-child(3) { animation-delay: 240ms; }

@keyframes ns-pulse {
  0%,
  70%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.ns-end-note {
  margin: 13px 0 7px;
  color: #5c6a80;
  font-size: 7px;
  text-align: center;
}

.ns-composer {
  flex: none;
  padding: 10px 12px 11px;
  border-top: 1px solid rgba(113, 151, 217, 0.12);
  background: #060a12;
}

.ns-input-shell {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 7px 7px 13px;
  border: 1px solid rgba(120, 157, 220, 0.18);
  border-radius: 12px;
  background: #0a0f1a;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ns-attach {
  display: grid;
  width: 31px;
  height: 31px;
  flex: none;
  margin-bottom: 1px;
  place-items: center;
  border: 1px solid rgba(106, 151, 222, 0.14);
  border-radius: 8px;
  color: #7394b9;
  background: rgba(22, 44, 74, 0.32);
  cursor: pointer;
}

.ns-attach:hover {
  color: #9ce7ff;
  border-color: rgba(82, 169, 255, 0.36);
}

.ns-attach svg {
  width: 16px;
  height: 16px;
}

.ns-input-shell:focus-within {
  border-color: rgba(79, 163, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(42, 127, 245, 0.1);
}

.ns-input {
  width: auto;
  max-height: 90px;
  min-height: 32px;
  flex: 1;
  resize: none;
  overflow-y: auto;
  padding: 7px 0 4px;
  border: 0;
  outline: 0;
  color: #dfeafb;
  background: transparent;
  font-size: 10px;
  line-height: 1.5;
}

.ns-file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 7px;
  padding: 6px 8px;
  border: 1px solid rgba(80, 157, 255, 0.2);
  border-radius: 8px;
  background: rgba(20, 57, 111, 0.22);
}

.ns-file-preview[hidden] {
  display: none;
}

.ns-file-preview > span {
  display: grid;
  width: 27px;
  height: 27px;
  flex: none;
  place-items: center;
  border-radius: 6px;
  color: #83d9ff;
  background: rgba(32, 109, 216, 0.2);
  font-size: 7px;
  font-weight: 800;
}

.ns-file-preview div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.ns-file-preview strong {
  max-width: 235px;
  overflow: hidden;
  color: #a9bad0;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ns-file-preview small {
  color: #5c6c83;
  font-size: 6px;
}

.ns-file-clear {
  border: 0;
  color: #66768d;
  background: transparent;
  cursor: pointer;
}

.ns-input::placeholder {
  color: #58657a;
}

.ns-send {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(134, 197, 255, 0.4);
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, #1558d8, #168ff0);
  cursor: pointer;
  transition: opacity 150ms ease, transform 150ms ease;
}

.ns-send:hover:not(:disabled) {
  transform: translateY(-1px);
}

.ns-send:disabled {
  cursor: default;
  opacity: 0.38;
}

.ns-send svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.7;
}

.ns-disclaimer {
  margin: 7px 2px 0;
  color: #536176;
  font-size: 7px;
  line-height: 1.45;
  text-align: center;
}

.ns-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

body.ns-embedded {
  margin: 0;
  overflow: hidden;
  background: transparent;
}

body.ns-embedded .ns-root,
body.ns-embedded #support-root {
  width: 100%;
  height: 100%;
}

body.ns-embedded .ns-launcher {
  display: none;
}

body.ns-embedded .ns-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 24px;
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@media (max-width: 560px) {
  .ns-launcher {
    right: 16px;
    bottom: 16px;
  }

  .ns-launcher-copy small {
    display: none;
  }

  .ns-panel {
    right: 10px;
    bottom: 88px;
    width: calc(100vw - 20px);
    height: min(690px, calc(100dvh - 104px));
    border-radius: 22px;
  }
}

@media (max-height: 630px) and (min-width: 561px) {
  .ns-panel {
    bottom: 88px;
    height: calc(100dvh - 108px);
  }

  .ns-welcome {
    padding: 12px;
  }

  .ns-quick {
    min-height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ns-panel,
  .ns-launcher {
    transition: none;
  }
}
