/* ===========================================================
 *  任务中心：看板 / 任务树 / 工时台账
 * =========================================================== */

.tf-page .page-hd p { color: var(--muted); }

/* ---------- 页签 ---------- */
.tf-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 0; flex-wrap: wrap; }
.tf-tab { height: 34px; padding: 0 14px; border-radius: 9px 9px 0 0; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; }
.tf-tab:hover { background: #F1F5FB; color: var(--ink); }
.tf-tab.on { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); background: var(--primary-soft); }
.tf-tip { font-size: 12px; padding-right: 4px; }

.tf-dim { color: var(--muted); font-size: 12px; }
.tf-red { color: var(--red); font-size: 12px; }
.tf-link { color: var(--primary); cursor: pointer; }
.tf-link:hover { text-decoration: underline; }
.tf-empty { padding: 18px 8px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- 看板卡片 ---------- */
.tf-card { display: flex; flex-direction: column; gap: 6px; }
.tf-card-top { cursor: pointer; }
.tf-card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.tf-card-who { font-size: 12px; color: var(--ink2); }
.tf-card-prog { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.tf-card-prog .tf-bar { flex: 1; }
.tf-card-hours { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink2); }
.tf-card-members { display: flex; gap: 5px; flex-wrap: wrap; }
.tf-chip { font-size: 11.5px; background: #F1F5FB; color: var(--ink2); border-radius: 20px; padding: 2px 8px; }
.tf-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.tf-card-foot .due { font-size: 11.5px; color: var(--muted); }
.tf-card-foot .due.over { color: var(--red); font-weight: 600; }

/* 进度条 */
.tf-bar { height: 6px; border-radius: 99px; background: #E9EEF7; overflow: hidden; }
.tf-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #60A5FA, #2563EB); }
.tf-bar i[data-tone="green"] { background: linear-gradient(90deg, #34D399, #0E9F6E); }

/* ---------- 任务树 ---------- */
.tf-tree-card { padding: 0; overflow: hidden; margin-top: 14px; }
.tf-tree-hd { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 600; flex-wrap: wrap; }
.tf-tree { padding: 6px 10px 14px; }
.tf-node { border-radius: 10px; }
.tf-node-main { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px 9px 6px; border-radius: 10px; }
.tf-node-main:hover { background: #F7F9FD; }
.tf-node.pending .tf-node-main { background: #FFFBF3; }
.tf-node.pending .tf-node-main:hover { background: #FEF7E9; }
.tf-fold { flex: none; width: 20px; height: 22px; color: var(--muted); font-size: 12px; border-radius: 5px; }
.tf-fold:hover { background: #E9EEF7; }
.tf-fold.empty { color: #CBD5E1; cursor: default; }
.tf-node-title { flex: 1; min-width: 0; }
.tf-node-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.tf-node-line b { cursor: pointer; font-weight: 600; }
.tf-node-line b:hover { color: var(--primary); }
.tf-node-sub { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.tf-node-hours { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--ink2); min-width: 96px; }
.tf-node-act { flex: none; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
.tf-children { margin-left: 20px; border-left: 1px dashed #DCE5F2; padding-left: 8px; }

/* ---------- 工时台账 ---------- */
.tf-ledger { padding: 16px 18px; }
.tf-lead-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tf-lead-filter .select { width: auto; min-width: 132px; height: 32px; font-size: 12.5px; }
.tf-lead-stats { margin: 12px 0 4px; }
.tf-mini { background: #F7F9FD; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tf-mini .k { font-size: 12px; color: var(--muted); }
.tf-mini .v { font-size: 22px; font-weight: 700; margin: 2px 0; }
.tf-mini .d { font-size: 11.5px; color: var(--muted); }
.tf-lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.tf-sub-hd { font-size: 13px; font-weight: 600; margin: 16px 0 8px; }
.tf-lead-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 0; }
.tf-lead-name { width: 74px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-lead-bar { flex: 1; height: 8px; border-radius: 99px; background: #EEF2F9; overflow: hidden; }
.tf-lead-bar i { display: block; height: 100%; background: linear-gradient(90deg, #93C5FD, #2563EB); border-radius: 99px; }
.tf-lead-bar.dept i { background: linear-gradient(90deg, #FCD34D, #D97706); }
.tf-lead-h { width: 52px; text-align: right; font-weight: 600; }
.tf-table-wrap { overflow-x: auto; }
.tf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tf-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tf-table td { padding: 9px 10px; border-bottom: 1px solid #F1F4F9; vertical-align: top; }
.tf-table td.r, .tf-table th.r { text-align: right; white-space: nowrap; }
.tf-table .tf-note { max-width: 320px; color: var(--ink2); }

/* ---------- 新建任务：分工方式 ---------- */
.tf-mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 4px; }
.tf-mode { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff; transition: .15s; }
.tf-mode:hover { border-color: #BFD3FF; }
.tf-mode.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.tf-mode-t { font-size: 13.5px; font-weight: 600; }
.tf-mode-d { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 4px; }

/* ---------- AI 建议 ---------- */
.tf-ai { border: 1px dashed #C7D7F5; background: #F8FAFF; border-radius: 12px; padding: 12px 14px; margin: 6px 0 12px; }
.tf-ai-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tf-ai-hd b { font-size: 13px; }
.tf-ai-hd .tf-dim { margin-left: 8px; }
.tf-ai-out { margin-top: 10px; font-size: 12.5px; line-height: 1.7; }
.tf-ai-hit { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 9px; background: #fff; border: 1px solid #E3EBF9; margin-bottom: 8px; }
.tf-ai-hit.yes { border-left: 3px solid var(--primary); }
.tf-ai-hit.no { border-left: 3px solid #CBD5E1; }
.tf-ai-hit b { font-size: 12.5px; }
.tf-ai-hit span { color: var(--ink2); font-size: 12px; }
.tf-ai-why { display: flex; flex-direction: column; gap: 4px; }
.tf-ai-why > div { font-size: 12px; color: var(--ink2); }
.tf-ai-why .tf-dim { margin-left: 8px; }

/* ---------- 分解行 ---------- */
.tf-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.tf-drow, .tf-prow { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.tf-check { flex: none; padding-top: 6px; }
.tf-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.tf-drow-main, .tf-prow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tf-drow-hd { display: flex; align-items: center; gap: 8px; }
.tf-drow-hd .select { width: auto; min-width: 140px; height: 30px; font-size: 12.5px; }
.tf-drow-num, .tf-prow-num { flex: none; display: flex; align-items: center; gap: 6px; }
.tf-drow-num label, .tf-prow-num label { font-size: 11.5px; color: var(--muted); }
.tf-drow-num .input, .tf-prow-num .input { width: 78px; height: 32px; font-size: 12.5px; }
.tf-drow-num .input[type="date"] { width: 132px; }
.tf-prow-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.tf-why { font-size: 11px; color: var(--muted); background: #F1F5FB; border-radius: 6px; padding: 1px 6px; }
.tf-person-add { margin-top: 4px; }
.tf-person-add .select { width: auto; min-width: 200px; height: 32px; font-size: 12.5px; }

/* ---------- 工时弹窗 ---------- */
.tf-quick { display: flex; gap: 6px; margin: -4px 0 12px; }
.tf-quick .chip { cursor: pointer; }
.tf-entries { display: flex; flex-direction: column; gap: 6px; }
.tf-entry { display: flex; align-items: center; gap: 10px; font-size: 12.5px; background: #F7F9FD; border-radius: 8px; padding: 7px 10px; }
.tf-entry .tf-notes { flex: 1; min-width: 0; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-entry b { color: var(--primary); }
.tf-reject-box { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 12px; }

/* ---------- 详情 ---------- */
.tf-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: #F7F9FD; border-radius: 12px; padding: 14px 16px; }
.tf-detail-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tf-detail-grid .k { font-size: 11.5px; color: var(--muted); }
.tf-detail-grid .v { font-size: 13px; color: var(--ink); }
.tf-desc { font-size: 12.5px; color: var(--ink2); line-height: 1.75; background: #F7F9FD; border-radius: 10px; padding: 10px 12px; }
.tf-kids { display: flex; flex-direction: column; gap: 6px; }
.tf-kid { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.tf-kid:hover { border-color: #BFD3FF; background: #F8FAFF; }
.tf-kid-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tf-kid-main b { font-size: 13px; font-weight: 500; }
.tf-kid-main .tf-dim { font-size: 11.5px; }
.tf-arrow { color: #94A3B8; }
.tf-timeline { display: flex; flex-direction: column; gap: 10px; }
.tf-tl { display: flex; gap: 10px; font-size: 12.5px; }
.tf-tl-ico { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #F1F5FB; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.tf-tl-hd { font-size: 11.5px; color: var(--muted); }
.tf-tl-tx { color: var(--ink2); line-height: 1.6; }

/* ---------- 与我相关：顶部提醒条 ---------- */
.tf-alert { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer;
  background: linear-gradient(90deg, #FFF8EC, #FFFDF8); border: 1px solid #FAD9A8;
  border-left: 3px solid #F59E0B; border-radius: 12px; padding: 11px 16px; margin: 14px 0 2px; }
.tf-alert:hover { background: linear-gradient(90deg, #FFF3DF, #FFFCF4); border-color: #F5C77E; }
.tf-alert-t { font-size: 13.5px; color: #8A4B00; }
.tf-alert-t b { font-size: 16px; color: #B45309; }
.tf-alert-d { font-size: 12.5px; color: #9A6B2F; }
.tf-alert-go { font-size: 12.5px; font-weight: 600; color: var(--primary); white-space: nowrap; }

/* ---------- 我的任务 ---------- */
.tf-mine { display: flex; flex-direction: column; gap: 14px; }
.tf-sec { padding: 0 0 6px; overflow: hidden; }
.tf-sec-hd { display: flex; align-items: center; gap: 8px; padding: 14px 18px 10px; flex-wrap: wrap; }
.tf-sec-hd h3 { font-size: 14px; font-weight: 600; }
.tf-sec-hd .tf-dim { font-size: 11.5px; }
.tf-myrows { display: flex; flex-direction: column; }
.tf-myrow { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid #F1F4F9; }
.tf-myrow:hover { background: #F8FAFF; }
.tf-myrow.over { background: #FFFBFB; }
.tf-myrow.over:hover { background: #FFF6F6; }
.tf-myrow-main { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.tf-myrow-t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.tf-myrow-t b { font-weight: 600; }
.tf-myrow-main:hover .tf-myrow-t b { color: var(--primary); }
.tf-myrow-s { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.tf-myrow-last { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.tf-myrow-act { flex: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- 四列看板：待开始 / 进行中 / 待验收 / 已完成 ---------- */
.kanban.kanban-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1400px) { .kanban.kanban-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1000px) { .kanban.kanban-4 { grid-template-columns: 1fr; } }

/* ---------- 进展：编辑区与图片 ---------- */
.tf-note-form { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #FBFCFE; }
.tf-note-form .textarea { min-height: 62px; resize: vertical; background: #fff; }
.tf-note-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tf-note-tip { font-size: 11.5px; }
.tf-pics { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tf-pic { position: relative; width: 62px; height: 62px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.tf-pic img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.tf-pic-x { position: absolute; top: 2px; right: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: rgba(15, 23, 42, .62); color: #fff; font-size: 10px; line-height: 17px; text-align: center; cursor: pointer; }
.tf-pic-add { width: 62px; height: 62px; border: 1.5px dashed #C7D7F5; border-radius: 9px; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--muted); cursor: pointer; }
.tf-pic-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.tf-pic-plus { font-size: 15px; line-height: 1; }
.tf-tl-atts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.tf-att { width: 66px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.tf-att:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.tf-tl-main { min-width: 0; }
.tf-tl.note .tf-tl-tx { color: var(--ink); }
.tf-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(8, 15, 30, .78);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.tf-lightbox-bd { max-width: 92vw; max-height: 92vh; background: #fff; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; }
.tf-lightbox-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 14px; font-size: 12.5px; color: var(--ink2); border-bottom: 1px solid var(--line); }
.tf-lightbox-hd button { color: var(--muted); font-size: 15px; cursor: pointer; }
.tf-lightbox-bd img { max-width: 92vw; max-height: calc(92vh - 46px); object-fit: contain; display: block; }

/* 我负责 / 我创建的任务在看板与任务树上加标识，便于一眼区分 */
.tf-card.mine { border-left: 3px solid #10B981; }
.tf-node.mine > .tf-node-main { background: #F6FEFB; }
.tf-node.mine > .tf-node-main:hover { background: #EFFBF6; }

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .tf-myrow { flex-wrap: wrap; padding: 11px 14px; }
  .tf-myrow-act { width: 100%; justify-content: flex-start; }
  .tf-myrow-last { max-width: 100%; }
  .tf-alert { padding: 10px 12px; }
  .tf-mode-pick { grid-template-columns: 1fr; }
  .tf-lead-grid { grid-template-columns: 1fr; }
  .tf-detail-grid { grid-template-columns: 1fr 1fr; }
  .tf-node-main { flex-wrap: wrap; }
  .tf-node-hours { flex-direction: row; gap: 10px; min-width: 0; }
  .tf-node-act { width: 100%; max-width: none; justify-content: flex-start; }
  .tf-children { margin-left: 8px; padding-left: 6px; }
  .tf-drow, .tf-prow { flex-wrap: wrap; }
  .tf-drow-num, .tf-prow-num { width: 100%; justify-content: flex-start; }
  .tf-drow-num .input, .tf-prow-num .input { flex: 1; min-width: 0; }
  .tf-table .tf-note { max-width: 180px; }
  .tf-tip { display: none; }
}

/* 改派 / 协同负责人弹窗：成员多选块 */
.tf-co-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; }
.tf-co { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 6px 8px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.tf-co:hover { background: #F6F9FF; }
.tf-co.on { background: var(--primary-soft, #EDF3FF); border-color: var(--primary, #2B5BD7); }
.tf-co input { margin: 0; }

/* 任务搜索栏（我的任务 / 看板 / 任务树） */
.tf-search { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.tf-search .input { flex: 1; max-width: 460px; height: 34px; }
.tf-search .btn-ghost { flex: 0 0 auto; }

/* 「我的任务」分区折叠开关 */
.tf-sec-fold { margin-left: auto; font-size: 12px; color: var(--muted); flex: 0 0 auto; }
