/* ========================================
 * task.css - 任务看板模块样式
 * 三列看板视图：待办 / 进行中 / 已完成
 * ======================================== */

/* ---- 看板容器 ---- */
.kanban {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px;
  min-height: 300px;
  -webkit-overflow-scrolling: touch;
}

/* 隐藏看板横向滚动条 */
.kanban::-webkit-scrollbar {
  display: none;
}

/* ---- 看板列 ---- */
.kanban-column {
  flex: 0 0 280px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

/* ---- 列头部 ---- */
.kanban-column-header {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* 列标题文字 */
.kanban-column-title {
  color: var(--text-secondary);
}

/* 任务数量徽章 */
.kanban-column-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* 待办列数量 */
.kanban-column[data-status="todo"] .kanban-column-count {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
}

/* 进行中列数量 */
.kanban-column[data-status="progress"] .kanban-column-count {
  background: rgba(0, 240, 255, 0.12);
  color: var(--neon-cyan);
}

/* 已完成列数量 */
.kanban-column[data-status="done"] .kanban-column-count {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

/* ---- 任务卡片 ---- */
.task-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  border-left: 3px solid var(--text-muted);
  transition: transform 0.15s, box-shadow 0.15s;
}

.task-card:last-child {
  margin-bottom: 0;
}

.task-card:active {
  transform: scale(0.98);
}

/* 按优先级设置左边框颜色 */
.task-card[data-priority="high"] {
  border-left-color: #ef4444;
}

.task-card[data-priority="critical"] {
  border-left-color: #ef4444;
}

.task-card[data-priority="mid"] {
  border-left-color: #fbbf24;
}

.task-card[data-priority="medium"] {
  border-left-color: #3b82f6;
}

.task-card[data-priority="low"] {
  border-left-color: #6b7280;
}

/* ---- 优先级标签 ---- */
.task-card-priority {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.task-card-priority[data-level="high"],
.task-card-priority[data-level="critical"] {
  color: #ef4444;
}

.task-card-priority[data-level="mid"] {
  color: #fbbf24;
}

.task-card-priority[data-level="medium"] {
  color: #3b82f6;
}

.task-card-priority[data-level="low"] {
  color: #6b7280;
}

/* ---- 任务标题 ---- */
.task-card-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- 任务进度条 ---- */
.task-card-progress {
  margin-bottom: 6px;
}

.task-card-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.task-card-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  transition: width 0.3s ease;
}

/* 已完成进度条 */
.task-card[data-status="done"] .task-card-progress-fill {
  background: var(--success);
}

/* 任务进度文字 */
.task-card-progress-text {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: right;
}

/* ---- 任务卡片底部信息 ---- */
.task-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* 负责人信息 */
.task-card-assignee {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-card-assignee .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-purple);
  font-size: 0.6rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* 截止日期 */
.task-card-deadline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* 截止日期已逾期 */
.task-card-deadline.overdue {
  color: var(--danger);
}

/* ---- 子任务指示器 ---- */
.task-card-subtask {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.task-card-subtask-icon {
  font-size: 0.7rem;
}

/* ---- 空列状态 ---- */
.kanban-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.5;
  min-height: 80px;
}

/* ---- 阻塞状态标识 ---- */
.task-card-blocked {
  position: relative;
  opacity: 0.7;
}

.task-card-blocked::after {
  content: "阻塞";
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}
