/* Minimal assistant loading indicator: Chinese "thinking" text plus soft animated dots. */
span.inline-block.w-3\.5.h-3\.5.ml-0\.5.align-middle.rounded-full.animate-breathe,
span[class*="w-3.5"][class*="h-3.5"][class*="animate-breathe"] {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: auto !important;
  min-width: 102px !important;
  height: 24px !important;
  margin-left: 2px !important;
  border-radius: 0 !important;
  vertical-align: middle !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  animation: none !important;
  color: transparent !important;
}

span.inline-block.w-3\.5.h-3\.5.ml-0\.5.align-middle.rounded-full.animate-breathe::before,
span[class*="w-3.5"][class*="h-3.5"][class*="animate-breathe"]::before {
  content: "\6B63\5728\601D\8003";
  display: inline-block;
  font-size: 15px;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(245, 247, 250, .92);
  animation: vfx-thinking-text 1.8s ease-in-out infinite;
}

span.inline-block.w-3\.5.h-3\.5.ml-0\.5.align-middle.rounded-full.animate-breathe::after,
span[class*="w-3.5"][class*="h-3.5"][class*="animate-breathe"]::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(245, 247, 250, .38);
  box-shadow:
    12px 0 0 rgba(245, 247, 250, .38),
    24px 0 0 rgba(245, 247, 250, .38);
  animation: vfx-thinking-dots 1.08s ease-in-out infinite;
}

@keyframes vfx-thinking-text {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}

@keyframes vfx-thinking-dots {
  0% {
    background: rgba(245, 247, 250, .32);
    box-shadow:
      12px 0 0 rgba(245, 247, 250, .32),
      24px 0 0 rgba(245, 247, 250, .32);
  }
  28% {
    background: rgba(245, 247, 250, .95);
    box-shadow:
      12px 0 0 rgba(245, 247, 250, .34),
      24px 0 0 rgba(245, 247, 250, .32);
  }
  56% {
    background: rgba(245, 247, 250, .38);
    box-shadow:
      12px 0 0 rgba(245, 247, 250, .95),
      24px 0 0 rgba(245, 247, 250, .34);
  }
  84%, 100% {
    background: rgba(245, 247, 250, .34);
    box-shadow:
      12px 0 0 rgba(245, 247, 250, .38),
      24px 0 0 rgba(245, 247, 250, .95);
  }
}

/* Official web search source chip inside assistant messages only. */
.vfx-source-chip {
  display: inline-flex !important;
  width: fit-content !important;
  min-height: 30px !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 5px 11px !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .72) !important;
  color: rgba(31, 41, 55, .82) !important;
  font-size: 13px !important;
  line-height: 18px !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

.dark .vfx-source-chip {
  border-color: rgba(255, 255, 255, .12) !important;
  background: rgba(255, 255, 255, .08) !important;
  color: rgba(243, 244, 246, .86) !important;
  box-shadow: none !important;
}

.vfx-source-chip svg {
  opacity: .78 !important;
}

.vfx-source-chip .rotate-icon {
  color: rgba(59, 130, 246, .92) !important;
}

.vfx-source-chip .glow-band {
  display: none !important;
}

.vfx-source-chip .rotate-icon {
  animation-duration: 1.25s !important;
}

.vfx-source-chip:has(.rotate-icon) {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .72), rgba(248, 250, 252, .92), rgba(255, 255, 255, .72)) !important;
  background-size: 220% 100% !important;
  animation: vfx-source-status-sheen 1.8s ease-in-out infinite !important;
}

.dark .vfx-source-chip:has(.rotate-icon),
html.dark .vfx-source-chip:has(.rotate-icon),
html[data-theme="dark"] .vfx-source-chip:has(.rotate-icon) {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .14), rgba(255, 255, 255, .08)) !important;
  background-size: 220% 100% !important;
}

