/*
 * [FILE ROLE NOTE] 任务中心样式表
 * 功能: 负责任务中心列表、筛选栏、抽屉、时间轴样式。
 * 调用方: task-center.html
 * 依赖: 依赖 task-center.js 输出的 class
 * 删除建议: 不建议删；任务中心样式会乱
 */
.task-center-page {
  min-height: 100vh;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 24%),
    linear-gradient(180deg, #f7faff 0%, #f2f6fb 100%);
}

.task-center-shell {
  max-width: 1680px;
  margin: 0 auto;
}

/* 统计卡片 */
.task-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.task-stat-card {
  padding: 18px 18px 16px;
  border-radius: 20px;
  border: 1px solid #e5edf6;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.task-stat-card__label {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 10px;
}

.task-stat-card__value {
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.04em;
}

/* 场景栏 */
.task-scene-bar {
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.task-scene-bar__label {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
  color: #475569;
}

.task-scene-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-scene-tab {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.task-scene-tab:hover {
  transform: translateY(-1px);
  background: #f8fafc;
}

.task-scene-tab.is-active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

/* 工具栏 */
.task-toolbar {
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.task-toolbar__row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.task-toolbar__row + .task-toolbar__row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #dbe3ef;
}

.task-toolbar__row--between {
  justify-content: space-between;
}

.task-toolbar__search {
  flex: 1;
  min-width: 280px;
}

.task-toolbar__date {
  width: 220px;
  max-width: 100%;
}

.task-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.task-input:focus {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.task-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-status-tab {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.task-status-tab:hover {
  transform: translateY(-1px);
  background: #f8fafc;
}

.task-status-tab.is-active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #0f172a, #334155);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.14);
}

.task-batch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.task-checkbox {
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-checkbox input {
  accent-color: #2563eb;
}

/* 通用按钮 */
.task-action-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.task-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.task-action-btn--primary {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.task-action-btn--primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
}

.task-action-btn--danger {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.16);
}

.task-action-btn--danger:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
}

/* 列表 */
.task-table {
  display: grid;
  grid-template-columns: 48px 1.2fr 1.45fr 1.05fr 0.95fr 0.85fr;
  gap: 14px;
  align-items: stretch;
}

.task-table--head {
  padding: 0 16px 12px;
  margin-bottom: 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.task-table-body {
  padding: 14px;
  border-radius: 24px;
  border: 1px solid #e7eef7;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.task-table--row {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid #edf2f7;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.task-table--row + .task-table--row {
  margin-top: 12px;
}

.task-table--row:hover {
  transform: translateY(-2px);
  background: #fbfdff;
  border-color: rgba(37, 99, 235, 0.14);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.task-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.task-col--check {
  align-items: center;
  justify-content: flex-start;
  padding-top: 8px;
}

.task-col--check input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.task-company-name {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 800;
  color: #0f172a;
  word-break: break-word;
}

.task-company-meta {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
  word-break: break-word;
}

.task-subject {
  font-size: 14px;
  line-height: 1.7;
  color: #0f172a;
  font-weight: 700;
  word-break: break-word;
}

.task-stage {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
}

.task-status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.task-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.task-pill--ok {
  background: #ecfdf5;
  color: #047857;
}

.task-pill--warn {
  background: #fff7ed;
  color: #c2410c;
}

.task-pill--muted {
  background: #f1f5f9;
  color: #475569;
}

.task-pill--danger {
  background: #fef2f2;
  color: #b91c1c;
}

.task-meta-time {
  font-size: 13px;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.6;
}

.task-meta-open {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
}

.task-meta-mailbox {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
  word-break: break-word;
}

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

.task-row-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.task-row-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.task-row-btn--primary {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.task-row-btn--primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
}

.task-row-btn--danger {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.task-row-btn--danger:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
}

/* 空状态 */
.task-empty-state {
  min-height: 360px;
  padding: 48px 20px;
  border-radius: 24px;
  border: 1px solid #e7eef7;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.task-empty-state__icon {
  font-size: 42px;
  margin-bottom: 14px;
}

.task-empty-state__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

.task-empty-state__desc {
  max-width: 520px;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.9;
  color: #64748b;
}

.task-empty-state__actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.task-empty-state__btn {
  min-width: 180px;
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
  border: none;
}

.task-empty-state__btn--ghost {
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  box-shadow: none;
}

/* 抽屉遮罩 */
.task-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 120;
  animation: taskFadeIn 0.2s ease;
}

@keyframes taskFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 抽屉 */
.task-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(560px, 92vw);
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid #e5edf6;
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.14);
  z-index: 130;
  transform: translateX(106%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
}

.task-drawer.is-open {
  transform: translateX(0);
}

.task-drawer__header {
  padding: 22px 22px 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.task-drawer__eyebrow {
  margin-bottom: 8px;
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.task-drawer__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  word-break: break-word;
}

.task-drawer__desc {
  margin: 8px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.7;
}

.task-drawer__close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  font-size: 18px;
  flex-shrink: 0;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.task-drawer__close:hover {
  transform: translateY(-1px);
  background: #f8fafc;
  border-color: #cbd5e1;
}

.task-drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 24px;
}

.task-drawer-section + .task-drawer-section {
  margin-top: 18px;
}

.task-drawer-section__title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
  color: #334155;
}

.task-drawer-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #e7eef7;
  background: #fdfefe;
  font-size: 13px;
  color: #334155;
  line-height: 1.85;
  word-break: break-word;
}

