/* 文生视频聊天式界面样式 */

.text-to-video-chat-container {
    height: 100vh; /* 使用全视口高度 */
    max-height: 100vh; /* 确保不超过视口高度 */
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden; /* 防止容器本身产生滚动条 */
    position: fixed; /* 固定定位，避免受body padding影响 */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding-top: 64px; /* 为导航栏留出空间 */
    box-sizing: border-box; /* 确保padding包含在总高度内 */
}

/* 主内容区域 */
.main-content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0; /* 确保在flex容器中正确收缩 */
    max-height: 100%; /* 限制最大高度 */
}

/* 左侧历史记录面板 */
.history-sidebar {
    width: 90px;
    background: white;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}


/* 新建对话按钮区域 */
.new-chat-section {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.new-chat-btn {
    width: 58px;
    height: 58px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    border-color: #007bff;
    color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.new-chat-btn i {
    font-size: 18px;
}

.new-chat-btn span {
    display: none; /* 隐藏文字，只显示加号图标 */
}


/* 历史记录列表 */
.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* 🔥 自适应高度：只有内容超出时才显示滚动条 */
    min-height: 0; /* 确保flex子项可以收缩 */
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
    scrollbar-gutter: stable; /* 为滚动条预留空间，避免布局跳动 */
}

/* 🔥 新增：Webkit 浏览器滚动条样式 - 智能显示 */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background-color: #dee2e6;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background-color: #adb5bd;
}

.history-loading,
.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #6c757d;
    text-align: center;
}

.history-loading i {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.history-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #adb5bd;
}

.history-empty p {
    margin: 0.5rem 0;
    font-weight: 500;
    color: #495057;
}

.history-empty small {
    color: #6c757d;
}

/* 历史记录项 */
.history-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

/* 缩略图样式的历史记录项 */
.history-item.thumbnail-style {
    padding: 0;
    overflow: hidden;
    width: 58px;
    height: 58px;
    margin: 0 auto; /* 水平居中 */
    border: 2px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;  /* 防止收缩 */
    position: relative; /* 为状态指示器定位 */
}

.history-item.thumbnail-style:hover {
    border-color: #007bff;
}

.history-item.thumbnail-style.selected {
    border-color: #007bff;
    border-width: 2px;
}

.history-item.thumbnail-style .history-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.history-item.thumbnail-style video.history-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    pointer-events: none; /* 防止video元素拦截点击事件 */
}

.history-item.thumbnail-style .history-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 6px;
}

/* ===================== 任务状态指示器样式 ===================== */

/* 任务状态覆盖层 */
.history-item.task-pending .history-task-overlay,
.history-item.task-processing .history-task-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* 转圈动画 */
.history-task-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 123, 255, 0.3);
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 任务状态边框 */
.history-item.task-pending {
    border-color: #ffc107; /* 黄色边框表示等待中 */
    border-width: 2px;
}

.history-item.task-processing {
    border-color: #007bff; /* 蓝色边框表示处理中 */
    border-width: 2px;
    animation: task-pulse 2s ease-in-out infinite;
}

/* 处理中的脉冲动画 */
@keyframes task-pulse {
    0%, 100% {
        border-color: #007bff;
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    50% {
        border-color: #0056b3;
        box-shadow: 0 0 0 4px rgba(0, 123, 255, 0);
    }
}

/* 任务状态角标 */
.history-task-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 3;
}

.history-task-badge.pending {
    background: #ffc107;
    color: white;
}

.history-task-badge.processing {
    background: #007bff;
    color: white;
}

.history-task-badge.completed {
    background: #28a745;
    color: white;
}

.history-task-badge.failed {
    background: #dc3545;
    color: white;
}

/* 进度指示器（环形进度条） */
.history-task-progress {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1.5px;
    overflow: hidden;
    z-index: 3;
}

.history-task-progress-fill {
    height: 100%;
    background: #007bff;
    border-radius: 1.5px;
    transition: width 0.3s ease;
    width: 0%;
}