@keyframes vfx-source-status-sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Make the assistant model label clearer on dark chat backgrounds. */
#app .tooltip.tooltip-top {
  color: rgba(226, 232, 240, .96) !important;
  font-size: 13px !important;
  line-height: 18px !important;
  font-weight: 600 !important;
  letter-spacing: .01em !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35) !important;
}

html:not(.dark) #app .tooltip.tooltip-top,
html[data-theme="light"] #app .tooltip.tooltip-top {
  color: rgba(51, 65, 85, .88) !important;
  text-shadow: none !important;
}

.vfx-source-list {
  margin-top: 8px !important;
  padding-left: 0 !important;
  border-left: 0 !important;
}

.vfx-source-list-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  font-size: 12px !important;
  line-height: 18px !important;
}

.vfx-source-list-inner a {
  display: inline-flex !important;
  align-items: center !important;
  max-width: min(270px, 82vw) !important;
  min-height: 28px !important;
  padding: 5px 10px !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .7) !important;
  color: rgba(31, 41, 55, .82) !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

.dark .vfx-source-list-inner a {
  border-color: rgba(255, 255, 255, .12) !important;
  background: rgba(255, 255, 255, .08) !important;
  color: rgba(243, 244, 246, .82) !important;
}

.vfx-source-list-inner a::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: rgba(148, 163, 184, .9);
}

.vfx-source-list-inner a:hover {
  border-color: rgba(59, 130, 246, .42) !important;
  color: rgba(37, 99, 235, .95) !important;
}

.dark .vfx-source-list-inner a:hover {
  color: rgba(147, 197, 253, .95) !important;
}

/* Inline citation pills inside assistant markdown answers. */
.markdown-body a.vfx-inline-source-pill[href^="http"] {
  position: relative !important;
  display: inline-grid !important;
  grid-template-columns: 13px minmax(0, 1fr) !important;
  align-items: center !important;
  max-width: min(260px, 52vw) !important;
  min-height: 24px !important;
  margin: 0 2px !important;
  padding: 2px 8px 2px 7px !important;
  border: 1px solid rgba(15, 23, 42, .08) !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, .055) !important;
  color: rgba(31, 41, 55, .84) !important;
  font-size: .88em !important;
  font-weight: 500 !important;
  line-height: 18px !important;
  text-decoration: none !important;
  vertical-align: baseline !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .38) !important;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease !important;
}

.markdown-body a.vfx-inline-source-pill[href^="http"] {
  text-overflow: ellipsis !important;
}

.markdown-body a.vfx-inline-source-pill[href^="http"]::before {
  content: "";
  width: 13px;
  height: 13px;
  margin-right: 5px;
  border-radius: 999px;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 50% 50%, transparent 34%, rgba(100, 116, 139, .9) 36%, rgba(100, 116, 139, .9) 42%, transparent 44%),
    linear-gradient(90deg, transparent 45%, rgba(100, 116, 139, .9) 46%, rgba(100, 116, 139, .9) 54%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(100, 116, 139, .9) 46%, rgba(100, 116, 139, .9) 54%, transparent 55%);
  opacity: .72;
}

.markdown-body a.vfx-inline-source-pill[href^="http"]:hover {
  z-index: 30 !important;
  border-color: rgba(15, 23, 42, .14) !important;
  background: rgba(15, 23, 42, .085) !important;
  color: rgba(17, 24, 39, .96) !important;
  transform: translateY(-1px) !important;
  overflow: visible !important;
}

.markdown-body a.vfx-inline-source-pill[href^="http"]::after {
  content: attr(data-source-title) "\A" attr(data-source-host) "\A" attr(data-source-hint);
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 90;
  display: block;
  width: 260px;
  max-width: min(320px, 78vw);
  padding: 13px 14px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: rgba(17, 18, 20, .96);
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  white-space: pre-line;
  text-align: left;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .34), 0 4px 14px rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(.98);
  transform-origin: left bottom;
  transition: opacity .14s ease, transform .14s ease;
}