.task-drawer-card--body {
  white-space: pre-wrap;
}

.task-drawer-line + .task-drawer-line {
  margin-top: 8px;
}

.task-drawer-line--form {
  margin-top: 12px;
}

.task-drawer__footer {
  padding: 16px 22px 20px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* 输入控件 */
.task-edit-input,
.task-edit-textarea,
.task-edit-select,
.task-create-select,
.task-create-input,
.task-create-textarea {
  width: 100%;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #0f172a;
  border-radius: 14px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
  font: inherit;
}

.task-edit-input,
.task-edit-select,
.task-create-select,
.task-create-input {
  min-height: 46px;
  padding: 0 14px;
}

.task-edit-textarea,
.task-create-textarea {
  min-height: 220px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.8;
}

.task-edit-input:focus,
.task-edit-textarea:focus,
.task-edit-select:focus,
.task-create-select:focus,
.task-create-input:focus,
.task-create-textarea:focus {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

/* 批量生成弹层 */
.task-create-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 140;
}

.task-create-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  transform: translate(-50%, -50%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  border-radius: 24px;
  border: 1px solid #e7eef7;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transition: all 0.22s ease;
}

.task-create-modal.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.task-create-modal__header {
  padding: 22px 22px 18px;
  border-bottom: 1px solid #e7eef7;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.task-create-modal__eyebrow {
  margin-bottom: 8px;
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.task-create-modal__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.task-create-modal__desc {
  margin: 8px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.7;
}

.task-create-modal__close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #334155;
  font-size: 18px;
  flex-shrink: 0;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.task-create-modal__close:hover {
  transform: translateY(-1px);
  background: #f8fafc;
  border-color: #cbd5e1;
}

.task-create-modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 24px;
}

.task-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.task-create-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-create-field--full {
  grid-column: 1 / -1;
}

.task-create-label {
  font-size: 12px;
  color: #475569;
  font-weight: 700;
}

.task-create-modal__footer {
  padding: 16px 22px 20px;
  border-top: 1px solid #e7eef7;
  background: #ffffff;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* 响应式 */
@media (max-width: 1440px) {
  .task-table {
    grid-template-columns: 44px 1.15fr 1.35fr 1fr 0.95fr 0.8fr;
    gap: 12px;
  }
}

@media (max-width: 1280px) {
  .task-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .task-table--head {
    display: none;
  }

  .task-table--row {
    grid-template-columns: 42px 1fr;
    gap: 12px 14px;
  }

  .task-col--company,
  .task-col--subject,
  .task-col--status,
  .task-col--meta,
  .task-col--actions {
    grid-column: 2 / 3;
  }
}

@media (max-width: 1024px) {
  .task-center-page {
    padding: 14px;
  }

  .task-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-toolbar__row--between {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-batch-actions {
    width: 100%;
  }

  .task-action-btn {
    flex: 1;
  }
}

@media (max-width: 900px) {
  .task-create-grid {
    grid-template-columns: 1fr;
  }

  .task-create-modal {
    width: min(100vw - 20px, 860px);
    max-height: calc(100vh - 20px);
  }
}

@media (max-width: 768px) {
  .task-stats-grid {
    grid-template-columns: 1fr;
  }

  .task-toolbar,
  .task-scene-bar,
  .task-table-body,
  .task-empty-state {
    border-radius: 18px;
  }

  .task-toolbar__search,
  .task-toolbar__date {
    width: 100%;
    min-width: 0;
  }

  .task-drawer {
    width: 100vw;
  }

  .task-drawer__header,
  .task-drawer__body,
  .task-drawer__footer,
  .task-create-modal__header,
  .task-create-modal__body,
  .task-create-modal__footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .task-drawer__footer,
  .task-create-modal__footer {
    flex-direction: column;
  }

  .task-drawer__footer .task-action-btn,
  .task-create-modal__footer .task-action-btn {
    width: 100%;
  }

  .task-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .task-center-page {
    padding: 10px;
  }

  .task-stat-card {
    padding: 16px 16px 14px;
  }

  .task-stat-card__value {
    font-size: 26px;
  }

  .task-scene-tabs,
  .task-status-tabs,
  .task-batch-actions {
    width: 100%;
  }

  .task-scene-tab,
  .task-status-tab,
  .task-action-btn {
    width: 100%;
    justify-content: center;
  }

  .task-empty-state__actions {
    width: 100%;
    flex-direction: column;
  }

  .task-empty-state__btn {
    width: 100%;
  }

  .task-row-actions {
    grid-template-columns: 1fr;
  }
}

/* ========== v4 collaboration patch ========== */
.task-toolbar__row--filters-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(5, minmax(0, 1fr));
}
.task-owner-mini {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}
.task-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-timeline__item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
}
.task-timeline__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  margin-top: 6px;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.08);
}
.task-timeline__content {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid #e2e8f0;
}
.task-timeline__title { font-size: 13px; font-weight: 800; color: #0f172a; }
.task-timeline__desc { margin-top: 6px; font-size: 12px; color: #475569; }
.task-timeline__time { margin-top: 8px; font-size: 12px; color: #64748b; }

@media (max-width: 1320px) {
  .task-toolbar__row--filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .task-toolbar__search { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .task-toolbar__row--filters-grid {
    grid-template-columns: 1fr;
  }
}
