@charset "UTF-8";
/**
 * YH-UI Sass Variables
 * 原具体的 CSS 变量输出规则 (:root, html.dark 等) 已移至 root.scss，以防止各组件样式编译时产生重复的全局变量 CSS 冗余。
 */
.yh-ai-bubble {
  --yh-ai-bubble-user-bg: var(--yh-color-primary);
  --yh-ai-bubble-user-color: var(--yh-color-white);
  --yh-ai-bubble-assistant-bg: var(--yh-fill-color-light);
  --yh-ai-bubble-assistant-color: var(--yh-text-color-primary);
  --yh-ai-bubble-border-radius: 12px;
  display: flex;
  margin-bottom: var(--yh-spacing-lg);
  gap: var(--yh-spacing-md);
  animation: yh-fade-in-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  /* Placement */
}
.yh-ai-bubble--placement-start {
  flex-direction: row;
}
.yh-ai-bubble--placement-start .yh-ai-bubble__content-wrapper {
  align-items: flex-start;
}

.yh-ai-bubble--placement-end {
  flex-direction: row-reverse;
}
.yh-ai-bubble--placement-end .yh-ai-bubble__content-wrapper {
  align-items: flex-end;
}

.yh-ai-bubble__avatar {
  flex-shrink: 0;
}

.yh-ai-bubble__content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 85%;
}

.yh-ai-bubble__header {
  font-size: 12px;
  color: var(--yh-text-color-placeholder);
  display: flex;
  align-items: center;
  gap: 8px;
}

.yh-ai-bubble__time {
  opacity: 0.8;
}

.yh-ai-bubble__body {
  line-height: 1.6;
  word-break: break-word;
  border-radius: var(--yh-ai-bubble-border-radius);
  transition: all 0.3s;
  overflow: hidden;
  padding: 12px 16px;
  position: relative;
  border: 1px solid transparent;
}
.yh-ai-bubble__body.is-typing .yh-ai-bubble__text:not(.yh-ai-bubble__markdown) {
  position: relative;
  display: inline-block;
}
.yh-ai-bubble__body.is-typing .yh-ai-bubble__text:not(.yh-ai-bubble__markdown)::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: var(--yh-color-primary);
  margin-left: 4px;
  vertical-align: -2px;
  animation: yh-cursor-blink 1s infinite;
}

.yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > p:last-child, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > li:last-child, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h1:last-child, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h2:last-child, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h3:last-child, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h4:last-child, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h5:last-child, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h6:last-child {
  position: relative;
  display: inline-block;
}
.yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > p:last-child::after, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > li:last-child::after, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h1:last-child::after, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h2:last-child::after, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h3:last-child::after, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h4:last-child::after, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h5:last-child::after, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > h6:last-child::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: var(--yh-color-primary);
  margin-left: 4px;
  vertical-align: -2px;
  animation: yh-cursor-blink 1s infinite;
}
.yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown ul:last-child > li:last-child, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown ol:last-child > li:last-child {
  position: relative;
  display: inline-block;
}
.yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown ul:last-child > li:last-child::after, .yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown ol:last-child > li:last-child::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: var(--yh-color-primary);
  margin-left: 4px;
  vertical-align: -2px;
  animation: yh-cursor-blink 1s infinite;
}
.yh-ai-bubble__body.is-typing::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(var(--yh-color-primary-rgb), 0.05), transparent);
  background-size: 200% 100%;
  animation: yh-ripple-light 2s infinite linear;
  pointer-events: none;
  z-index: 5;
  border-radius: inherit;
}

