/* AI产品图生成 - 全局样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* 顶部导航栏（首页 + 控制台通用） */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 左侧 Logo（首页 + 控制台通用） */
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

.header-logo .logo-icon {
    font-size: 22px;
}

.header-logo .logo-text {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #667eea;
}

/* 右侧操作区（首页 + 控制台通用） */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right .username {
    font-size: 14px;
    color: #666;
}

.header-right .logout-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-right .logout-btn:hover {
    background: #fff2f0;
    border-color: #ff4d4f;
    color: #ff4d4f;
}

.header-right .nav-link {
    color: #1890ff;
    text-decoration: none;
    font-size: 14px;
}

.header-right .nav-link:hover {
    text-decoration: underline;
}

/* ========== 顶部右侧用户下拉菜单（首页 + 控制台通用） ========== */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f5f5f5;
    border: 1px solid #d9d9d9;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-btn:hover,
.user-menu-btn.active {
    background: #e6f7ff;
    border-color: #1890ff;
}

.user-menu-btn .dropdown-arrow {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s ease;
}

.user-menu-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 200;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s ease;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item .item-icon {
    font-size: 15px;
}

.dropdown-item.danger {
    color: #ff4d4f;
}

.dropdown-item.danger:hover {
    background: #fff2f0;
}

.dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}

.user-avatar {
    font-size: 14px;
}

.header-right .login-link,
.header-right .register-link {
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
}

.header-right .login-link:hover,
.header-right .register-link:hover {
    text-decoration: underline;
}

