/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #E9D3BA 0%, #F0E0C7 50%, #E2C8A8 100%);
    min-height: 100vh;
    color: #7C5528;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

/* 顶部导航栏 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 2rem;
    color: #A67344;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #A67344, #8B5E34);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-tab:hover {
    background: rgba(166, 115, 68, 0.1);
    color: #A67344;
}

.nav-tab.active {
    background: linear-gradient(135deg, #A67344, #8B5E34);
    color: white;
    box-shadow: 0 4px 15px rgba(166, 115, 68, 0.3);
}

/* 用户登录区域 */
.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(166, 115, 68, 0.1);
    border-radius: 25px;
    border: 1px solid rgba(166, 115, 68, 0.2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(166, 115, 68, 0.3);
}

.user-name {
    font-weight: 500;
    color: #A67344;
    font-size: 0.9rem;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(166, 115, 68, 0.1);
    color: #A67344;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(166, 115, 68, 0.2);
    transform: scale(1.1);
}

.feishu-login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #00D4AA, #00B894);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(0, 212, 170, 0.3);
}

.feishu-login-btn:hover {
    background: linear-gradient(135deg, #00B894, #00A085);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
}

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

/* 主要内容区域 */
.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 重要：允许flex子元素收缩 */
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

/* 确保其他标签页保持原有布局 */
.tab-content:not(#history) {
    display: none;
}

.tab-content:not(#history).active {
    display: block;
}

/* 历史记录页面特殊样式 - 占满整个屏幕高度 */
.tab-content#history {
    flex: 1;
    display: none;
    flex-direction: column;
    min-height: 0; /* 重要：允许flex子元素收缩 */
}

.tab-content#history.active {
    display: flex;
}

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

/* 功能卡片 */
.function-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 历史记录页面的功能卡片占满剩余空间 */
.tab-content#history .function-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 重要：允许flex子元素收缩 */
}

/* 统一的页面标题样式 */
.page-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

/* 历史记录页面的标题样式 - 更紧凑 */
.tab-content#history .page-header {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #7C5528;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.page-header h2 i {
    color: #A67344;
    font-size: 1.25rem;
}

.page-header p {
    color: #A67344;
    font-size: 0.9rem;
    opacity: 0.8;
}

.card-body {
    padding: 1.5rem 2rem;
}

/* 历史记录页面的卡片内容占满剩余空间 */
.tab-content#history .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem;
    min-height: 0; /* 重要：允许flex子元素收缩 */
}

/* 上传区域 */
.upload-section {
    margin-bottom: 1.5rem;
}

.upload-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* 为AI修图页面的prompt区域设置高度 */
.upload-grid .prompt-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.upload-grid .prompt-section label {
    margin-bottom: 0.75rem;
    color: #7C5528;
    font-weight: 600;
    font-size: 0.9rem;
}

.upload-grid .prompt-section textarea {
    flex: 1;
    min-height: 120px;
}

/* AI修图页面现在使用与AI换衣相同的布局结构 */


.selected-images-list {
    height: 80px !important; /* 其他地方保持80px */
    max-height: 80px !important;
    min-height: 80px !important;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(248, 250, 252, 0.8);
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.selected-images-list:empty {
    display: block; /* 即使为空也显示，保持布局稳定 */
    height: 80px !important;
}

.selected-images-list.has-images {
    display: flex !important;
}

.selected-images-list::-webkit-scrollbar {
    height: 4px;
}

.selected-images-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.selected-images-list::-webkit-scrollbar-thumb {
    background: #A67344;
    border-radius: 2px;
}

.image-count-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    min-width: 16px;
    text-align: center;
}

/* 为AI修图页面的prompt区域设置样式 */
.prompt-area {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    background: rgba(248, 250, 252, 0.8);
    transition: all 0.3s ease;
}

/* Gemini专用的prompt区域样式 */
.gemini-upload-container .prompt-area {
    aspect-ratio: auto; /* 取消固定比例 */
    height: 150px; /* 固定高度150px，增加50% */
}