/* 任务计数徽章（显示任务数量） */
.task-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    border: 2px solid white;
}

/* 悬停效果增强 */
.history-item.task-pending:hover,
.history-item.task-processing:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.2s ease;
}

/* 任务完成状态 */
.history-item.task-completed {
    border-color: #28a745;
}

.history-item.task-failed {
    border-color: #dc3545;
}

/* 移除info区域，因为58x58太小无法容纳文字 */
.history-item.thumbnail-style .history-info {
    display: none;
}

/* Tooltip 样式 */
.history-tooltip {
    position: absolute;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    max-width: 250px;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-tooltip.show {
    opacity: 1;
}

.history-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.history-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
    background: white;
}

.history-item.selected {
    border-color: #007bff;
    background: #e7f3ff;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-item-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.history-item-actions {
    display: flex;
    gap: 0.25rem;
}

.history-action-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #6c757d;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.history-action-btn:hover {
    background: #e9ecef;
    color: #007bff;
}

.history-item-image {
    width: 100%;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
}

.history-item-prompt {
    font-size: 0.8rem;
    color: #495057;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.history-item-credits {
    color: #fd7e14;
    font-weight: 500;
}

/* 页面标题 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-icon {
    width: 40px;
    height: 40px;
    background: #6c757d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
    font-size: 18px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* 聊天内容区域 */
.chat-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 确保flex子项可以收缩 */
}

