/* ===================================================
   Lottie 预览动画弹窗样式 (与瘦身成功弹窗统一)
   =================================================== */
/* 1. 弹窗容器 - 固定大小 */
.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(60px) scale(0.85);
  width: 950px;
  height: 640px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  background: var(--card, #FFFFFF);
  box-shadow: 0 20px 48px rgba(6, 27, 30, 0.1);
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform-origin: center;
  z-index: 9;
  font-family: "阿里妈妈方圆体 VF Regular", system-ui, sans-serif;
  box-sizing: border-box;
  padding: 32px;
  pointer-events: none;
  visibility: hidden;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 27, 30, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: background-color 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
  z-index: 8;
}

.dialog-backdrop.show {
  background: rgba(6, 27, 30, 0.32);
  opacity: 1;
  visibility: visible;
}

.dialog-backdrop.closing {
  opacity: 0;
  visibility: hidden;
}

/* 弹窗激活显示状态 - 使用与 finishdialog 相同的微回弹曲线 */
.modal.show {
  animation: showFinishDialog 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
  visibility: visible;
}

/* 弹窗关闭动画 */
.modal.close {
  animation: closeFinishDialog 0.4s ease forwards;
  pointer-events: none;
  visibility: visible;
}

.modal.show:not(.close) {
  transform: translate(-50%, -50%) translateY(0) scale(1);
  opacity: 1;
}

/* 弹窗主体内容区 - 左右布局 */
.modal-body {
  display: flex;
  flex: 1;
  gap: 32px;
  width: 100%;
  height: 100%;
}

/* 左侧 - 动画播放器 */
.modal-left {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  flex-shrink: 0;
}

/* 右侧 - 文件信息和瘦身按钮 */
.modal-right {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

/* 文件信息 */
#info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  flex: 1;
  justify-content: flex-start;
  padding: 12px 0;
  min-height: 0;
}

.info-tabs {
  display: flex;
  gap: 32px;
  width: 100%;
  border-bottom: 1px solid rgba(6, 27, 30, 0.08);
}

.info-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 0 0 12px;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--font-3);
  transform: none !important;
}

.info-tab:hover {
  transform: none !important;
}

.info-tab.active {
  color: var(--font-1);
}

.info-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: #29C2FF;
}

.info-tab-beta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--font-3);
  color: var(--font-3);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
}

.info-tab-alert {
  display: none;
  position: absolute;
  top: -2px;
  left: -10px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #FF9C07;
}

.info-tab-alert.show {
  display: block;
}

.info-tab-alert.danger {
  background: #E53935;
}

.info-panel {
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.info-panel.active {
  display: flex;
}

.info-panel > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

#infoPanelMeta > div > span {
  display: block;
  width: 100%;
}

#info span[id^="info-"] {
  color: var(--font-1);
  font-size: 18px;
  font-weight: 500;
  word-break: break-all;
  line-height: 1.4;
}

#info .info-label {
  color: var(--font-2);
  font-size: 13px;
}

.compatibility-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-height: 0;
}

.compatibility-list.has-issues {
  justify-content: flex-start;
}

.compatibility-note {
  width: 100%;
  font-size: 12px;
  line-height: 1.5;
  color: var(--font-3);
}

.compatibility-note[hidden] {
  display: none !important;
}

.compatibility-empty {
  flex: 1;
  min-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.compatibility-empty-icon {
  width: 80px;
  height: 80px;
  background: rgb(46, 220, 255,0.05);
  border-radius: 50%;
  padding: 16px;
}

.compatibility-success-animation {
  width: 100%;
  height: 100%;
}

.compatibility-empty-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--font-2);
  text-align: center;
}

#infoPanelCompatibility {
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 27, 30, 0.24) transparent;
}

#infoPanelCompatibility::-webkit-scrollbar {
  width: 10px;
}

#infoPanelCompatibility::-webkit-scrollbar-track {
  background: transparent;
}