.yh-ai-bubble__body {
  /* Theme-specific adjustments for quality */
}
html.dark .yh-ai-bubble__body {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.yh-ai-bubble {
  /* Shape Modifiers */
}
.yh-ai-bubble--shape-corner.yh-ai-bubble--placement-start .yh-ai-bubble__body {
  border-top-left-radius: 2px;
}

.yh-ai-bubble--shape-corner.yh-ai-bubble--placement-end .yh-ai-bubble__body {
  border-top-right-radius: 2px;
}

.yh-ai-bubble--shape-round .yh-ai-bubble__body {
  border-radius: 24px;
  padding: 12px 20px;
}

.yh-ai-bubble {
  /* Variant Modifiers */
}
.yh-ai-bubble--variant-filled.yh-ai-bubble--user .yh-ai-bubble__body {
  background-color: var(--yh-ai-bubble-user-bg);
  color: var(--yh-ai-bubble-user-color);
}

.yh-ai-bubble--variant-filled.yh-ai-bubble--assistant .yh-ai-bubble__body {
  background-color: var(--yh-ai-bubble-assistant-bg);
  color: var(--yh-ai-bubble-assistant-color);
  border-color: var(--yh-border-color-extra-light);
}

.yh-ai-bubble--variant-outlined .yh-ai-bubble__body {
  background-color: transparent;
  border: 1px solid var(--yh-border-color);
  color: var(--yh-text-color-primary);
}

.yh-ai-bubble--variant-outlined.yh-ai-bubble--user .yh-ai-bubble__body {
  border-color: var(--yh-color-primary);
}

.yh-ai-bubble--variant-shadow .yh-ai-bubble__body {
  background-color: var(--yh-bg-color-overlay);
  color: var(--yh-text-color-primary);
  box-shadow: var(--yh-shadow-md);
}

.yh-ai-bubble__text {
  white-space: pre-wrap;
}

.yh-ai-bubble__markdown {
  white-space: normal;
}
.yh-ai-bubble__markdown p {
  margin: 0 0 8px 0;
}
.yh-ai-bubble__markdown p:last-child {
  margin-bottom: 0;
}
.yh-ai-bubble__markdown p:last-child {
  margin-bottom: 0;
}
.yh-ai-bubble__markdown {
  /* 学术脚注气泡角标样式 */
}
.yh-ai-bubble__markdown .yh-ai-citation {
  color: var(--yh-color-primary);
  background-color: var(--yh-color-primary-light-9);
  border: 1px solid var(--yh-color-primary-light-5);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  padding: 0 4px;
  margin: 0 2px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--yh-transition-duration-fast) ease;
  vertical-align: super;
}
.yh-ai-bubble__markdown .yh-ai-citation:hover {
  background-color: var(--yh-color-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(var(--yh-color-primary-rgb), 0.3);
}
.yh-ai-bubble__markdown pre {
  background: #282c34;
  color: #abb2bf;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
}
.yh-ai-bubble__markdown code {
  background: rgba(127, 127, 127, 0.15);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.9em;
}

.yh-ai-bubble {
  /* Code Output - 流式输出样式 */
}
.yh-ai-bubble .code-output {
  background: #1e1e1e;
  border-top: 1px solid #3e3e3e;
  padding: 12px;
  border-radius: 0 0 8px 8px;
  margin-top: -8px;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #d4d4d4;
  max-height: 300px;
  overflow-y: auto;
}
.yh-ai-bubble .code-output pre {
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  white-space: pre-wrap;
  word-break: break-all;
}
.yh-ai-bubble .code-output .output-prefix {
  color: #569cd6;
  display: block;
  margin-bottom: 4px;
}
.yh-ai-bubble .code-output .output-return {
  color: #c586c0;
  display: block;
  margin-top: 8px;
  font-style: italic;
}
.yh-ai-bubble .code-output .output-success {
  color: #4ec9b0;
  display: block;
  margin-top: 8px;
}
.yh-ai-bubble .code-output .output-error {
  color: #f14c4c;
  display: block;
  margin-top: 8px;
}
.yh-ai-bubble .code-output .output-warning {
  color: #cca700;
  display: block;
}
.yh-ai-bubble {
  /* Multimodal: Image Grid */
}
.yh-ai-bubble__image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

.yh-ai-bubble__image-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--yh-border-color-lighter);
}
.yh-ai-bubble__image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
  cursor: zoom-in;
}
.yh-ai-bubble__image-item img:hover {
  transform: scale(1.05);
}

.yh-ai-bubble {
  /* Multimodal: Assets (Audio, Files) */
}
.yh-ai-bubble__multimodal-assets {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yh-ai-bubble__audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 20px;
  width: fit-content;
  min-width: 200px;
  border: 1px solid var(--yh-border-color-extra-light);
}
html.dark .yh-ai-bubble__audio-player {
  background: rgba(255, 255, 255, 0.05);
}

.yh-ai-bubble__audio-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 16px;
  flex: 1;
}
.yh-ai-bubble__audio-waveform span {
  width: 2px;
  height: 60%;
  background: currentColor;
  border-radius: 1px;
  opacity: 0.4;
  animation: yh-waveform 1.2s ease-in-out infinite;
  animation-play-state: paused;
  animation-delay: var(--delay);
}
.is-active .yh-ai-bubble__audio-waveform span {
  animation-play-state: running;
  opacity: 0.8;
}

