/* ========================================
   AI漫剧平台 - 任务栏样式
   ======================================== */

/* 任务栏容器和基础样式补充 */
.fastaigc_taskbar {
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 0;
    position: sticky;
    top: 80px;
    z-index: 99;
}

.fastaigc_taskbar-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.fastaigc_taskbar-left {
    flex-shrink: 0;
}

.fastaigc_taskbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.fastaigc_taskbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fastaigc_taskbar-list {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px 0;
}

.fastaigc_taskbar-item {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.fastaigc_taskbar-item:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.fastaigc_taskbar-item.active {
    color: var(--text-primary);
    background: var(--primary-gradient);
}

.fastaigc_taskbar-right {
    flex-shrink: 0;
}

/* 隐藏滚动条 */
.fastaigc_taskbar-list::-webkit-scrollbar {
    display: none;
}

.fastaigc_taskbar-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 任务栏响应式设计 */
@media (max-width: 1024px) {
    .fastaigc_taskbar {
        top: 70px;
    }
}

@media (max-width: 768px) {
    .fastaigc_taskbar {
        top: 60px;
        padding: 10px 0;
    }
    
    .fastaigc_taskbar-inner {
        gap: 16px;
    }
    
    .fastaigc_taskbar-left {
        display: none;
    }
    
    .fastaigc_taskbar-item {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* ========================================
   公共模块任务栏样式（带翻页按钮）
   ======================================== */

.fastaigc_taskbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.fastaigc_taskbar-nav-btn {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.fastaigc_taskbar-nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.fastaigc_taskbar-nav-btn.visible {
    display: flex;
}

.fastaigc_taskbar-nav-btn svg {
    width: 18px;
    height: 18px;
}

.fastaigc_taskbar-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    min-width: 0;
    scroll-behavior: smooth;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

/* 隐藏滚动条 */
.fastaigc_taskbar-scroll::-webkit-scrollbar {
    display: none;
}

.fastaigc_taskbar-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 移动端：直接显示滚动条，不用翻页按钮 */
@media (max-width: 768px) {
    .fastaigc_taskbar-nav-btn {
        display: none !important;
    }
    
    .fastaigc_taskbar-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .fastaigc_taskbar-scroll::-webkit-scrollbar {
        display: block;
        height: 4px;
    }
    
    .fastaigc_taskbar-scroll::-webkit-scrollbar-track {
        background: var(--bg-tertiary);
        border-radius: 2px;
    }
    
    .fastaigc_taskbar-scroll::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }
}

/* ========================================
   底部任务栏容器和任务卡片样式
   ======================================== */

/* 图片任务栏容器 - 在下方 */
#commonCreateImageTaskbarContainer,
#createImageTaskbarContainer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(63, 63, 70, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

#commonCreateImageTaskbarContainer.active,
#createImageTaskbarContainer.active {
    transform: translateY(0);
}

/* 分析任务栏容器 - 在底部 */
#episodeTaskbarContainer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(63, 63, 70, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

#episodeTaskbarContainer.active {
    transform: translateY(0);
}

/* 任务栏 */
.fastaigc_taskbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    max-width: 100%;
    overflow: hidden;
}