.markdown-body a.vfx-inline-source-pill[href^="http"]:hover::after {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dark .markdown-body a.vfx-inline-source-pill[href^="http"],
html.dark .markdown-body a.vfx-inline-source-pill[href^="http"],
html[data-theme="dark"] .markdown-body a.vfx-inline-source-pill[href^="http"] {
  border-color: rgba(255, 255, 255, .1) !important;
  background: rgba(255, 255, 255, .09) !important;
  color: rgba(243, 244, 246, .88) !important;
  box-shadow: none !important;
}

.dark .markdown-body a.vfx-inline-source-pill[href^="http"]:hover,
html.dark .markdown-body a.vfx-inline-source-pill[href^="http"]:hover,
html[data-theme="dark"] .markdown-body a.vfx-inline-source-pill[href^="http"]:hover {
  border-color: rgba(255, 255, 255, .18) !important;
  background: rgba(255, 255, 255, .13) !important;
  color: rgba(255, 255, 255, .96) !important;
}

@media (max-width: 640px) {
  .markdown-body a.vfx-inline-source-pill[href^="http"] {
    max-width: min(210px, 68vw) !important;
  }

  .markdown-body a.vfx-inline-source-pill[href^="http"]::after {
    left: 50%;
    max-width: min(320px, 86vw);
    transform: translate(-50%, 4px) scale(.98);
    transform-origin: center bottom;
  }

  .markdown-body a.vfx-inline-source-pill[href^="http"]:hover::after {
    transform: translate(-50%, 0) scale(1);
  }
}

/* Top chat model selector */
#app .menu.relative > .cursor-pointer > .menu-trigger {
  color: rgba(248, 250, 252, .96) !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
}

#app .menu.relative > .cursor-pointer > .menu-trigger > span.truncate {
  color: rgba(248, 250, 252, .96) !important;
  font-size: 15px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .28) !important;
}

html:not(.dark) #app .menu.relative > .cursor-pointer > .menu-trigger,
html:not(.dark) #app .menu.relative > .cursor-pointer > .menu-trigger > span.truncate,
html[data-theme="light"] #app .menu.relative > .cursor-pointer > .menu-trigger,
html[data-theme="light"] #app .menu.relative > .cursor-pointer > .menu-trigger > span.truncate {
  color: rgba(17, 24, 39, .92) !important;
  text-shadow: none !important;
}

/* Chat input placeholder: subtle slow shimmer while empty */
#app textarea[aria-label="聊天消息输入框"]::placeholder {
  color: rgba(226, 232, 240, .78) !important;
  opacity: 1 !important;
  text-shadow:
    0 0 0 rgba(255, 255, 255, 0),
    0 0 14px rgba(125, 211, 252, .04) !important;
  animation: vfx-input-placeholder-shimmer 7.5s ease-in-out infinite !important;
}

html:not(.dark) #app textarea[aria-label="聊天消息输入框"]::placeholder,
html[data-theme="light"] #app textarea[aria-label="聊天消息输入框"]::placeholder {
  color: rgba(75, 85, 99, .72) !important;
  text-shadow: 0 0 12px rgba(14, 165, 233, .05) !important;
}

@keyframes vfx-input-placeholder-shimmer {
  0%, 100% {
    color: rgba(226, 232, 240, .70);
    text-shadow:
      0 0 0 rgba(255, 255, 255, 0),
      0 0 12px rgba(125, 211, 252, .03);
  }

  34% {
    color: rgba(241, 245, 249, .88);
    text-shadow:
      0 0 1px rgba(255, 255, 255, .08),
      0 0 16px rgba(147, 197, 253, .10);
  }

  68% {
    color: rgba(221, 214, 254, .82);
    text-shadow:
      0 0 1px rgba(255, 255, 255, .06),
      0 0 15px rgba(196, 181, 253, .08);
  }
}