#infoPanelCompatibility::-webkit-scrollbar-thumb {
  background: rgba(6, 27, 30, 0.24);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#infoPanelCompatibility::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 27, 30, 0.36);
}

.compatibility-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 156, 7, 0.1);
  border-radius: 10px;
}

.compatibility-item.warn {
  background: rgba(255, 156, 7, 0.1);
}

.compatibility-item.danger {
  background: rgba(229, 57, 53, 0.1);
}

.compatibility-item-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.compatibility-item-icon svg {
  width: 100%;
  height: 100%;
}

.compatibility-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.compatibility-item-text {
  flex: 1;
  position: relative;
  font-size: 13px;
  color: var(--font-2);
  line-height: 1.5;
}

.compatibility-item-head {
  display: block;
}

.compatibility-item-title {
  font-weight: 600;
  color: var(--font-1);
  margin-bottom: 6px;
  padding-right: 32px;
}

.compatibility-item-code {
  font-size: 11px;
  line-height: 1.2;
  color: var(--font-3);
  cursor: help;
}

.compatibility-item-code-tooltip {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
}

.compatibility-item-code-tooltip.tooltip-trigger[data-tooltip]::before,
.compatibility-item-code-tooltip.tooltip-trigger[data-tooltip]::after {
  display: none;
}

.preview-floating-tooltip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.preview-floating-tooltip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.preview-floating-tooltip-bubble {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(6, 27, 30, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(6, 27, 30, 0.16);
}

.preview-floating-tooltip-arrow {
  width: 0;
  height: 0;
  margin: 0 auto;
  border-width: 6px 5px 0;
  border-style: solid;
  border-color: rgba(6, 27, 30, 0.92) transparent transparent;
}

.compatibility-item-desc {
  font-size: 12px;
  color: var(--font-3);
  margin-top: 2px;
}

/* 瘦身按钮 - 与播放暂停按钮样式一致 */
.preview-compress-tooltip {
  position: relative;
  display: inline-flex;
  width: 100%;
}

.preview-compress-btn {
  width: 100%;
  padding: 8px 18px;
  height: 52px;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 26px;
  font-size: 14px;
  cursor: pointer;
}

.tooltip-trigger[data-tooltip]::before,
.tooltip-trigger[data-tooltip]::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.tooltip-trigger[data-tooltip]::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(6, 27, 30, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(6, 27, 30, 0.16);
}

.tooltip-trigger[data-tooltip]::after {
  content: '';
  bottom: calc(100% + 4px);
  transform: translateX(-50%) translateY(4px);
  border-width: 6px 5px 0;
  border-style: solid;
  border-color: rgba(6, 27, 30, 0.92) transparent transparent;
}

.tooltip-trigger.show-tooltip:hover::before,
.tooltip-trigger.show-tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* 4. 内部编辑器/控制区容器 */
#editor-box2 {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 预览包装器 - 占满剩余高度 */
.preview-wrapper {
  flex: 1;
  border-radius: 20px;
  overflow: hidden;
  background-color: #ffffff;
  background-image: 
    linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
    linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
}

/* Lottie 动画承载容器 */
#lottie-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  overflow: visible;
  outline: var(--preview-outline-width, 1px) solid rgba(0, 0, 0, 0.2);
  cursor: grab;
  line-height: 0;
}

#lottie-highlight-proxy {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  overflow: visible;
  visibility: hidden;
}

#lottie-container svg {
  display: block;
  overflow: visible;
}

.preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}

.preview-loading[data-state="show"] {
  opacity: 1;
  visibility: visible;
}

.preview-loading-icon {
  width: 48px;
  height: 48px;
  animation: preview-loading-spin 0.9s linear infinite;
  transform-origin: center;
}