/* 任务栏标题 */
.fastaigc_taskbar-title {
    font-size: 12px;
    font-weight: 600;
    color: #71717A;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 任务卡片 */
.fastaigc_task-card {
    flex-shrink: 0;
    width: 200px;
    background: rgba(39, 39, 42, 0.8);
    border: 1px solid rgba(63, 63, 70, 0.5);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.fastaigc_task-card:hover {
    background: rgba(39, 39, 42, 1);
    border-color: rgba(82, 82, 91, 0.8);
    transform: translateY(-2px);
}

.fastaigc_task-card.active {
    border-color: #00d0ff;
    box-shadow: 0 0 0 2px rgba(0, 208, 255, 0.2);
}

/* 任务卡片头部 */
.fastaigc_task-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.fastaigc_task-title {
    font-size: 13px;
    font-weight: 500;
    color: #FFFFFF;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 任务关闭按钮 */
.fastaigc_task-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #71717A;
    cursor: pointer;
    transition: all 0.2s;
}

.fastaigc_task-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.fastaigc_task-close svg {
    width: 14px;
    height: 14px;
}

/* 任务状态 */
.fastaigc_task-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fastaigc_task-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.fastaigc_task-status-indicator.pending {
    background: #71717A;
}

.fastaigc_task-status-indicator.running {
    background: #eab308;
    animation: pulse 1.5s ease-in-out infinite;
}

.fastaigc_task-status-indicator.success {
    background: #22c55e;
}

.fastaigc_task-status-indicator.failed {
    background: #ef4444;
}

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

.fastaigc_task-status-text {
    font-size: 12px;
    color: #A1A1AA;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 任务进度条 */
.fastaigc_task-progress {
    margin-top: 8px;
    height: 4px;
    background: rgba(63, 63, 70, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

.fastaigc_task-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00d0ff, #00ffc8);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* 任务栏任务容器 - 兼容旧ID */
#episodeTaskList,
.fastaigc_taskbar-tasks {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(63, 63, 70, 0.8) transparent;
}

#episodeTaskList::-webkit-scrollbar,
.fastaigc_taskbar-tasks::-webkit-scrollbar {
    height: 6px;
}

#episodeTaskList::-webkit-scrollbar-track,
.fastaigc_taskbar-tasks::-webkit-scrollbar-track {
    background: transparent;
}

#episodeTaskList::-webkit-scrollbar-thumb,
.fastaigc_taskbar-tasks::-webkit-scrollbar-thumb {
    background: rgba(63, 63, 70, 0.8);
    border-radius: 3px;
}

#episodeTaskList::-webkit-scrollbar-thumb:hover,
.fastaigc_taskbar-tasks::-webkit-scrollbar-thumb:hover {
    background: rgba(82, 82, 91, 0.9);
}

/* ========================================
   公共弹窗样式
   ======================================== */

.fastaigc_modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fastaigc_modal-overlay.active {
    display: flex;
}

.fastaigc_modal-container {
    background: #18181B;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid #27272A;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.fastaigc_modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #27272A;
    flex: none;
}

.fastaigc_modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
}

.fastaigc_modal-title svg {
    width: 24px;
    height: 24px;
}

/* 任务栏弹窗关闭按钮 - 使用更高优先级的选择器 */
.fastaigc_modal-header .fastaigc_modal-close {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #71717A;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.fastaigc_modal-header .fastaigc_modal-close svg {
    width: 20px;
    height: 20px;
}

.fastaigc_modal-header .fastaigc_modal-close:hover {
    background: #27272A;
    color: #FFFFFF;
}

.fastaigc_modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 200px;
}

.fastaigc_modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #27272A;
    flex: none;
}

.fastaigc_btn-cancel {
    padding: 10px 20px;
    background: #27272A;
    border: 1px solid #3F3F46;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #A1A1AA;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fastaigc_btn-cancel:hover {
    background: #27272A;
    color: #FFFFFF;
}

/* 进度条容器 */
.progress-container {
    width: 100%;
    height: 8px;
    background: #27272A;
    border-radius: 4px;
    overflow: hidden;
}

/* 进度条 */
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00d0ff 0%, #00ffc8 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* 最小化按钮 */
.fastaigc_btn-minimize {
    flex: 1;
    padding: 10px 20px;
    background: #27272A;
    border: 1px solid #3F3F46;
    color: #E4E4E7;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.fastaigc_btn-minimize:hover {
    background: #3F3F46;
    border-color: #52525B;
}

.fastaigc_btn-minimize svg {
    width: 16px;
    height: 16px;
}

/* 查看结果按钮 */
.fastaigc_btn-view-result {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #00d0ff, #00ffc8);
    color: #09090B;
    border: none;
}

.fastaigc_btn-view-result:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 208, 255, 0.3);
}

.fastaigc_btn-view-result svg {
    width: 16px;
    height: 16px;
}

/* 应用结果按钮 */
.fastaigc_btn-apply-result {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
}

.fastaigc_btn-apply-result:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}

.fastaigc_btn-apply-result svg {
    width: 16px;
    height: 16px;
}

/* 结果区域 */
.fastaigc_result-section {
    margin-bottom: 24px;
}

.fastaigc_result-section:last-child {
    margin-bottom: 0;
}

/* 结果区域标题 */
.fastaigc_result-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
}

.fastaigc_result-section-title svg {
    width: 20px;
    height: 20px;
}

/* 结果列表（分镜文案、提示词） */
.fastaigc_result-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fastaigc_result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #18181B;
    border: 1px solid #27272A;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.fastaigc_result-item:hover {
    background: #27272A;
    border-color: #3F3F46;
}

.fastaigc_result-index {
    flex: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #00d0ff 0%, #00ffc8 100%);
    color: #09090B;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.fastaigc_result-text {
    flex: 1;
    color: #A1A1AA;
    font-size: 14px;
    line-height: 1.6;
}

/* 结果标签（角色、道具、场景、姿势） */
.fastaigc_result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fastaigc_result-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: #18181B;
    border: 1px solid #27272A;
    border-radius: 20px;
    color: #A1A1AA;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.fastaigc_result-tag:hover {
    background: #27272A;
    border-color: #3F3F46;
    color: #FFFFFF;
}

/* 弹窗响应式 */
@media (max-width: 768px) {
    .fastaigc_modal-container {
        margin: 12px;
        max-width: none;
        width: calc(100% - 24px);
        border-radius: 16px;
    }
    
    .fastaigc_result-item {
        padding: 10px;
    }
    
    .fastaigc_result-index {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .fastaigc_result-text {
        font-size: 13px;
    }
    
    .fastaigc_btn-minimize,
    #episodeCancelPollingBtn {
        width: 100%;
    }
}

/* 任务栏特定变量补充 */
:root {
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --border-color: #404040;
}