.yh-ai-bubble__audio-duration {
  font-size: 12px;
  opacity: 0.7;
  font-family: var(--yh-font-family-mono);
}

.yh-ai-bubble__file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--yh-bg-color-overlay);
  border: 1px solid var(--yh-border-color-lighter);
  border-radius: 10px;
  transition: all 0.2s;
}
.yh-ai-bubble__file-card:hover {
  border-color: var(--yh-color-primary);
  box-shadow: var(--yh-shadow-sm);
}

.yh-ai-bubble__file-icon {
  width: 36px;
  height: 36px;
  background: var(--yh-fill-color-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yh-color-primary);
  font-size: 20px;
}

.yh-ai-bubble__file-info {
  flex: 1;
  min-width: 0;
}

.yh-ai-bubble__file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--yh-text-color-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yh-ai-bubble__file-meta {
  font-size: 11px;
  color: var(--yh-text-color-placeholder);
  margin-top: 2px;
}

.yh-ai-bubble {
  /* Citations Section - Correctly placed */
}
.yh-ai-bubble__citations {
  margin-top: var(--yh-spacing-md);
  padding-top: var(--yh-spacing-sm);
  border-top: 1px solid var(--yh-border-color-lighter);
  display: flex;
  flex-direction: column;
  gap: var(--yh-spacing-xs);
}

.yh-ai-bubble__citations-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--yh-text-color-secondary);
  font-weight: 500;
}

.yh-ai-bubble__citations-count {
  background: var(--yh-fill-color-light);
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 4px;
}

.yh-ai-bubble__citations-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yh-ai-bubble__citation-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  background: var(--yh-bg-color-overlay);
  border: 1px solid var(--yh-border-color-lighter);
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  color: var(--yh-text-color-primary);
  max-width: 220px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.yh-ai-bubble__citation-item:hover {
  background: var(--yh-fill-color-light);
  border-color: var(--yh-color-primary-light-5);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.yh-ai-bubble__citation-item:hover .yh-ai-bubble__citation-index {
  background: var(--yh-color-primary);
  color: white;
}

.yh-ai-bubble__citation-index {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  background: var(--yh-fill-color-dark);
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  color: var(--yh-text-color-secondary);
}

.yh-ai-bubble__citation-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
}

.yh-ai-bubble__typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.yh-ai-bubble__typing-indicator span {
  width: 4px;
  height: 4px;
  background-color: currentColor;
  border-radius: 50%;
  animation: yh-typing-bounce 1.4s infinite ease-in-out both;
}
.yh-ai-bubble__typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}
.yh-ai-bubble__typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

.yh-ai-bubble__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
}

@keyframes yh-typing-bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes yh-waveform {
  0%, 100% {
    height: 40%;
  }
  50% {
    height: 100%;
  }
}
@keyframes yh-fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes yh-cursor-blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
@keyframes yh-ripple-light {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
/* 引用专属独立悬浮卡片 (Teleported 到 Body) */
.yh-ai-bubble__citation-tooltip-wrapper {
  position: fixed;
  padding-bottom: 10px;
  z-index: 9999;
  pointer-events: auto;
}
.yh-ai-bubble__citation-tooltip-wrapper .yh-ai-bubble__citation-tooltip {
  min-width: 260px;
  max-width: 380px;
  background: var(--yh-bg-color-overlay, #ffffff);
  border: 1px solid var(--yh-border-color-light, #ebeef5);
  border-radius: var(--yh-border-radius-large, 8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 12px 16px;
  position: relative;
}
.yh-ai-bubble__citation-tooltip-wrapper .yh-ai-bubble__citation-tooltip::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: inherit;
  border-right: 1px solid var(--yh-border-color-light, #ebeef5);
  border-bottom: 1px solid var(--yh-border-color-light, #ebeef5);
}
.yh-ai-bubble__citation-tooltip-wrapper .yh-ai-bubble__citation-tooltip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--yh-text-color-secondary, #909399);
  font-size: 12px;
  font-weight: 500;
}
.yh-ai-bubble__citation-tooltip-wrapper .yh-ai-bubble__citation-tooltip-body h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--yh-text-color-primary, #303133);
}

.yh-fade-in-scale-up-enter-active,
.yh-fade-in-scale-up-leave-active {
  transition: opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1), transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  transform-origin: bottom center;
}

.yh-fade-in-scale-up-enter-from,
.yh-fade-in-scale-up-leave-to {
  opacity: 0;
  transform: translate(-50%, -85%) scale(0.95) !important;
}