.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.progress-bar {
    transition: width 0.3s ease;
}

.preview-container {
    background-image: repeating-linear-gradient(45deg, #f3f4f6 25%, transparent 25%, transparent 75%, #f3f4f6 75%, #f3f4f6),
                      repeating-linear-gradient(45deg, #f3f4f6 25%, #ffffff 25%, #ffffff 75%, #f3f4f6 75%, #f3f4f6);
    background-position: 0 0, 10px 10px;
    background-size: 20px 20px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.processing {
    animation: pulse 1.5s ease-in-out infinite;
}

.language-dropdown {
    display: none;
}

.language-dropdown.show {
    display: block;
}

/* 自定义导航栏背景渐变 */
.nav-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 侧边广告高度匹配上传区域 */
.ad-match-height {
    height: calc(100% - 2rem); /* 减去padding */
    
}

/* 按钮里的当前语言国旗 */
#language-btn .flag-icon{
  display:inline-block; width:18px; height:12px; 
  background-size:cover; background-position:center;
  border-radius:2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}

/* 下拉里的每一项：用 CSS 变量承载图片地址 */
.language-dropdown .lang-option.with-flag{
  position:relative; padding-left:2rem; /* 给旗帜留空间 */
}
.language-dropdown .lang-option.with-flag::before{
  content:""; position:absolute; left:10px; top:50%; transform:translateY(-50%);
  width:18px; height:12px;
  background-image: var(--flag-url); background-size:cover; background-position:center;
  border-radius:2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}

  /* 让 toast 的进/出场同时控制透明度与点击性 */
  #toast {
    will-change: transform, opacity;
  }
  /* 当存在 translate-y-full（滑下去）时，同时把透明度设为 0 并禁止点击 */
  #toast.translate-y-full {
    opacity: 0;
    pointer-events: none;
  }


/* ===================== 视频裁剪器样式（最终版，无灰外框） ===================== */
#timelineContainer { 
    position: relative; 
    width: 100%; 
    height: 60px; 
    background: transparent;       /* 底色移到 #timeline，容器保持透明 */
    user-select: none; 
    margin-top: 20px;
    overflow: hidden;
    padding: 4px;                   /* 胶囊内边距 */
    border-radius: 12px;            /* 胶囊圆角 */
    border: 0;                      /* 无外框 */
    box-shadow: none;               /* 无阴影，避免灰边 */
}

#timelineContainer::before,
#timelineContainer::after{
    content: none !important;       /* 防止历史伪元素外框 */
    box-shadow: none !important;
    border: 0 !important;
}

#timeline { 
    width: 100%; 
    height: 60px; 
    display: block; 
    cursor: pointer; 
    border-radius: 12px;
    background: #eee;               /* 轨道底色放在内层 */
    outline: none;                  
    box-shadow: none;               
}


#timelineContainer, #timeline, .handle {
  touch-action: none;            /* 禁止默认水平滑动/双指缩放，保证拖动命中 */
  -webkit-user-select: none;
  user-select: none;
}



.handle { 
    position: absolute; 
    top: 4px;                    
    bottom: 4px;                 
    width: 12px;                 
    background: #111;            
    border: 3px solid #ef4444;   /* 红边 */
    border-radius: 10px;         /* 圆角 */
    cursor: ew-resize; 
    z-index: 8;                  /* 高于高亮，保证圆角不被遮挡 */
    box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset; /* 仅内阴影，避免灰外框 */
}

.handle.active { 
    box-shadow: 0 0 0 2px rgba(255,0,0,0.3); 
}

/* 扩大命中区域（外观不变） */
.handle::before{
    content:"";
    position:absolute; top:-6px; bottom:-6px; left:-6px; right:-6px;
}
/* 抓手纹理 */
.handle::after{
    content:"";
    position:absolute; top:50%; left:50%;
    width:14px; height:22px; transform:translate(-50%,-50%);
    background: linear-gradient(
      to right,
      rgba(255,255,255,.85) 0 2px, transparent 2px 6px,
      rgba(255,255,255,.85) 6px 8px, transparent 8px 12px,
      rgba(255,255,255,.85) 12px 14px
    );
    pointer-events:none;
}

.highlight { 
    position: absolute; 
    top: 4px;                 
    bottom: 4px;              
    background: rgba(239,68,68,0.22); /* 红色半透明 */
    pointer-events: none; 
    border: 2px solid #ef4444; /* 选区红线（不是外框） */
    border-radius: 8px;
    box-sizing: border-box;
    z-index: 5;               /* 低于把手 */
    box-shadow: none;         /* 避免额外阴影 */
}

#previewCanvas {
    position: absolute;
    top: -100px;
    background: #000;
    border: 1px solid #666;
    display: none;
    pointer-events: none;
    z-index: 20;
}

/* ===================== 视频裁剪器样式（最终版结束） ===================== */

/* 图片编辑模式 */
.edit-mode .thumbnail {
    cursor: pointer;
}

.edit-mode .thumbnail.selected {
    box-shadow: 0 0 0 3px #3b82f6;
}

.edit-controls {
    display: none;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.edit-mode .edit-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sortable-ghost {
    opacity: 0.5;
}

/* 新增的图片预览样式 */
.image-preview {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f8f9fa;
    border-radius: 8px;
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 播放控制按钮 */
.playback-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.control-btn:active {
    transform: translateY(0);
}

/* 缩略图区域 */
.thumbnails-container {
    display: flex;
    gap: 12px;
    padding: 16px;
    overflow-x: auto;
    margin-top: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    min-height: 120px;
}

.thumbnail-new {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: move;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.thumbnail-new:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.thumbnail-new img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-remove-new {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e53e3e;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.thumbnail-new:hover .thumbnail-remove-new {
    opacity: 1;
}

.thumbnail-new.active {
    box-shadow: 0 0 0 3px #667eea;
}

/* 上传入口缩略图 */
.upload-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #edf2f7;
    border: 2px dashed #cbd5e0;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-thumbnail:hover {
    background-color: #e2e8f0;
    border-color: #a0aec0;
    color: #4a5568;
}

.upload-thumbnail i {
    font-size: 24px;
    margin-bottom: 8px;
}

/* 拖拽样式 */
.thumbnail-new.dragging {
    opacity: 0.6;
    transform: scale(1.05);
}

/* 帧率控制 */
.frame-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.frame-control input {
    flex: 1;
}

/* 图片计数 */
.image-count {
    font-size: 14px;
    color: #718096;
    margin-left: 12px;
    font-weight: 500;
}

/* 参数设置区域样式调整 */
.param-control {
    width: 100%;
}

.param-control > * {
    width: 100%;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .thumbnails-container {
        padding: 12px;
        gap: 8px;
    }
    
    .thumbnail-new {
        width: 80px;
    }
    
    .playback-controls {
        gap: 8px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
}