.prompt-area:focus-within {
    border-color: #A67344;
    background: white;
    box-shadow: 0 0 0 3px rgba(166, 115, 68, 0.1);
}

.prompt-area textarea {
    width: 100%;
    height: 100px;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    padding: 0;
}


.upload-area {
    position: relative;
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(248, 250, 252, 0.8);
    aspect-ratio: 3/4; /* 设定3:4比例 */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.upload-area:hover {
    border-color: #A67344;
    background: rgba(166, 115, 68, 0.05);
}

.upload-area.dragover {
    border-color: #A67344;
    background: rgba(166, 115, 68, 0.1);
    transform: scale(1.02);
}


.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-placeholder i {
    font-size: 2rem;
    color: #A67344;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.upload-placeholder h3, .upload-placeholder h4 {
    color: #7C5528;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.375rem;
}

.upload-placeholder p {
    color: #A67344;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.upload-btn {
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #A67344, #8B5E34);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(166, 115, 68, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(166, 115, 68, 0.4);
}

/* 新的上传选项样式 */
.upload-options {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.upload-btn.secondary {
    background: rgba(166, 115, 68, 0.1);
    color: #A67344;
    border: 2px solid #A67344;
}

.upload-btn.secondary:hover {
    background: #A67344;
    color: white;
}


.remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-image:hover {
    background: #ff3b30;
    transform: scale(1.1);
}

/* Prompt输入区域 */
.prompt-section {
    margin-bottom: 1.5rem;
}

.prompt-section label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
}

.prompt-section textarea {
    width: 100%;
    height: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    transition: all 0.3s ease;
    background: rgba(248, 250, 252, 0.8);
    box-sizing: border-box;
}

.prompt-section textarea:focus {
    outline: none;
    border-color: #A67344;
    background: white;
    box-shadow: 0 0 0 3px rgba(166, 115, 68, 0.1);
}

/* 操作按钮 */
.action-section {
    text-align: center;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #A67344, #8B5E34);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(166, 115, 68, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(166, 115, 68, 0.4);
}

.primary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 任务历史页面使用统一的页面标题样式 */

/* 移除了筛选和清理按钮样式 */

/* 任务列表 - 动态尺寸网格布局 - 统一卡片大小 */
.task-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    align-items: start;
    max-height: 600px;
    overflow-y: auto;
    padding: 1rem;
    scroll-behavior: smooth;
}

/* 历史记录页面的任务列表占满剩余空间 */
.tab-content#history .task-list {
    flex: 1;
    max-height: none;
    min-height: 0;
    height: 100%; /* 确保占满父容器高度 */
}

/* 滚动条样式优化 */
.task-list::-webkit-scrollbar {
    width: 6px;
}

.task-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.task-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.task-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 统一任务卡片大小 - 所有类型都使用相同尺寸 */
.task-item[data-task-type="AI修图"] {
    min-width: 300px;
}

.task-item[data-task-type="AI换衣"] {
    min-width: 300px;
}

.no-tasks {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.no-tasks i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.no-tasks h3 {
    color: #666;
    margin-bottom: 0.5rem;
}

.no-tasks p {
    color: #999;
}

/* 加载更多指示器样式 */
.load-more-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    color: #666;
    font-size: 0.9rem;
    grid-column: 1 / -1; /* 跨越所有列 */
}

.loading-spinner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-spinner i {
    font-size: 1.2rem;
    color: #007bff;
}

.loading-spinner span {
    color: #666;
}

.task-item {
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* AI修图任务样式 */
.task-item[data-task-type="AI修图"] {
    border-left-color: #d4914e;
    background: linear-gradient(135deg, rgba(212, 145, 78, 0.03), rgba(255, 255, 255, 0.95));
}

.task-item[data-task-type="AI修图"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #d4914e, #f4e4bc);
}

/* AI换衣任务样式 */
.task-item[data-task-type="AI换衣"] {
    border-left-color: #b8860b;
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.03), rgba(255, 255, 255, 0.95));
}

.task-item[data-task-type="AI换衣"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #b8860b, #e8c8a0);
}