.messages-container {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* 欢迎消息 */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.welcome-message .message-content p {
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

/* 消息项 */
.message-item {
    margin-bottom: 24px;
    animation: fadeInUp 0.3s ease-out;
}

.user-message {
    display: flex;
    justify-content: flex-end;
}

.ai-message {
    display: flex;
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.user-message .message-bubble {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .message-bubble {
    background: white;
    color: #2c3e50;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 视频消息 */
.video-message {
    margin: 16px 0;
}

.generated-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.generated-video {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s ease;
    max-width: 320px; /* 限制最大宽度为320px，保持等比缩放 */
}

.generated-video:hover {
    transform: scale(1.02);
}

.generated-video video {
    width: 100%;
    height: auto;
    display: block;
}

.video-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.generated-video:hover .video-actions {
    opacity: 1;
}

.video-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(0,0,0,0.7);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s ease;
}

.video-action-btn:hover {
    background: rgba(0,0,0,0.9);
}

/* 加载状态 */
.loading-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 70%;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 底部输入区域 */
.input-area {
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 20px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    /* 默认在中间位置 */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 20px;
    z-index: 100;
    box-sizing: border-box;
}

/* 带动画效果的输入框 */
.input-area.with-transition {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 点击生成按钮后固定在底部 */
.input-area.fixed-bottom {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* 当输入框固定在底部时，聊天内容区域需要添加底部边距 */
.chat-content-area.with-fixed-input {
    padding-bottom: 120px; /* 为固定在底部的输入框留出空间 */
}

.chat-input-form {
    max-width: 800px;
    margin: 0 auto;
}

/* 主输入容器 */
.main-input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 图片上传区域 */
.image-upload-wrapper {
    margin-bottom: 12px;
}

.image-upload-area {
    position: relative;
    border: 2px dashed #e9ecef;
    border-radius: 12px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.image-upload-area:hover {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.image-upload-area.dragover {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.02);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    color: #6c757d;
}

.upload-placeholder i {
    font-size: 2rem;
    margin-bottom: 12px;
    color: #adb5bd;
}

.upload-placeholder span {
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.upload-placeholder small {
    font-size: 12px;
    color: #adb5bd;
}

.uploaded-image {
    position: relative;
    display: block;
}

.uploaded-image img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    background: white;
    border-radius: 8px;
    padding: 8px;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s ease;
}

.remove-image-btn:hover {
    background: rgba(220, 53, 69, 0.8);
}

/* 图片上传预览 */
.image-upload-section {
    margin-bottom: 16px;
}

.uploaded-image-preview {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.uploaded-image-preview img {
    max-width: 120px;
    max-height: 90px;
    display: block;
}

/* 文本输入区域 */
.text-input-wrapper {
    display: flex;
    align-items: flex-end;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    padding: 12px 16px;
    transition: border-color 0.2s ease;
    gap: 8px;
}

.text-input-wrapper:focus-within {
    border-color: #007bff;
}

.text-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 16px;
    line-height: 1.4;
    min-height: 24px;
    max-height: 120px;
    font-family: inherit;
    color: #2c3e50;
}

.text-input-wrapper textarea::placeholder {
    color: #adb5bd;
}

/* 输入框内的按钮组 */
.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 输入框内的按钮基础样式 */
.input-action-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 上传按钮样式 */
.input-action-btn.upload-btn {
    color: #6c757d;
    padding: 6px;
    font-size: 16px;
}

.input-action-btn.upload-btn:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

/* 生成按钮样式 */
.input-action-btn.generate-btn {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.input-action-btn.generate-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.input-action-btn.generate-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-action-btn.generate-btn i {
    font-size: 12px;
}

.input-action-btn.generate-btn span {
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .text-input-wrapper {
        padding: 10px 12px;
    }
    
    .input-actions {
        gap: 6px;
    }
    
    .input-action-btn.generate-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .input-action-btn.generate-btn span {
        font-size: 13px;
    }
    
    .input-action-btn.upload-btn {
        padding: 4px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .input-action-btn.generate-btn span {
        display: none; /* 在很小的屏幕上只显示图标 */
    }
    
    .input-action-btn.generate-btn {
        padding: 6px 8px;
    }
    
    .generated-video {
        max-width: 240px; /* 小屏幕上更小的视频播放器 */
    }
}

/* 参数按钮组 */
.params-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.param-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.param-btn:hover {
    border-color: #007bff;
    color: #007bff;
}

.param-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.param-btn i {
    font-size: 12px;
}

/* 原生成按钮样式（已移到输入框内，保留作为备用） */
.generate-btn:not(.input-action-btn) {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s ease;
    align-self: flex-end;
}

.generate-btn:not(.input-action-btn):hover {
    background: #0056b3;
}

.generate-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 参数面板 - 改为从下往上弹出的卡片样式 */
.params-panel {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    pointer-events: auto !important; /* 确保面板可交互 */
    transform: translateY(20px); /* 初始状态：向下偏移 */
    /* 移除默认的left和top设置，避免面板跳到左上角 */
}

.params-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* 显示状态：回到原位 */
    pointer-events: auto !important; /* 确保显示时可交互 */
}

/* 确保参数面板内容可见 */
.params-content {
    position: relative;
    z-index: 1001;
    pointer-events: auto !important; /* 确保内容可交互 */
}

.params-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.param-section {
    margin-bottom: 20px;
}

.param-section h6 {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

/* 选项按钮样式 */
.video-model-options,
.template-options,
.ratio-options,
.quality-options,
.num-videos-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.template-options {
    max-height: 400px; /* 模板选项更多，需要更大的高度 */
}

.video-model-option,
.template-option,
.ratio-option,
.quality-option,
.num-videos-option {
    padding: 8px 16px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    color: #6c757d;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.template-option {
    font-size: 13px; /* 模板选项字体稍小 */
    padding: 8px 12px; /* 增加内边距提高点击区域 */
    pointer-events: auto !important; /* 确保可点击 */
    z-index: 999 !important; /* 确保在最上层 */
    position: relative !important; /* 确保定位正确 */
    min-height: 32px; /* 确保最小点击区域 */
    display: inline-flex; /* 使用flex布局 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
}

.video-model-option:hover,
.template-option:hover,
.ratio-option:hover,
.quality-option:hover,
.num-videos-option:hover {
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

.video-model-option.active,
.template-option.active,
.ratio-option.active,
.quality-option.active,
.num-videos-option.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* 模板选项的滚动条样式 */
.template-options::-webkit-scrollbar {
    width: 4px;
}

.template-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.template-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.template-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 高级选项 */
.advanced-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-item label {
    font-size: 14px;
    color: #2c3e50;
    min-width: 80px;
}

.option-item input[type="range"] {
    flex: 1;
    max-width: 200px;
}

.option-item select {
    padding: 4px 8px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
}

.option-item input[type="checkbox"] {
    margin-right: 8px;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .text-to-video-chat-container {
        /* 移动端保持相同的固定定位方式 */
        height: 100vh;
        max-height: 100vh;
        padding-top: 64px;
        box-sizing: border-box;
    }
    
    .page-header {
        padding: 16px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .chat-content-area {
        padding: 16px;
    }
    
    .input-area {
        padding: 16px;
    }
    
    .params-buttons {
        justify-content: center;
    }
    
    .param-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .generate-btn {
        align-self: stretch;
        justify-content: center;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .generated-videos {
        grid-template-columns: 1fr;
    }
    
    .generated-video {
        max-width: 280px; /* 移动端更小的视频播放器 */
    }
}

/* 滚动条样式 */
.chat-content-area::-webkit-scrollbar {
    width: 6px;
}

.chat-content-area::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-content-area::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-content-area::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 拖拽效果 */
.text-input-wrapper.drag-over {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

/* 用户消息中的描述样式 */
.user-prompt {
    font-size: 14px;
    line-height: 1.4;
}

/* 生成信息样式 */
.generation-info {
    margin-top: 12px;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.3;
}

.generation-info div {
    margin-bottom: 4px;
}

/* 改进的按钮悬停效果 */
.param-btn:hover i,
.generate-btn:hover i {
    transform: scale(1.1);
}

/* 改进的消息动画 */
.message-item {
    animation: slideInUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 改进的加载动画 */
.loading-spinner {
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

/* 改进的视频悬停效果 */
.generated-video {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.generated-video:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* 参数面板动画优化 */
.params-panel {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 输入框聚焦效果 */
.text-input-wrapper:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 按钮点击效果 */
.generate-btn:active {
    transform: scale(0.98);
}

.param-btn:active,
.video-model-option:active,
.template-option:active,
.ratio-option:active,
.quality-option:active,
.num-videos-option:active {
    transform: scale(0.95);
}

/* ============ 视频生成进度条样式 ============ */

.video-progress {
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.progress-text {
    font-weight: 600;
    color: #007bff;
}

.status-text {
    color: #6c757d;
    font-style: italic;
}

/* 进度条动画效果 */
.video-progress {
    animation: fadeInUp 0.4s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .progress-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .progress-text {
        font-size: 13px;
    }
    
    .status-text {
        font-size: 12px;
    }
}

/* 🔥 新增：骨架屏动画样式 */
.history-skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
}

.history-skeleton-item {
    display: flex;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px;
    gap: 10px;
    opacity: 0.8;
}

.skeleton-thumbnail {
    width: 48px;
    height: 48px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
}

.skeleton-line.skeleton-title {
    width: 70%;
    height: 14px;
}

.skeleton-line.skeleton-text {
    width: 90%;
    height: 12px;
}

.skeleton-line.skeleton-meta {
    width: 50%;
    height: 10px;
    margin-top: 4px;
}

/* 骨架屏动画关键帧 */
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 骨架屏项目的显示动画 */
.history-skeleton-item:nth-child(1) {
    animation-delay: 0s;
}

.history-skeleton-item:nth-child(2) {
    animation-delay: 0.1s;
}

.history-skeleton-item:nth-child(3) {
    animation-delay: 0.2s;
}

.history-skeleton-item:nth-child(4) {
    animation-delay: 0.3s;
}

/* 骨架屏项目的显示动画 */
.history-skeleton-item {
    animation: fadeInSkeleton 0.3s ease-out;
}

@keyframes fadeInSkeleton {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 0.8;
        transform: translateY(0);
    }
}