/* ---------- AI 任务列表（Vue3 + axios 版） ----------
   任务数据来自 /api/page/ai-task/list，状态由后端按 results 汇总：
   running 进行中 / failed 失败 / completed 已完成。 */

.ai-list-shell { max-width: 1080px; margin: 0 auto; padding: 24px 16px 72px; }

.ai-list-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-list-tabs { display: flex; align-items: center; gap: 20px; }
.ai-list-tab {
    background: none; border: none; padding: 4px 2px;
    font-size: 1.08rem; font-weight: 800; color: #a39a8c;
}
.ai-list-tab.on { color: #2b1f12; }
.ai-list-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.ai-icon-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(176, 135, 86, .25); background: #fff; color: #6c6255;
    display: inline-flex; align-items: center; justify-content: center;
}
.ai-icon-btn:hover { background: rgba(176, 135, 86, .08); }

.btn-md-primary {
    background: linear-gradient(135deg, #c79a5e, #b08756); border: none; color: #fff;
    font-weight: 700; border-radius: 12px; padding: 10px 26px; font-size: .9rem;
    text-decoration: none; display: inline-flex; align-items: center;
}
.btn-md-primary:hover { filter: brightness(1.04); color: #fff; }
.btn-md-sm { padding: 7px 15px; font-size: .82rem; border-radius: 10px; }

.ai-search-row { margin-top: 14px; }
.ai-search-row .form-control {
    border-radius: 12px; border-color: rgba(176, 135, 86, .3); font-size: .86rem;
}
.ai-search-row .form-control:focus {
    border-color: #b08756; box-shadow: 0 0 0 .18rem rgba(176, 135, 86, .18);
}

/* 状态筛选 */
.ai-filter-tabs { display: flex; gap: 6px; margin: 18px 0 14px; flex-wrap: wrap; }
.ai-filter {
    border: none; background: transparent; color: #8c8273;
    font-size: .82rem; font-weight: 600; padding: 7px 14px; border-radius: 10px;
}
.ai-filter:hover { color: #2b1f12; }
.ai-filter.on { background: #efece6; color: #2b1f12; }

/* 任务卡片 */
.ai-task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-task-item {
    background: #fff; border: 1px solid #ece8e1; border-radius: 14px;
    padding: 16px 18px; transition: border-color .15s, box-shadow .15s;
}
.ai-task-item:hover { border-color: #e0d7c8; box-shadow: 0 8px 22px rgba(120, 90, 40, .08); }

.ai-task-top { display: flex; align-items: flex-start; gap: 10px; }
.ai-task-top h3 {
    flex: 1; margin: 0; font-size: .95rem; font-weight: 700; color: #2b1f12;
    line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ai-status {
    flex: none; font-size: .72rem; font-weight: 700; line-height: 1;
    padding: 5px 9px; border-radius: 999px; white-space: nowrap;
}
.ai-status.running { color: #a8681f; background: #fdf3e3; }
.ai-status.failed { color: #b1372f; background: #fbecea; }
.ai-status.completed { color: #1d7a45; background: #e9f6ee; }

.ai-task-desc {
    margin: 8px 0 10px; font-size: .82rem; color: #8c8273; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ai-task-fail {
    display: flex; align-items: flex-start; gap: 5px; margin: 0 0 10px;
    font-size: .76rem; color: #b1372f; line-height: 1.6;
}

.ai-task-foot {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 12px; border-top: 1px solid #f1ede6; font-size: .75rem; color: #9a948a;
}
.ai-task-time { display: inline-flex; align-items: center; gap: 5px; }

/* 加载失败 */
.ai-load-error {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: #fff; border: 1px solid #f0d9d5; border-radius: 12px;
    padding: 14px 16px; margin-bottom: 12px; font-size: .82rem; color: #b1372f;
}
.ai-load-error button {
    border: 1px solid rgba(176, 135, 86, .35); background: #fff; color: #8a6a3c;
    border-radius: 8px; padding: 5px 12px; font-size: .78rem; font-weight: 600;
}

/* 骨架占位（接口加载期间） */
.ai-skeleton-line {
    height: 12px; border-radius: 6px; background: #f0ece5; margin-bottom: 10px;
    animation: ai-skeleton-pulse 1.2s ease-in-out infinite;
}
.ai-skeleton-line.w-70 { width: 70%; }
.ai-skeleton-line.w-85 { width: 85%; }
.ai-skeleton-line.w-100 { width: 100%; }
.ai-skeleton-foot { height: 34px; margin-top: 16px; border-top: 1px solid #f1ede6; }
@keyframes ai-skeleton-pulse {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

/* 空状态 */
.ai-empty {
    background: #fff; border: 1px dashed #e2dbcf; border-radius: 16px;
    padding: 52px 20px; text-align: center; color: #9a948a;
}
.ai-empty > .bi { font-size: 2rem; color: #cbbfa9; }
.ai-empty .tt { font-size: .95rem; font-weight: 700; color: #5a5247; margin-top: 10px; }
.ai-empty .ds { font-size: .82rem; margin-top: 6px; line-height: 1.7; }

@media (max-width: 768px) {
    .ai-list-shell { padding: 16px 12px 60px; }
    .ai-task-grid { grid-template-columns: 1fr; }
    .ai-list-actions { width: 100%; }
    .ai-list-actions .btn-md-sm { flex: 1; justify-content: center; }
}
