/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
}
:root {
    --dark-bg: #0e0e0e;
    --panel-bg: #141414;
    --panel-bg-hover: #1e1e1e;
    --neon-purple: #f8a8b8;
    --neon-blue: #d8e878;
    --text-primary: #f8f8f8;
    --text-secondary: #c8c8c8;
    --text-tertiary: #888888;
    --border-color: #2a2a2a;
    --input-bg: #1a1a1a;
    --input-border: #333333;
    --module-gap: 12px;
    --module-radius: 12px;
    --btn-gradient: linear-gradient(90deg, #f8a8b8 0%, #d8e878 100%);
    --neon-shadow: 0 0 8px rgba(248, 168, 184, 0.6), 0 0 12px rgba(216, 232, 120, 0.4);
    --module-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0e0e0e;
    color: #f8f8f8;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    height: 100vh;
}
/* 动画定义 */
@keyframes
spin {
    to { transform: rotate(360deg); }
}
@keyframes
pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}
@keyframes
fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* ===== 主体布局容器 ===== */
.main-content-wrapper {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--module-gap);
    overflow: hidden;
    padding: 12px;
    min-width: 0;
}
.content-container {
    display: flex;
    flex: 1;
    gap: var(--module-gap);
    overflow: hidden;
    min-height: 0;
}
.left-center-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--module-gap);
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.top-row {
    display: flex;
    gap: var(--module-gap);
    flex: 1;
    min-height: 0;
}
.top-row .operation-panel {
    width: 340px;
    flex-shrink: 0;
}
.top-row .result-panel {
    flex: 1;
    min-width: 0;
}
/* ===== 左侧操作面板 ===== */
.operation-panel {
    border-radius: var(--module-radius);
    background-color: var(--panel-bg);
    padding: 16px;
    box-shadow: var(--module-shadow);
    overflow-y: auto;
}
.panel-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}
.panel-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}
.form-group {
    margin-bottom: 14px;
}
.form-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.form-input {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 10px;
    resize: none;
    font-size: 14px;
    transition: all 0.3s ease;
}
.form-input:focus {
    outline: none;
    border-color: var(--neon-purple);
    box-shadow: 0 0 6px rgba(248, 168, 184, 0.4);
}
.form-input:hover {
    border-color: var(--neon-blue);
}
.char-count {
    text-align: right;
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.option-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.option-btn {
    padding: 6px 14px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}
.option-btn:hover {
    border-color: var(--neon-blue);
    color: var(--text-primary);
}
.option-btn.active {
    background-color: rgba(248, 168, 184, 0.2);
    color: var(--text-primary);
    border-color: rgba(248, 168, 184, 0.3);
}
.generate-btn {
    width: 100%;
    height: 44px;
    background: var(--btn-gradient);
    border: none;
    border-radius: 24px;
    color: #1a1a1a;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
   
    transition: all 0.3s ease;
}
.generate-btn:hover {
    transform: translateY(-2px);
   
}
.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.generate-btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(26, 26, 26, 0.2);
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.generate-btn.loading .spinner { display: block; }
.generate-btn.loading .btn-text { display: none; }
/* ===== 上传组件（JS动态生成，保留） ===== */
.upload-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
}
.upload-item {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}
.upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.upload-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-item .remove-btn:hover { background: #ef4444; }
.upload-plus {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    background: rgba(20, 30, 50, 0.8);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #7a8ba8;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    user-select: none;
}
.upload-plus:hover {
    background: rgba(40, 50, 80, 0.9);
    border-color: rgba(248, 168, 184, 0.5);
    color: #e2e8f0;
    transform: scale(1.02);
}
/* ===== 视频结果展示面板 ===== */
.result-panel {
    border-radius: var(--module-radius);
    background-color: var(--panel-bg);
    padding: 16px;
    box-shadow: var(--module-shadow);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.result-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.badge {
    font-size: 12px;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(216, 232, 120, 0.10);
    color: #d8e878;
    border: 1px solid rgba(216, 232, 120, 0.10);
}
#galleryBody {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    gap: 12px;
}
.video-result {
    flex: 1;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}
.video-result.show { display: flex; }
.video-grid {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
.video-container video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
}
.video-item .download-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #b0c4de;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.35s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    z-index: 2;
}
.video-item .download-btn:hover {
    background: rgba(248, 168, 184, 0.4);
    color: #e2e8f0;
}
/* 占位与加载状态 */
.placeholder-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 40px 20px;
    width: 100%;
    height: 100%;
}
.placeholder-state .placeholder-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(248, 168, 184, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    color: #f8a8b8;
    border: 1px solid rgba(248, 168, 184, 0.15);
}
.placeholder-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #c8c8c8;
}
.placeholder-state p {
    color: #888888;
    font-size: 0.9rem;
    max-width: 340px;
    line-height: 1.6;
}
.generating-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px 20px;
    width: 100%;
    height: 100%;
}
.generating-state.show { display: flex; }
.generating-state .pulse-ring {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #f8a8b8;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    position: relative;
}
.generating-state .pulse-ring::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(248, 168, 184, 0.1);
    animation: pulse-ring 1.6s ease-in-out infinite;
}
.generating-state .gen-text {
    color: #c8c8c8;
    font-size: 1rem;
    font-weight: 500;
}
.generating-state .gen-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}
.generating-state .gen-progress .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f8a8b8, #d8e878);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.creation-card .card-header .header-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8a8b8, #d8e878);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    flex-shrink: 0;
}
.task-card .card-header .header-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8a8b8, #d8e878);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #000;
    flex-shrink: 0;
}
.progress-text {
    color: #d8e878;
    font-weight: 600;
    margin-top: 8px;
    font-size: 1rem;
}
.cost-preview {
    text-align: center;
    font-size: 14px;
    color: #d8e878;
    padding: 8px 0;
    background: rgba(216, 232, 120, 0.05);
    border-radius: 8px;
    margin: 20px 0;
}
.error-msg {
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.15);
    padding: 16px 20px;
    border-radius: 12px;
    width: 100%;
    text-align: center;
}
/* ===== 预览模态框 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.active { display: flex; }
.modal-overlay .modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    background: rgba(20, 20, 20, 0.55);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.modal-overlay .modal-content video {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}
.modal-overlay .modal-content .modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 2px 12px;
    border-radius: 8px;
    transition: 0.35s cubic-bezier(0.4,0,0.2,1);
    backdrop-filter: blur(4px);
    z-index: 10;
}
.modal-overlay .modal-content .modal-close:hover {
    background: rgba(248,113,113,0.3);
}
.modal-overlay .modal-content .modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    width: 100%;
}
.modal-overlay .modal-content .modal-footer .btn-modal {
    padding: 8px 28px;
    border: none;
    border-radius: 30px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: 0.35s cubic-bezier(0.4,0,0.2,1);
    font-size: 14px;
}
.modal-overlay .modal-content .modal-footer .btn-modal.primary {
    background: linear-gradient(135deg, #f8a8b8, #d8e878);
    color: #1a1a1a;
}
.modal-overlay .modal-content .modal-footer .btn-modal.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(248, 168, 184, 0.2);
}
.modal-overlay .modal-content .modal-footer .btn-modal.outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.04);
    color: #c8c8c8;
}
.modal-overlay .modal-content .modal-footer .btn-modal.outline:hover {
    border-color: #c8c8c8;
}
/* ===== 底部页脚 ===== */
.footer {
    text-align: center;
    padding: 8px 0;
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}
.footer:hover { color: var(--text-secondary); }
/* ===== Toast 消息提示 ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 28px;
    border-radius: 16px;
    background: rgba(14, 20, 34, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: rgba(216, 232, 120, 0.3); }
.toast.error { border-color: rgba(248, 113, 113, 0.3); }
.toast.info { border-color: rgba(248, 168, 184, 0.3); }
/* ===== 响应式布局 ===== */
@media
(max-width: 1200px) {
    body {
        padding: 8px;
        gap: 8px;
        height: auto;
        overflow-y: auto;
        flex-wrap: wrap;
    }
    .main-content-wrapper {
        height: auto;
        padding: 8px;
    }
    .content-container { flex-wrap: wrap; }
    .top-row { flex-wrap: wrap; }
    .top-row .operation-panel {
        width: 100%;
        flex-shrink: 0;
    }
    .top-row .result-panel {
        flex: 1 1 100%;
        min-height: 400px;
    }
    .info-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .info-panel .info-card {
        flex: 1 1 45%;
    }
}
@media
(max-width: 768px) {
    .main-content-wrapper {
        padding: 60px 16px 12px;
    }
    .info-panel .info-card {
        flex: 1 1 100%;
    }
}

