/* Task Management Styles */
.timing-options {
    margin-bottom: 10px;
}

.timing-options label {
    margin-right: 20px;
}

#scheduleTimeWrapper {
    margin-top: 10px;
}

#scheduleTimeWrapper.hidden {
    display: none;
}

#scheduleTime {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 250px;
}

.time-hint {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.multiselect-wrapper {
    position: relative;
    width: 100%;
}

.multiselect-selected {
    min-height: 40px;
    border: 1px solid #ddd;
    padding: 5px;
    margin-bottom: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.selected-account {
    background: #e8f0fe;
    padding: 2px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-account {
    cursor: pointer;
    color: #666;
}

.multiselect-dropdown {
    border: 1px solid #ddd;
    max-height: 300px;
    overflow-y: auto;
}

.multiselect-search {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.multiselect-search input {
    width: 100%;
    padding: 5px;
}

.material-selector {
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.material-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.material-option:hover {
    background-color: #f5f5f5;
}

.material-option.selected {
    background-color: #e6f7ff;
}

.material-info {
    flex: 1;
}

.material-id {
    color: #666;
    margin-right: 10px;
}

.material-desc {
    color: #333;
}

.material-preview {
    width: 120px;
    text-align: right;
}

.preview-btn {
    padding: 2px 8px;
    font-size: 12px;
}

#selectedMaterial {
    margin-bottom: 10px;
    height: 30px;
}

.selected-material {
    display: inline-flex;
    align-items: center;
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 4px;
    margin: 2px;
}

.selected-material span {
    margin-right: 5px;
}

.remove-material {
    cursor: pointer;
    color: #666;
    font-weight: bold;
}

.remove-material:hover {
    color: #ff4444;
}

.retry-btn {
    padding: 4px 8px;
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.retry-btn:hover {
    background-color: #40a9ff;
}

.retry-btn:disabled {
    background-color: #d9d9d9;
    cursor: not-allowed;
}

/* 图片预览相关样式 */
.img-preview-container {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.img-preview-container img {
    cursor: pointer;
}

.img-preview-container span {
    color: #666;
    font-size: 12px;
}

.preview-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.img-carousel {
    position: relative;
    width: 100%;
    text-align: center;
}

.carousel-item img {
    max-width: 100%;
    height: 400px;
    object-fit: contain;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
}

.carousel-next {
    left: auto;
    right: 10px;
}

.thumbnail-strip {
    display: flex;
    gap: 5px;
    justify-content: center;
    overflow-x: auto;
    padding: 5px;
}

.thumbnail {
    width: 80px;
    height: 60px;
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
}

.thumbnail.active {
    border-color: #1890ff;
}

.thumbnail img {
    height: 100%;
    object-fit: cover;
}

/* 修改卡片式布局为行式布局 */
.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.task-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    display: flex;
    overflow: hidden;
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 素材信息区域 */
.task-preview-section {
    width: 200px;
    flex-shrink: 0;
    position: relative;
    border-right: 1px solid #f0f0f0;
}

.task-preview {
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    width: 100%;
}

.preview-video {
    height: 100%;
    object-fit: cover;
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 移除 material-type */
.material-type {
    display: none;
}

/* 任务信息和关联账号区域 */
.task-info-section {
    flex: 1;
    padding: 15px;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.task-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 15px;
}

.task-info {
    /* margin-bottom: 15px; */
}

.task-info-item {
    display: flex;
    margin-bottom: 8px;
    font-size: 14px;
}

.info-label {
    color: #8c8c8c;
    width: 80px;
    flex-shrink: 0;
}

.info-value {
    color: #262626;
    flex: 1;
}

/* 账号列表区域 - 现在是任务信息section的一部分 */
.task-accounts {
    margin-top: 10px;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

.account-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.account-list .account-item {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

/* 移除单独的账号section */
.task-accounts-section {
    display: none;
}

/* 操作区域 */
.task-actions-section {
    display: none;
}

/* 添加操作按钮区域样式 */
.task-actions-inline {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
}

/* 修改操作按钮样式 */
.task-action-btn {
    padding: 6px 12px;
    text-align: center;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    border: none;
}

.task-id {
    font-weight: 500;
    color: #262626;
}

.task-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

.status-pending {
    background-color: #f5f5f5;
    color: #8c8c8c;
}

.status-processing {
    background-color: #e6f7ff;
    color: #1890ff;
}

.status-completed {
    background-color: #f6ffed;
    color: #52c41a;
}

.status-terminated {
    background-color: #fff7e6;
    color: #fa8c16;
}

.status-partial {
    background-color: #fffbe6;
    color: #faad14;
}

.status-failed {
    background-color: #fff1f0;
    color: #f5222d;
}

.status-revoke {
    background-color: #fff1f0;
    color: #5328a3;
}

.img-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    width: 100%;
    height: 100%;
}

.img-preview-container img {
    flex: 1;
    min-width: 30%;
    max-height: 100%;
    object-fit: cover;
}

.more-images {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.task-content {
    padding: 15px;
}

.task-info-item {
    display: flex;
    margin-bottom: 8px;
    font-size: 14px;
}

.info-label {
    color: #8c8c8c;
    width: 80px;
    flex-shrink: 0;
}

.info-value {
    color: #262626;
    flex: 1;
}

.task-accounts-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.account-list .account-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 5px;
}

.account-list .platform-logo {
    width: 14px;
    height: 14px;
    margin-left: 5px;
}

.task-footer {
    padding: 10px 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-time {
    font-size: 12px;
    color: #8c8c8c;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.action-detail {
    background-color: #e6f7ff;
    color: #1890ff;
}

.action-retry {
    background-color: #fff7e6;
    color: #faad14;
}

/* 搜索和过滤区域样式 */
.filter-section {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.account-filter-container {
    position: relative;
    width: 380px;
}

.account-search-box {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    background-color: white;
    cursor: pointer;
    position: relative;
}

.account-search-box input {
    border: none;
    outline: none;
    flex: 1;
    padding: 5px 0;
}

.selected-account {
    margin-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.dropdown-icon {
    margin-left: 5px;
    font-size: 12px;
    color: #666;
}

.account-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.account-item {
    padding: 8px 12px;
    cursor: pointer;
}

.account-item:hover {
    background-color: #f5f5f5;
}

.account-item-content {
    display: flex;
    align-items: center;
}

.account-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
}

.platform-logo {
    width: 16px;
    height: 16px;
    margin-left: 8px;
}

.no-results {
    padding: 10px;
    text-align: center;
    color: #999;
}

.category-select {
    min-width: 150px;
    padding: 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background-color: #fff;
}

.date-range-picker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range-picker input {
    width: 180px;
    padding: 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
}

.search-box button {
    padding: 8px 16px;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .tasks-container {
        grid-template-columns: 1fr;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .account-filter-container,
    .category-select,
    .date-range-picker {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .date-range-picker {
        flex-direction: column;
    }
    
    .date-range-picker input {
        width: 100%;
    }
}

/* 添加任务类型tabs样式 */
.material-type-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.material-type-tab {
    padding: 12px 16px;
    cursor: pointer;
    margin-right: 10px;
    position: relative;
    color: #595959;
}

.material-type-tab:hover {
    color: #1890ff;
}

.material-type-tab.active {
    color: #1890ff;
    font-weight: 500;
}

.material-type-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #1890ff;
}

/* 任务进度条样式 */
.task-progress {
    margin-top: 15px;
    margin-bottom: 10px;
}

.progress-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
}

.progress-title .progress-label {
    color: #595959;
    font-weight: 500;
}

.progress-title .progress-stats {
    color: #8c8c8c;
}

.progress-bar-container {
    height: 6px;
    background-color: #f5f5f5;
    border-radius: 3px;
    overflow: hidden;
}

.progress-segments {
    display: flex;
    height: 100%;
    width: 100%;
}

.progress-segment {
    height: 100%;
}

.progress-segment.ready {
    background-color: #d9d9d9; /* 灰色 - 未开始 */
}

.progress-segment.processing {
    background-color: #1890ff; /* 蓝色 - 进行中 */
}

.progress-segment.done {
    background-color: #52c41a; /* 绿色 - 已完成 */
}

.progress-segment.failure {
    background-color: #f5222d; /* 红色 - 失败 */
}

.progress-segment.revoke {
    background-color: #5328a3; /* 紫色 - 撤销 */
}

.progress-legend {
    display: flex;
    margin-top: 8px;
    font-size: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 5px;
}

/* 无预览内容时的样式 */
.no-preview {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: #8c8c8c;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    position: relative;
    overflow: hidden;
}

.no-preview::before {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    top: -100%;
    left: -100%;
    background: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.3) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.3) 75%,
        rgba(255, 255, 255, 0.1) 100%
    );
    animation: shimmer 3s infinite linear;
    z-index: 1;
}

.no-preview::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 0, 0, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 80% 30%, rgba(0, 0, 0, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 30% 70%, rgba(0, 0, 0, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.03) 0%, transparent 20%);
    z-index: 0;
}

.no-preview-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.no-preview-icon {
    font-size: 32px;
    margin-bottom: 10px;
    color: #bfbfbf;
}

/* 根据任务类型显示不同的渐变背景 */
.no-preview.publish {
    background: linear-gradient(135deg, #e6f7ff 0%, #bae7ff 100%);
}

.no-preview.auto_reply {
    background: linear-gradient(135deg, #f6ffed 0%, #d9f7be 100%);
}

.no-preview.auto_reply_message {
    background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
}

.no-preview.fetch_post_data {
    background: linear-gradient(135deg, #f9f0ff 0%, #efdbff 100%);
}

.revoke-btn {
    padding: 4px 8px;
    background-color: #f5222d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
}

.revoke-btn:hover {
    background-color: #ff4d4f;
}

.revoke-btn:disabled {
    background-color: #d9d9d9;
    cursor: not-allowed;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* 描述单元格样式 - 限制显示宽度 */
.description-cell {
    position: relative;
    max-width: 200px;
}

.description-content {
    display: inline-block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    color: #1890ff;
}

.description-content:hover {
    text-decoration: underline;
}

.description-tooltip {
    display: none;
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
    white-space: normal;
}

/* 返回按钮样式 */
.back-btn-wrapper {
    position: absolute;
    bottom: 20px;
    left: auto;
    right: 20px;
    transform: none;
    text-align: center;
}

.back-btn {
    background-color: #1890ff;
    color: white;
    border: 1px solid #1890ff;
    border-radius: 4px;
    padding: 6px 12px;
}