* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'MiSans', 'PingFang SC', sans-serif;
  overflow: hidden;
}

.container {
  width: 100vw;
  height: 100vh;
  /* position: relative; */
  overflow: hidden;
  background: linear-gradient(135deg, #1a365d 0%, #2d3748 50%, #1a202c 100%);
}

/* 背景 */
/* 竖屏样式 - 当屏幕宽度大于高度时触发 */
.background {
  position: relative;
  width: 100%;
  height: fit-content;
  overflow: visible;
}

/* AI回复状态 */
.replying-state {
  position: absolute;
  inset: 0;
  z-index: 20;
}

/* 横屏样式 - 当屏幕宽度大于高度时触发 */
@media screen and (orientation: landscape) {
  .container {
    display: flex;
    /* 将容器设置为Flex布局 */
    justify-content: center;
    /* 水平居中 */
  }

  .background {
    position: relative;
    width: fit-content;
    height: 100%;
    overflow: visible;
  }

  .replying-state {
    width: 50%;
    inset: auto;
    right: 0;
    background-image: url(images/background.png);
  }
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

#videoPlayer {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* 隐藏类 */
.hidden {
  display: none !important;
}

/* 语音按钮 - 空闲状态 */
.voice-btn {
  position: absolute;
  right: 40px;
  bottom: 60px;
  width: 80px;
  height: 44px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.voice-btn:hover {
  transform: scale(1.08);
}

.voice-btn-bg {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9999px;
  box-shadow: inset 0 0 10px 0 white;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.voice-btn:hover .voice-btn-bg {
  box-shadow: inset 0 0 15px 2px white, 0 0 20px rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.voice-btn:hover .stars-container {
  animation: starsRotate 3s linear infinite;
}

.voice-btn:hover .star1 {
  animation: starPulse1 0.8s ease-in-out infinite;
}

.voice-btn:hover .star2 {
  animation: starPulse2 0.6s ease-in-out infinite 0.2s;
}

.stars-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 16px;
  animation: starsRotate 10s linear infinite;
}

.stars {
  width: 100%;
  height: 100%;
}

.star1 {
  animation: starPulse1 2s ease-in-out infinite;
  transform-origin: center;
}

.star2 {
  animation: starPulse2 1.5s ease-in-out infinite 0.5s;
  transform-origin: center;
}

@keyframes starsRotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes starPulse1 {

  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

@keyframes starPulse2 {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.8);
  }
}

/* 聆听状态 */
.listening-state {
  position: absolute;
  right: 40px;
  bottom: 60px;
  width: 80px;
  height: 44px;
  border-radius: 9999px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 0 10px 0 white;
}

.gradient-bg {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: conic-gradient(from 0deg, #005dff, #c800ff, #ff003e, #ffd500, #00dcff, #005dff);
  filter: blur(25px);
  opacity: 0.9;
  animation: gradientRotate 5s linear infinite, breathe 3s ease-in-out infinite;
}

@keyframes gradientRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes breathe {

  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(180deg) scale(1.15);
  }
}

.voice-bars {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 5px;
  align-items: center;
  z-index: 10;
}

.voice-bars .bar {
  width: 5px;
  background: white;
  border-radius: 3px;
}

.voice-bars .bar1 {
  animation: barWave 1.5s ease-in-out infinite;
}

.voice-bars .bar2 {
  animation: barWave 1.5s ease-in-out infinite 0.15s;
}

.voice-bars .bar3 {
  animation: barWave 1.5s ease-in-out infinite 0.3s;
}

.voice-bars .bar4 {
  animation: barWave 1.5s ease-in-out infinite 0.45s;
}

@keyframes barWave {

  0%,
  100% {
    height: 8px;
  }

  25% {
    height: 12px;
  }

  50% {
    height: 16px;
  }

  75% {
    height: 10px;
  }
}

/* 理解中状态 */
.processing-state {
  position: absolute;
  right: 40px;
  bottom: 40px;
}

.processing-btn {
  width: 80px;
  height: 44px;
  position: relative;
}

.processing-btn-bg {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9999px;
  box-shadow: inset 0 0 10px 0 white;
}

.dots {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 5px;
}

.dot {
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
}

.processing-label {
  position: absolute;
  top: -30px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-size: 14px;
}

.snowflake {
  width: 12px;
  height: 12px;
  animation: snowflakeRotate 2s linear infinite;
}

@keyframes snowflakeRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}



/* 右下角对话区域容器 */
.reply-container {
  position: absolute;
  right: 40px;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  max-width: 400px;
}

/* Logo */
.reply-logo {
  color: white;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 2px;
  align-self: flex-end;
}

/* 回复区域的SVG Logo */
.reply-logo-svg {
  width: 50px;
  position: relative;
  overflow: hidden;
  align-self: flex-start;
  margin-bottom: 15px;
}

.reply-logo-svg svg {
  width: 100%;
  height: 100%;
}

.reply-logo-shine {
  position: absolute;
  top: -10px;
  left: -30px;
  width: 20px;
  height: 40px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  transform: rotate(30deg);
  animation: replyLogoShine 3.2s ease-in-out infinite;
}

@keyframes replyLogoShine {

  0%,
  62.5% {
    left: -30px;
  }

  37.5% {
    left: 80px;
  }
}

/* 问答区域包装 */
.qa-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 400px;
}

/* 聊天历史记录区域 - 隐藏 */
.chat-history {
  display: none;
}

/* 用户提问 */
.user-question {
  /* background: rgba(255, 255, 255, 0.15); */
  padding: 12px 16px;
  border-radius: 8px;
  /* box-shadow: inset 0 0 8px 0 rgba(255, 255, 255, 0.2); */
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 10px 0 white;
}

.user-question p {
  color: white;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* AI回复文本 - 自动向上滚动+上下渐变消失 */
.ai-reply {
  position: relative;
  width: 400px;
  height: 28px;
  overflow: hidden;
  /* 上下都渐变消失 */
  mask-image: linear-gradient(to bottom, transparent 0%, black 40%, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 40%, black 60%, transparent 100%);
}

.ai-reply-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.8;
  text-align: justify;
  animation: autoScrollUp 8s linear infinite;
}

.ai-reply-text p {
  margin: 0;
  padding-bottom: 28px;
}

@keyframes autoScrollUp {
  0% {
    transform: translateY(28px);
  }

  100% {
    transform: translateY(-100%);
  }
}

/* 底部控制区 */
.reply-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 8px;
}