/* ===== 骨架屏效果 ===== */
.task-thumb.has-media.loading::before,
.video-item.loading::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.03) 25%, 
        rgba(255,255,255,0.10) 50%, 
        rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: lumiShimmerVideo 1.5s infinite;
    z-index: 2;
    pointer-events: none;
}
@keyframes lumiShimmerVideo {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.task-thumb.has-media.loading video,
.video-item.loading video {
    opacity: 0;
    transition: opacity 0.3s;
}
.task-thumb.has-media:not(.loading) video,
.video-item:not(.loading) video {
    opacity: 1;
}
/* ===== 视频结果区骨架屏修复 ===== */
.video-grid .video-item {
    position: relative;
    overflow: hidden;
    min-height: 250px;          /* 提供初始高度，让骨架屏可见 */
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
}


/* 保证容器可以定位伪元素 */
.task-thumb.has-media,
.video-item {
    position: relative;
    overflow: hidden;
}


        .form-group input,
        .form-group textarea {
            width: 100%;
            padding: 12px 14px;
            background: rgba(0,0,0,0.2);
            font-size: 14px;
            font-family: inherit;
            transition: border-color 0.2s;
            resize: vertical;
        }
        .form-group input:focus,
        .form-group textarea:focus {
            outline: none;
        }
        .form-group textarea { min-height: 120px; }