/*
*avatar.css
*/

/* 加载遮罩 */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #7367E8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* 数字人预览 */
.digital-human-preview {
  position: relative;
  cursor: pointer;
}

.digital-human-preview img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.digital-human-preview .selected-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #fff;
  border-radius: 50%;
  padding: 5px;
  display: none;
}

.digital-human-preview.selected .selected-icon {
  display: block;
}

/* 合成选项 */
.synthesis-options {
  display: none;
}

.synthesis-options.active {
  display: block;
}

/* 数字人图像容器 */
.digital-human-image-container {
  width: 100%;
  padding-top: 56.25%;
  /* 16:9 宽高比 */
  position: relative;
  overflow: hidden;
  background-color: #f8f9fa;
}

.digital-human-image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 语音卡片 */
.voice-card {
  display: flex;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

.voice-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.voice-avatar {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.voice-info {
  flex: 1;
  padding: 10px;
  position: relative;
}

.voice-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.voice-details {
  font-size: 0.9em;
  color: #666;
}

.play-button {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: #7367E8;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.play-button:hover {
  background-color: #5E50E9;
}

.play-button.playing {
  background-color: #DC3545;
}

.voice-card.selected {
  border: 2px solid #7367f0;
  box-shadow: 0 0 5px #7367E8;
}

/* 预览容器 */
.preview-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  /* 保持正方形比例 */
  background-color: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

.preview-container[data-ratio="9:16"] {
  padding-bottom: 177.77%;
}

.preview-container[data-ratio="16:9"] {
  padding-bottom: 56.25%;
}

.preview-container img,
.preview-container div {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}


/* 预览加载动画 */
.preview-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 3;
}

.preview-loader.hidden {
  display: none;
}

.preview-loader .spinner-border {
  z-index: 5;
  position: absolute;
  top: 49%;
  left: 49%;
  width: 1rem;
  /* 调整为你希望的宽度 */
  height: 1rem;
  /* 调整为你希望的高度 */
  border-width: 0.15em;
  /* 调整为你认为合适的边框宽度 */
  opacity: 0.3;
  /* 设置透明度 */
}


/* 确保图片在加载时不可见 */
#digitalHumanPreview {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#digitalHumanPreview.loaded {
  opacity: 1;
}

/* 视频容器 */
.video-container {
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  overflow: hidden;
}

.video-container video {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

/* 缩略图容器 */
.thumbnail-container {
  position: relative;
  overflow: hidden;
}

.play-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s;
}

.play-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* 移动端特定样式 */
@media (max-width: 768px) {
  .voice-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px;
    border: 1px solid #eee;
    margin-bottom: 8px;
    background-color: #fff;
  }

  .voice-avatar {
    width: 40px;  /* 显著减小头像尺寸 */
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
  }

  .voice-info {
    flex: 1;
    overflow: hidden;
  }

  .voice-name {
    font-size: 0.9em;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .voice-details {
    font-size: 0.75em;
    color: #666;
  }

  .play-button {
    width: 30px;
    height: 30px;
    font-size: 0.8em;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 调整网格布局为列表布局 */
  .voice-grid {
    display: block;
    padding: 10px;
  }

  /* 优化筛选器布局 */
  .filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
  }

  .filter-container select,
  .filter-container input {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  #search {
    flex-basis: 100%;
  }
}

/* 添加一个紧凑模式的类 */
@media (max-width: 768px) {
  .compact-mode .voice-card {
    padding: 4px;
  }

  .compact-mode .voice-avatar {
    width: 30px;
    height: 30px;
  }

  .compact-mode .voice-name {
    font-size: 0.8em;
  }

  .compact-mode .voice-details {
    font-size: 0.7em;
  }

  .compact-mode .play-button {
    width: 24px;
    height: 24px;
  }
}

#fixed-alert-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  /* 确保在最上层 */
  max-width: 350px;
  width: 100%;
}

#fixed-alert-container .alert {
  margin-bottom: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

#fixed-alert-container .alert:hover {
  opacity: 1;
}

/* 更新的标签样式 */
.filter-container {
  position: relative;
  margin-bottom: 15px;
}

.filter-content {
  max-height: 33px; /* 初始高度，显示一行 */
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.filter-container.expanded .filter-content {
  max-height: 1000px; /* 一个足够大的值，确保能显示所有内容 */
}

.expand-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* 移除图标的transition */
.expand-btn i {
  display: inline-block;
}

/* 使用不同的类来控制图标的显示和隐藏 */
.expand-btn .ti-chevron-down {
  display: inline-block;
}

.expand-btn .ti-chevron-up {
  display: none;
}

.filter-container.expanded .expand-btn .ti-chevron-down {
  display: none;
}

.filter-container.expanded .expand-btn .ti-chevron-up {
  display: inline-block;
}

.badge {
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 5px;
}

.badge:hover {
  opacity: 0.8;
}

#tagFilter .badge {
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#tagFilter .badge:hover {
  opacity: 0.8;
}

#tagFilter .badge.selected {
  background-color: #7367f0 !important;
}