/* Nano Banana任务样式 */
.task-item[data-task-type="multi-image-edit"] {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.03), rgba(255, 255, 255, 0.95));
}

.task-item[data-task-type="multi-image-edit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6, #c4b5fd);
}

.task-header {
    display: none; /* 隐藏标题区域 */
}

.task-info h3 {
    color: #7C5528;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.task-info h3 i {
    color: #A67344;
    font-size: 0.8rem;
}

.task-info p {
    display: none; /* 隐藏创建时间，节省空间 */
}

.task-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.task-item[data-task-type="AI修图"] .task-type-badge {
    background: rgba(212, 145, 78, 0.15);
    color: #d4914e;
}

.task-item[data-task-type="AI换衣"] .task-type-badge {
    background: rgba(184, 134, 11, 0.15);
    color: #b8860b;
}

.task-item[data-task-type="multi-image-edit"] .task-type-badge {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

/* 状态显示已移除 */

.task-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
    padding: 0.75rem;
}

/* 重新设计的任务图片展示 */
.task-images-container {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
}

/* AI修图任务：2:1比例，两张图片平分 */
.task-edit-images {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 2/1; /* 统一2:1比例 */
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.task-edit-images:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.task-edit-image {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.task-edit-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* 居中裁剪 */
}

.task-edit-separator {
    display: none; /* 隐藏箭头分隔符 */
}

/* AI换衣任务：2:1比例，三张图片平分 */
.task-clothes-images {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 2/1; /* 统一2:1比例 */
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.task-clothes-images:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.task-clothes-image {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.task-clothes-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* 居中裁剪 */
}

.task-clothes-plus {
    display: none; /* 隐藏加号和等号图标 */
}

/* 任务结果网格样式 */
.task-result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    width: 100%;
    height: 100%;
}

.task-result-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 4px;
}

.task-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-more-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Nano Banana任务：2:1比例，多张输入图片+1张结果图片 */
.task-gemini-images {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 2/1; /* 统一2:1比例 */
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    gap: 2px;
}

.task-gemini-images:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.gemini-input-images {
    flex: 1;
    display: flex;
    background: #f5f5f5;
}

.gemini-input-image {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.gemini-input-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.gemini-more-indicator {
    flex: 0 0 auto;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

.gemini-result-image {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    border-left: 2px solid #e5e7eb;
}

.gemini-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.gemini-prompt {
    background: rgba(139, 92, 246, 0.1);
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: #7c3aed;
    border-left: 2px solid #8b5cf6;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 精简的图片标签 */
.image-label {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
}

/* 精简的状态角标 */
.image-status {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
}

.image-status.running {
    background: rgba(255, 193, 7, 0.9);
    color: white;
}

.image-status.completed {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.image-status.failed {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

/* 精简的耗时角标 */
.image-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 500;
}



.task-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.65rem;
    color: #999;
    flex-shrink: 0;
}

/* 重新设计的任务操作区域 */
.task-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.375rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.task-item:hover .task-actions {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    padding: 0.375rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    font-size: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.action-btn.cancel {
    color: #f59e0b;
}

.action-btn.cancel:hover {
    background: #f59e0b;
    color: white;
}

.action-btn.delete {
    color: #ef4444;
}

.action-btn.delete:hover {
    background: #ef4444;
    color: white;
}

/* 移动端长按删除效果 */
@media (max-width: 768px) {
    .task-actions {
        opacity: 0.5;
        pointer-events: auto;
    }
    
    .task-item.long-press .task-actions {
        opacity: 1;
        pointer-events: auto;
    }
    
    .task-item.long-press {
        transform: scale(0.98);
        box-shadow: 0 0 0 2px #ef4444;
    }
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progress 2s infinite;
}

@keyframes progress {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}


.modal-content {
    background: white;
    margin: 1% auto;
    padding: 0;
    border-radius: 20px;
    width: 95%;
    max-width: 1400px;
    max-height: 95vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.close:hover {
    color: white;
    background: #ef4444;
    transform: scale(1.05);
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.modal-header h3 {
    color: #333;
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(95vh - 120px);
}


/* 素材库弹窗样式 */
.material-modal-content {
    max-width: 900px;
    max-height: 80vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, rgba(166, 115, 68, 0.05), rgba(139, 94, 52, 0.05));
}

.modal-header h3 {
    color: #7C5528;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    color: #A67344;
}

.modal-title-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 1rem;
}

.modal-title-container h3 {
    margin: 0;
}

.rerun-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: white;
    color: #666;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rerun-btn:hover {
    background: #10B981;
    color: white;
    border-color: #10B981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.rerun-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.rerun-btn i {
    font-size: 1rem;
}

.upload-to-library-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #A67344, #8B5E34);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(166, 115, 68, 0.3);
}

.upload-to-library-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(166, 115, 68, 0.4);
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.material-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f5f5f5;
    border: 2px solid transparent;
}

.material-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #A67344;
}