.preview-platform-switch {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  background: rgba(255, 255, 255, 1);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.preview-platform-btn {
  min-width: 52px;
  height: 28px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: var(--font-2);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-platform-btn svg{
  fill: var(--font-3);
}

.preview-platform-btn.active {
  background: rgba(46, 220, 255, 0.16);
}

.preview-platform-btn.active svg{
  fill: #29C2FF;
}

.preview-platform-btn:hover {
  color: var(--font-1);
}

.preview-platform-btn.tooltip-trigger[data-tooltip]::before {
  bottom: calc(100% + 8px);
}

.preview-platform-btn.tooltip-trigger[data-tooltip]::after {
  bottom: calc(100% + 2px);
}

@keyframes preview-loading-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 预览弹窗拖拽状态 */
.modal.is-dragging-container .preview-wrapper,
.modal.is-dragging-container #lottie-container {
  cursor: grabbing;
}

/* 缩放控制 */
.zoom-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 1);
  padding: 4px;
  border-radius: 12px;
  box-shadow:0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  border: none;
  background-color: rgba(6, 27, 30, 0.05);
  color: var(--font-3);
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
}

.zoom-btn:hover {
  transform: scale(1.1);
}

.zoom-btn:active {
  transform: scale(0.95);
}

.zoom-level {
  font-size: 12px;
  color: var(--font-1);
  min-width: 40px;
  text-align: center;
  font-weight: 500;
}

/* 播放控制排版 */
.controls {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-top: 16px;
  flex-shrink: 0;
}

/* 播放/暂停 按钮 */
.controls .play-btn {
  width: 48px;
  height: 48px;
  border: none;
  background: var(--accent, #061B1E);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.controls .play-btn:hover {
  transform: scale(1.1);
}

.play-icon, .pause-icon {
  width: 24px;
  height: 24px;
}

.play-icon path, .pause-icon path {
  fill: #fff;
}

.play-btn .play-icon {
  display: none;
}

.play-btn.playing .play-icon {
  display: block;
}

.play-btn.playing .pause-icon {
  display: none;
}

.controls .loop-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(0,0,0,0.1);
  background: none;
  color: var(--font-2);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.controls .loop-btn:hover {
  transform: scale(1.04);
}

.controls .loop-btn .loop-icon {
  width: 20px;
  height: 20px;
}

.controls .loop-btn .loop-off-icon {
  display: none;
}

.controls .loop-btn:not(.active) .loop-on-icon {
  display: none;
}

.controls .loop-btn:not(.active) .loop-off-icon {
  display: block;
}

/* 进度条滑块 */
#progress {
  flex-grow: 1;
  cursor: pointer;
  accent-color: #29C2FF;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: linear-gradient(
    to right,
    #29C2FF 0%,
    #29C2FF var(--progress-percent, 0%),
    #eeeeee var(--progress-percent, 0%),
    #eeeeee 100%
  );
  height: 8px;
  border-radius: 999px;
  transition: background 0.2s ease;
}

#progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #29C2FF;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  margin-top: -3px;
  box-shadow: 0 0 0 2px #FFFFFF;
  transition: transform 0.2s ease;
}

#progress::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#progress::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

#progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #29C2FF;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 2px #FFFFFF;
  transition: transform 0.2s ease;
}

#progress::-moz-range-thumb:hover {
  transform: scale(1.2);
}

#progress::-moz-range-thumb:active {
  transform: scale(1.1);
}

#progress::-webkit-slider-runnable-track {
  background: transparent;
  border-radius: 999px;
  height: 8px;
}

#progress::-moz-range-track {
  background: transparent;
  border-radius: 999px;
  height: 8px;
}

/* 帧率文本 */
.frame-text {
  font-size: 13px;
  color: var(--font-2);
  min-width: 65px;
  text-align: right;
  font-family: system-ui, sans-serif;
}

/* 6. 与 finishdialog 共享的动画关键帧 */
@keyframes showFinishDialog {
  from {
    transform: translate(-50%, -50%) translateY(60px) scale(0.85);
    opacity: 0;
  }

  to {
    transform: translate(-50%, -50%) translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes closeFinishDialog {
  from {
    transform: translate(-50%, -50%) translateY(0) scale(1);
    opacity: 1;
  }

  to {
    transform: translate(-50%, -50%) translateY(60px) scale(0.85);
    opacity: 0;
  }
}