/* 音色切换 */
.voice-switch {
  width: 80px;
  height: 28px;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  cursor: pointer;
  position: relative;
}

.voice-label {
  white-space: nowrap;
  font-size: 12px;
  color: white;
  z-index: 1;
  transition: color 0.3s;
}

.voice-label.active {
  color: #30b0c7;
}

.switch-pill {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 38px;
  height: 24px;
  background: white;
  border-radius: 999px;
  transition: left 0.3s ease;
}

.voice-switch.star .switch-pill {
  left: 40px;
}

.voice-switch.star .voice-label:first-of-type {
  color: white;
}

.voice-switch.star .voice-label:last-of-type {
  color: #30b0c7;
}

/* 停止按钮 */
.stop-btn {
  width: 80px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  box-shadow: inset 0 0 10px 0 white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.output-bars {
  display: flex;
  gap: 5px;
  align-items: center;
}

.output-bars .bar {
  width: 5px;
  background: white;
  border-radius: 3px;
}

.output-bars .bar:nth-child(1) {
  animation: outputWave 1.2s ease-in-out infinite;
}

.output-bars .bar:nth-child(2) {
  animation: outputWave 1.2s ease-in-out infinite 0.1s;
}

.output-bars .bar:nth-child(3) {
  animation: outputWave 1.2s ease-in-out infinite 0.2s;
}

.output-bars .bar:nth-child(4) {
  animation: outputWave 1.2s ease-in-out infinite 0.3s;
}

@keyframes outputWave {

  0%,
  100% {
    height: 10px;
  }

  50% {
    height: 20px;
  }
}

/* AI标签 */
.ai-label {
  position: absolute;
  right: 40px;
  top: 40px;
  color: white;
  font-size: 12px;
}


/* ==================== H5 移动端适配 ==================== */
@media screen and (max-width: 768px) {

  /* 语音按钮 */
  .voice-btn,
  .listening-state,
  .processing-state {
    right: 20px;
    bottom: 30px;
  }

  /* AI标签 */
  .ai-label {
    right: 20px;
    top: 20px;
  }

  /* 回复容器 */
  .reply-container {
    right: 20px;
    bottom: 30px;
    left: 20px;
    max-width: none;
  }

  /* 问答区域 */
  .qa-wrapper {
    width: 100%;
  }

  /* AI回复区域 */
  .ai-reply {
    width: 100%;
  }

  /* Logo */
  .reply-logo-svg {
    width: 40px;
    margin-bottom: 10px;
  }

  /* 用户问题 */
  .user-question {
    padding: 10px 14px;
  }

  .user-question p {
    font-size: 13px;
  }

  /* AI回复 */
  .ai-reply-text {
    font-size: 13px;
  }

  /* 底部控制区 */
  .reply-controls {
    gap: 10px;
  }

  /* 音色切换 */
  .voice-switch {
    width: 70px;
    height: 26px;
  }

  .voice-label {
    font-size: 11px;
  }

  .switch-pill {
    width: 34px;
    height: 22px;
  }

  .voice-switch.star .switch-pill {
    left: 34px;
  }

  /* 停止按钮 */
  .stop-btn {
    width: 70px;
    height: 40px;
  }
}

/* 更小屏幕适配 */
@media screen and (max-width: 375px) {

  .voice-btn,
  .listening-state,
  .processing-state {
    right: 15px;
    bottom: 20px;
    width: 70px;
    height: 40px;
  }

  .reply-container {
    right: 15px;
    bottom: 20px;
    left: 15px;
  }

  .ai-label {
    right: 15px;
    top: 15px;
    font-size: 11px;
  }

  .processing-label {
    font-size: 12px;
  }
}