.material-item.selected {
    border-color: #A67344;
    box-shadow: 0 0 0 2px rgba(166, 115, 68, 0.3);
}

.material-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.material-filename {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    font-size: 0.75rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0 0 10px 10px;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

.material-item:hover .material-filename {
    opacity: 1;
    transform: translateY(0);
}

.material-selection-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.upload-material-item {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-material-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-color-alpha);
}

.upload-material-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: var(--text-secondary);
}

.upload-material-content i {
    font-size: 24px;
    color: var(--primary-color);
}

.upload-material-content span {
    font-size: 14px;
    font-weight: 500;
}

.confirm-btn {
    background: #f5f5f5;
    color: #999;
    border: 2px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.confirm-btn:hover:not(:disabled) {
    background: #A67344;
    color: white;
    border-color: #A67344;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(166, 115, 68, 0.4);
}

.confirm-btn:not(:disabled) {
    background: #A67344;
    color: white;
    border-color: #A67344;
    box-shadow: 0 2px 8px rgba(166, 115, 68, 0.3);
}

.confirm-btn:disabled {
    background: #f5f5f5;
    color: #ccc;
    border-color: #e0e0e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.material-item .delete-material {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.material-item:hover .delete-material {
    opacity: 1;
}

.material-item .delete-material:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.no-materials {
    text-align: center;
    padding: 3rem 2rem;
    color: #999;
}

.no-materials i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-materials h4 {
    margin-bottom: 0.5rem;
    color: #666;
}

.material-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-top: 1px solid #e5e7eb;
    background: rgba(248, 250, 252, 0.8);
}

.material-info {
    color: #666;
    font-size: 0.9rem;
}

.material-confirm-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #A67344, #8B5E34);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;

}

.material-confirm-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(166, 115, 68, 0.4);
}

.material-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 任务详情弹窗样式 - 简化版本 */
.prompt-content {
    background: rgba(248, 250, 252, 0.8);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #A67344;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 1.5rem; /* 增加与图片的间距 */
}


/* 横向图片画廊样式 */
.horizontal-image-gallery {
    display: flex;
    gap: 0; /* 去掉图片之间的间距 */
    overflow-x: auto;
    padding: 0; /* 去掉上下左右的内边距 */
    scroll-behavior: smooth;
}

.horizontal-image-gallery::-webkit-scrollbar {
    height: 8px;
}

.horizontal-image-gallery::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.horizontal-image-gallery::-webkit-scrollbar-thumb {
    background: #A67344;
    border-radius: 4px;
}

.horizontal-image-gallery::-webkit-scrollbar-thumb:hover {
    background: #8B5E34;
}

.horizontal-image-gallery .horizontal-image-item {
    flex: 0 0 auto;
    min-width: 375px; /* 增加50% from 250px */
    max-width: 600px; /* 增加50% from 400px */
    text-align: center;
    /* 完全去掉卡片样式和间距 */
    /* border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    transition: all 0.3s ease; */
}

/* 去掉悬停效果 */
/* .horizontal-image-gallery .horizontal-image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
} */