.container {
    display: flex;
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.left-panel {
    width: 400px;
    flex-shrink: 0;
}

.right-panel {
    flex: 1;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    height: 900px;
    position: relative;
    overflow: hidden;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 16px;
}

.upload-area {
    border: 2px dashed #d9d9d9;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #1890ff;
    background: #e6f7ff;
}

.upload-icon {
    width: 30px;
    height: 30px;
    margin: 0 auto 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.upload-text {
    font-size: 13px;
    color: #666666;
    line-height: 1.6;
}

.upload-count {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 12px;
    color: #999999;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab.active {
    background: #000000;
    color: #ffffff;
}

.tab.inactive {
    background: #f5f5f5;
    color: #666666;
}

.tab.inactive:hover {
    background: #e8e8e8;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    font-size: 13px;
    color: #333333;
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 13px;
    color: #333333;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.form-select:hover {
    border-color: #1890ff;
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 13px;
    color: #333333;
    background: #ffffff;
    resize: none;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

.form-textarea:hover {
    border-color: #1890ff;
}

.form-textarea::placeholder {
    color: #999999;
}

.ai-write-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff7e6;
    border: 1px solid #ffc53d;
    border-radius: 16px;
    font-size: 12px;
    color: #d46b08;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-write-btn:hover {
    background: #fff1b8;
}

.ai-icon {
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d46b08' stroke-width='2'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.action-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.action-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.action-btn:disabled {
    background: #d9d9d9;
    color: #999999;
    cursor: not-allowed;
    transform: none;
}

.result-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
}

.result-desc {
    font-size: 12px;
    color: #999999;
}

.view-all-link {
    margin-left: auto;
    font-size: 13px;
    color: #1890ff;
    text-decoration: none;
    cursor: pointer;
}

.view-all-link:hover {
    text-decoration: underline;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 40px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9d9d9' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    animation: spin 8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.empty-text {
    font-size: 14px;
    color: #999999;
    line-height: 1.6;
}

.product-icon {
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231890ff' stroke-width='2'%3E%3Cpath d='M21 21V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z'/%3E%3Cpolyline points='12 10 12 14 14 14'/%3E%3Ccircle cx='12' cy='8' r='2'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.result-icon {
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352c41a' stroke-width='2'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.analysis-icon {
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

/* 文件预览样式 */
.upload-preview-area {
    padding: 12px;
    background: #fafafa;
    border-radius: 12px;
    border: 2px dashed #d9d9d9;
}

.preview-list {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    gap: 12px;
}

.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-index {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid white;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transform: translate(0, 0);
}

.remove-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.add-more-btn {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px dashed #d9d9d9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.add-more-btn:hover {
    border-color: #1890ff;
    background: #e6f7ff;
}

.add-icon {
    font-size: 24px;
    color: #999;
    font-weight: 300;
}

.add-more-btn:hover .add-icon {
    color: #1890ff;
}

/* 上传状态样式 */
.preview-item.uploading img {
    opacity: 0.4;
}

.upload-progress {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.progress-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 上传错误状态 */
.preview-item.upload-error img {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.upload-error-text {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: rgba(255, 77, 79, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
}

/* 加载状态样式 */
.loading-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 14px;
    color: #666666;
}

/* 结果网格样式 */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
}

.result-item {
    border-radius: 12px;
    overflow: hidden;
    background: #fafafa;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-item img {
    width: 100%;
    display: block;
}

.result-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
}

.result-actions button {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.result-actions button:hover {
    border-color: #667eea;
    color: #667eea;
}

.result-actions button:first-child {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.result-actions button:first-child:hover {
    background: #5a70d9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
    }

    .steps {
        gap: 20px;
        flex-wrap: wrap;
    }

    .step::after {
        display: none;
    }
}

/* 进行中任务样式 */
.processing-tasks {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 900px;
    overflow-y: auto;
    padding: 20px 20px 100px;
}

.processing-task-card {
    background: #fafafa;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e8e8e8;
}

.processing-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.processing-task-header .task-id {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.processing-task-header .task-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.processing-task-header .status-pending {
    background: #fff7e6;
    color: #fa8c16;
}

.processing-task-header .status-processing {
    background: #e6f7ff;
    color: #1890ff;
}

.processing-task-header .status-completed {
    background: #f6ffed;
    color: #52c41a;
}

.processing-task-header .status-failed {
    background: #fff2f0;
    color: #ff4d4f;
}

.processing-task-step {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 6px;
    border-left: 3px solid #1890ff;
}

.processing-task-images {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.processing-task-images img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e8e8e8;
}

.processing-task-time {
    font-size: 12px;
    color: #999;
}

/* 滚动条样式 */
.processing-tasks::-webkit-scrollbar {
    width: 6px;
}

.processing-tasks::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.processing-tasks::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 3px;
}

.processing-tasks::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* AI方案选择弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-container {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e8e8e8;
    color: #666;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.plan-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.plan-tab {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.plan-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.plan-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.plan-content {
    flex: 1;
    overflow-y: auto;
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
}

.plan-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.8;
    color: #333;
    margin: 0;
}

.plan-empty {
    text-align: center;
    color: #999;
    padding: 40px;
}

.plan-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    gap: 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-step {
    color: #666;
    font-size: 14px;
    text-align: center;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
}

.btn-cancel {
    padding: 10px 20px;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    border-color: #999;
    color: #333;
}

.btn-confirm {
    padding: 10px 20px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    font-size: 14px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm:hover {
    opacity: 0.9;
}

/* AI帮写按钮禁用状态 */
.ai-write-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== 首页最近任务卡片：任务参数区 ========== */
.task-params-block {
    margin: 12px 0;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.task-params-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #fafafa;
    cursor: pointer;
    user-select: none;
}

.task-params-header:hover {
    background: #f5f5f5;
}

.task-params-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.task-params-expand {
    font-size: 12px;
    color: #1890ff;
}

.task-params-content {
    padding: 12px;
    border-top: 1px solid #f0f0f0;
}

.task-params-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.task-param-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.task-param-label {
    font-size: 11px;
    color: #999;
}

.task-param-value {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    word-break: break-all;
}

.task-param-requirements,
.task-param-errmsg {
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 6px;
    margin-top: 8px;
}

.task-param-errmsg {
    background: #fff2f0;
    border-left: 3px solid #ff4d4f;
}

.task-param-requirements .task-param-label,
.task-param-errmsg .task-param-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    color: #999;
}

.task-param-requirements p,
.task-param-errmsg p {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

.task-param-errmsg p {
    color: #cf1322;
}

/* ========== 首页最近任务卡片：图片区 ========== */
.task-images-block {
    display: flex;
    gap: 16px;
    margin: 12px 0;
    padding-top: 12px;
    border-top: 1px dashed #eee;
}

.task-images-section {
    flex: 1;
    min-width: 0;
}

.task-images-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.task-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.task-image-item {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.task-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.task-image-item:hover {
    border-color: #1890ff;
}

.task-images-empty {
    padding: 12px;
    text-align: center;
    color: #bbb;
    font-size: 12px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px dashed #ddd;
}

/* 首页任务卡片响应式 */
@media (max-width: 768px) {
    .task-params-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .task-images-block {
        flex-direction: column;
        gap: 12px;
    }

    .task-image-item {
        width: 48px;
        height: 48px;
    }
}

/* ========== 图片悬停操作层 ========== */
.task-image-item {
    position: relative;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-image-item:hover .image-overlay {
    opacity: 1;
}

.icon-btn {
    width: 24px;
    height: 24px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.75);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.2s;
    text-decoration: none;
    box-sizing: border-box;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.95);
}

/* ========== 图片查看模态框 ========== */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.image-modal .modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}

.image-modal .modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.processing-task-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.task-tag-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 0;
}

.task-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.task-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: #f0f0f0;
    color: #555;
    line-height: 1.5;
    white-space: nowrap;
}

.task-tag.primary {
    background: #e6f7e6;
    color: #16a34a;
    font-weight: 500;
}

.task-action-row {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.task-action-link {
    font-size: 12px;
    color: #666;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}

.task-action-link:hover {
    color: #1890ff;
}

.task-result-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    padding: 12px 0 0;
}

.result-img-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
}

.result-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-img-item:hover {
    border-color: #1890ff;
}

.result-img-item:hover .image-overlay {
    opacity: 1;
}

.no-results {
    padding: 24px;
    color: #999;
    font-size: 13px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px dashed #d9d9d9;
    text-align: left;
}

.text-modal-content {
    background: #fff;
    border-radius: 10px;
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.text-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
}

.text-modal-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.text-modal-header .modal-close {
    position: static;
    background: #f5f5f5;
    color: #666;
    width: 28px;
    height: 28px;
    font-size: 18px;
}

.text-modal-header .modal-close:hover {
    background: #e8e8e8;
}

.text-modal-body {
    padding: 14px 18px;
    overflow: auto;
    max-height: 50vh;
    flex: 1;
}

.text-modal-body pre {
    font-family: inherit;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    color: #333;
    line-height: 1.7;
    margin: 0;
}

.text-modal-empty {
    text-align: center;
    color: #999;
    font-size: 12px;
    padding: 30px 0;
}

.images-modal-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.images-modal-item {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
}

.images-modal-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}