.horizontal-image-gallery .horizontal-image-item h4 {
    margin-bottom: 0.5rem;
    color: #7C5528;
    font-size: 0.9rem;
    font-weight: 600;
}

.horizontal-image-gallery .horizontal-image-item img {
    width: 100%;
    max-height: 450px; /* 增加50% from 300px */
    object-fit: contain;
    cursor: pointer;
    transition: all 0.3s ease;
    /* 去掉图片的装饰样式 */
    /* border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
}

.horizontal-image-gallery .horizontal-image-item img:hover {
    transform: scale(1.02);
}

/* 图片容器样式 */
.image-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* 编辑按钮样式 */
.edit-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    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: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.image-container:hover .edit-image-btn {
    opacity: 1;
}

.edit-image-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* 下载按钮样式 */
.download-image-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    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: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.image-container:hover .download-image-btn {
    opacity: 1;
}

.download-image-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Toast通知 */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    border-left: 4px solid #22c55e;
}

.toast.show {
    display: flex;
    animation: slideIn 0.3s ease;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.error i {
    color: #ef4444;
}

.toast i {
    color: #22c55e;
    font-size: 1.2rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 横向历史记录模块 */
.horizontal-history {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.horizontal-history h3 {
    color: #7C5528;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.horizontal-history h3 i {
    color: #A67344;
}

.horizontal-tasks {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

/* 横向任务使用标准task-item样式 - 统一卡片大小 */
.horizontal-tasks .task-item {
    flex: 0 0 300px; /* 统一宽度 */
    min-width: 300px;
}

.horizontal-tasks .task-item[data-task-type="AI换衣"] {
    flex: 0 0 300px; /* 统一宽度 */
    min-width: 300px;
}

.horizontal-tasks::-webkit-scrollbar {
    height: 4px;
}

.horizontal-tasks::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.horizontal-tasks::-webkit-scrollbar-thumb {
    background: #A67344;
    border-radius: 2px;
}

/* 横向任务现在使用标准.task-item样式，无需专门的.horizontal-task-item样式 */

/* 横向任务标题样式已移除 */

/* 横向任务内容样式已移除 */

.no-horizontal-tasks {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.no-horizontal-tasks i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Nano Banana功能样式 */
.gemini-upload-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* 虚拟试衣功能样式 */
.virtual-tryon-upload-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.horizontal-image-selector {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-height: 120px;
    padding: 1rem;
    border: 2px dashed #ddd;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.8);
    transition: all 0.3s ease;
}

.horizontal-image-selector:hover {
    border-color: #A67344;
    background: rgba(166, 115, 68, 0.05);
}

.gemini-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.add-image-btn,
.material-library-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 55px;
    border: 2px solid #A67344;
    border-radius: 8px;
    background: rgba(166, 115, 68, 0.1);
    color: #A67344;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    gap: 0.25rem;
    flex-shrink: 0;
}

.add-image-btn:hover,
.material-library-btn:hover {
    background: #A67344;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(166, 115, 68, 0.3);
}

.add-image-btn i,
.material-library-btn i {
    font-size: 1.2rem;
}

.selected-images-horizontal {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1;
    min-height: 100px;
    align-items: center;
}

.selected-images-horizontal .horizontal-image-item {
    position: relative;
    width: auto; /* 动态宽度 */
    height: 120px; /* 增加高度 */
    max-width: 200px; /* 最大宽度限制 */
    min-width: 80px; /* 最小宽度 */
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-images-horizontal .horizontal-image-item:hover {
    border-color: #A67344;
    transform: scale(1.05);
}

.selected-images-horizontal .horizontal-image-item img {
    max-width: 100%;
    height: 100%; /* 高度固定 */
    width: auto; /* 宽度自动计算 */
    object-fit: contain; /* 保持原始比例，不裁剪 */
    background: white;
}

.selected-images-horizontal .horizontal-image-item .remove-horizontal-image {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    opacity: 0;
}
/* 运行次数选择器样式 */
/* 运行次数选择器 - 按钮样式 */
.run-count-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.run-count-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #7C5528;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.run-count-btn:hover:not(:disabled) {
    border-color: #A67344;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.run-count-btn.active {
    background: #A67344;
    color: #fff;
    border-color: #A67344;
    box-shadow: 0 2px 8px rgba(166, 115, 68, 0.3);
}

.run-count-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.run-count-btn:disabled:hover {
    transform: none;
    border-color: #e0e0e0;
    background: #fff;
}

.run-count-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.run-count-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.run-count-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.run-count-range {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.run-count-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #A67344;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.run-count-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #A67344;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.run-count-display {
    min-width: 60px;
    text-align: center;
    font-weight: bold;
    color: #A67344;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.run-count-display-inline {
    font-weight: bold;
    color: #A67344;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

.run-count-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Sample Count选择器样式 */
.sample-count-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sample-count-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sample-count-range {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.sample-count-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #A67344;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sample-count-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #A67344;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sample-count-display-inline {
    font-weight: bold;
    color: #A67344;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

/* Temperature选择器样式 */
.temperature-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.temperature-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.temperature-range {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.temperature-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #A67344;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.temperature-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #A67344;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.temperature-display-inline {
    font-weight: bold;
    color: #A67344;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

.temperature-help {
    color: #6c757d !important;
    margin-left: 0.5rem;
    cursor: help;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.temperature-help:hover {
    color: #A67344 !important;
}



.output-run-group {
    margin-bottom: 1.5rem;
}

.output-run-group h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.75rem;
}

/* 多次运行进度条样式 */
.multi-run-progress {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #A67344, #8B5E34);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: #666;
    text-align: center;
    font-weight: 500;
}



.selected-images-horizontal .horizontal-image-item:hover .remove-horizontal-image {
    opacity: 1;
}

.selected-images-horizontal .horizontal-image-item .remove-horizontal-image:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.selected-images-horizontal .horizontal-image-item .image-index {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    min-width: 18px;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-tabs {
        width: 100%;
        justify-content: center;
    }
    
    .nav-tab {
        flex: 1;
        justify-content: center;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .main-content {
        padding: 1rem;
        min-height: calc(100vh - 120px); /* 确保移动端也有足够高度 */
        display: flex;
        flex-direction: column;
    }
    
    .card-header,
    .card-body {
        padding: 1.5rem;
    }
    
    /* 移动端历史记录页面样式 */
    .tab-content#history {
        flex: 1;
        min-height: 0;
    }
    
    .tab-content#history .function-card {
        flex: 1;
        min-height: 0;
    }
    
    .tab-content#history .card-body {
        padding: 1rem;
        flex: 1;
        min-height: 0;
    }
    
    .tab-content#history .page-header {
        margin-bottom: 0.5rem;
        padding: 0.25rem 0;
    }
    
    /* 移动端任务列表样式 */
    .tab-content#history .task-list {
        padding: 0.5rem;
        flex: 1;
        height: 100%;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    
    .selected-image-item {
        width: 100px;
        height: 100px;
    }
    
    .prompt-area {
        aspect-ratio: 3/2; /* 移动端改为3:2比例 */
    }
    
    .task-list {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .task-item[data-task-type="AI修图"],
    .task-item[data-task-type="AI换衣"] {
        min-width: auto; /* 移动端取消最小宽度限制 */
    }
    
    .history-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .history-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-tabs {
        justify-content: center;
    }
    
    .task-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .task-images {
        justify-content: center;
    }
    
    .task-actions {
        justify-content: center;
    }
    
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Nano Banana移动端样式 */
    .horizontal-image-selector {
        min-height: 100px;
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .gemini-controls {
        gap: 0.25rem;
    }
    
    .add-image-btn,
    .material-library-btn {
        width: 70px;
        height: 45px;
        font-size: 0.6rem;
    }
    
    .add-image-btn i,
    .material-library-btn i {
        font-size: 1rem;
    }
    
    .selected-images-horizontal .horizontal-image-item {
        width: auto;
        height: 100px;
        max-width: 160px;
        min-width: 60px;
    }
    
    .gemini-upload-container .prompt-area {
        height: 80px; /* 移动端更小的高度 */
    }
    
    
    .horizontal-image-gallery .horizontal-image-item {
        min-width: 300px; /* 增加50% from 200px */
        max-width: 450px; /* 增加50% from 300px */
    }
    
    .horizontal-image-gallery .horizontal-image-item img {
        max-height: 300px; /* 增加50% from 200px */
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .nav-tab {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .task-item {
        padding: 1rem;
    }
    
    .task-image img {
        width: 60px;
        height: 60px;
    }
    
    .primary-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* 上传进度条样式 */
.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem;
    border-radius: 0 0 12px 12px;
    z-index: 10;
}

.upload-progress .progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.upload-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.upload-progress .progress-text {
    color: white;
    font-size: 0.75rem;
    text-align: center;
    font-weight: 500;
}

/* 参数行样式 */
.parameters-row {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.parameter-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.parameter-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

/* 图片比例选择器样式 */
.aspect-ratio-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.aspect-ratio-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.aspect-ratio-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #7C5528;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.aspect-ratio-btn:hover {
    border-color: #A67344;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.aspect-ratio-btn.active {
    background: #A67344;
    color: #fff;
    border-color: #A67344;
    box-shadow: 0 2px 8px rgba(166, 115, 68, 0.3);
}

.ratio-preview {
    width: 30px;
    height: 20px;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #f5f5f5;
}

.ratio-preview.portrait {
    width: 15px;
    height: 30px;
}

.ratio-preview.square {
    width: 20px;
    height: 20px;
}

.ratio-preview.landscape {
    width: 30px;
    height: 15px;
}

.ratio-preview.none {
    width: 20px;
    height: 20px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    position: relative;
}

.ratio-preview.none::after {
    content: "×";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #AAA;
    font-weight: bold;
}

.ratio-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.aspect-ratio-display-inline {
    font-weight: bold;
    color: #A67344;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .parameters-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .parameter-group {
        width: 100%;
    }
    
    .aspect-ratio-options {
        justify-content: center;
    }
    
    .aspect-ratio-btn {
        min-width: 50px;
        padding: 0.4rem;
    }
    
    .ratio-preview {
        width: 25px;
        height: 15px;
    }
    
    .ratio-preview.portrait {
        width: 12px;
        height: 25px;
    }
    
    .ratio-preview.square {
        width: 15px;
        height: 15px;
    }
    
    .ratio-preview.landscape {
        width: 25px;
        height: 12px;
    }
    
    .ratio-preview.none {
        width: 15px;
        height: 15px;
    }
}

/* === Seedream4 特定样式 === */

/* Seedream4 上传容器 */
.seedream4-upload-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 最大生成图片数选择器 */
.max-images-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.max-images-slider {
    flex: 1;
    position: relative;
}

.max-images-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.max-images-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #A67344;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.max-images-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #A67344;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.max-images-display-inline {
    font-weight: bold;
    color: #A67344;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

/* 尺寸选择器 */
/* 模型选择器样式 */
.model-selector {
    display: flex;
    gap: 0.5rem;
}

.model-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.model-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #D4A574;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #7C5528;
    font-weight: 500;
}

.model-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #B8935F;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.model-btn.active {
    background: linear-gradient(135deg, #D4A574 0%, #B8935F 100%);
    color: white;
    border-color: #B8935F;
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.model-text {
    display: block;
}

.size-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.size-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.size-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #7C5528;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.size-btn:hover {
    border-color: #A67344;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.size-btn.active {
    background: #A67344;
    color: #fff;
    border-color: #A67344;
    box-shadow: 0 2px 8px rgba(166, 115, 68, 0.3);
}

.size-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.size-btn:disabled:hover {
    transform: none;
    border-color: #e0e0e0;
    background: #fff;
}

/* 模型选择提示样式 */
.model-hint {
    color: #ff6b6b;
    font-size: 0.85rem;
    font-weight: normal;
    margin-left: 0.25rem;
    font-style: italic;
}

.size-text {
    font-size: 0.9rem;
    font-weight: 600;
}

/* 水印选择器 */
.watermark-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.watermark-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.watermark-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #7C5528;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.watermark-btn:hover {
    border-color: #A67344;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.watermark-btn.active {
    background: #A67344;
    color: #fff;
    border-color: #A67344;
    box-shadow: 0 2px 8px rgba(166, 115, 68, 0.3);
}

.watermark-btn i {
    font-size: 0.9rem;
}

.watermark-btn span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Seedream4 按钮特殊样式 */
#startSeedream4Task {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

#startSeedream4Task:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

#startSeedream4Task:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 移动端适配 - Seedream4 */
@media (max-width: 768px) {
    .size-options {
        justify-content: center;
    }
    
    .size-btn {
        min-width: 50px;
        padding: 0.4rem 0.8rem;
    }
    
    .watermark-options {
        justify-content: center;
    }
    
    .watermark-btn {
        min-width: 80px;
        padding: 0.4rem 0.8rem;
    }
    
    .watermark-btn span {
        font-size: 0.8rem;
    }
}

/* Seedream4 自定义图标样式 */
.tab-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 0px;
}

.page-title-icon {
    width: 40px;
    height: 40px;
    vertical-align: middle;
    margin-right: 0px;
}

.task-type-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 0px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 0px;
}

.overlay-btn-icon {
    width: 8px;
    height: 8px;
    vertical-align: middle;
}

.seedream4-overlay-icon {
    width: 6px;
    height: 6px;
    vertical-align: middle;
}

/* === VEO3 特定样式 === */

/* VEO3 上传容器 */
.veo3-upload-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* VEO3 视频参数样式 */
.veo3-upload-container .parameters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.veo3-upload-container .parameter-group {
    flex: 1;
    min-width: 200px;
}

/* VEO3 视频时长滑块 */
.duration-selector {
    margin-top: 0.5rem;
}

.duration-slider {
    position: relative;
    height: 20px;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
}

.duration-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 6px;
    background: #7C5528;
    border-radius: 3px;
    width: var(--progress, 50%);
    transition: width 0.2s ease;
    z-index: 1;
}

.duration-range {
    width: 100%;
    height: 6px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
}

.duration-range::-webkit-slider-track {
    width: 100%;
    height: 6px;
    background: #E0E0E0;
    border-radius: 3px;
    border: none;
}

.duration-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #7C5528;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: none;
}

.duration-range::-moz-range-track {
    width: 100%;
    height: 6px;
    background: #E0E0E0;
    border-radius: 3px;
    border: none;
}

.duration-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #7C5528;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* VEO3 分辨率选择器 */
.resolution-selector {
    margin-top: 0.5rem;
}

.resolution-options {
    display: flex;
    gap: 0.5rem;
}

.resolution-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #E0E0E0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.resolution-btn:hover {
    border-color: #7C5528;
    background: #F8F4F0;
}

.resolution-btn.active {
    border-color: #7C5528;
    background: #7C5528;
    color: white;
}

.resolution-text {
    font-weight: 500;
}

/* VEO3 复选框样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #E0E0E0;
    border-radius: 4px;
    background: white;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #7C5528;
    border-color: #7C5528;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* VEO3 视频查看器样式 */
.main-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    background: #000;
}

.main-video[poster] {
    background: #000;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-play-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.video-play-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.video-play-btn i {
    font-size: 24px;
    color: #333;
    margin-left: 4px; /* 微调播放图标位置 */
}

.video-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* VEO3 任务状态样式 */
.veo3-task-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.veo3-task-status.processing {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEAA7;
}

.veo3-task-status.completed {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.veo3-task-status.error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

/* VEO3 视频缩略图样式 */
.video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.video-thumbnail::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

/* VEO3 响应式设计 */
@media (max-width: 768px) {
    .veo3-upload-container .parameters-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .veo3-upload-container .parameter-group {
        min-width: auto;
    }
    
    .resolution-options {
        flex-direction: column;
    }
    
    .resolution-btn {
        text-align: center;
    }
}
