/* ============ 我的任务工作台 ============ */
.wb-page { display: flex; flex-direction: column; gap: 14px; }
.wb-page .page-head { margin-bottom: 0; align-items: flex-start; }

/* ---------- 页头 ---------- */
.wb-role-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: var(--r-xs); font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
}
.wb-role-manager { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.wb-role-executor { background: var(--green-bg); color: var(--green-600); border: 1px solid var(--green-line); }
.wb-sub-strong { color: var(--ink-2); font-weight: 600; }
.wb-sub-dot { color: #D0D5DD; }
.wb-sub-soft { color: var(--ink-4); }
.wb-scope-tabs { margin-right: 2px; }
#wb-tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
#wb-tabs::-webkit-scrollbar { display: none; }
#wb-tabs .tab { flex: none; }
@media (max-width: 640px) {
  #wb-tabs { width: 100%; }
  .wb-scope-tabs { width: 100%; }
}

/* ---------- 顶部统计卡 ---------- */
.wb-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.wb-stat {
  position: relative; display: block; width: 100%; text-align: left; overflow: hidden;
  padding: 13px 14px 11px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-xs); cursor: pointer; font-family: inherit;
  transition: box-shadow var(--t-base), transform var(--t-base), border-color var(--t-base);
}
.wb-stat:hover { box-shadow: var(--shadow-md); border-color: #D8E2F2; transform: translateY(-1px); }
.wb-stat-rail { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--wb-tone); }
.wb-stat.is-active { border-color: var(--wb-tone); box-shadow: 0 0 0 3px var(--wb-tone-soft), var(--shadow-xs); }
.wb-tone-gray { --wb-tone: #98A2B3; --wb-tone-soft: #F2F4F7; }
.wb-tone-blue { --wb-tone: var(--brand); --wb-tone-soft: var(--brand-50); }
.wb-tone-orange { --wb-tone: var(--orange); --wb-tone-soft: var(--orange-bg); }
.wb-tone-red { --wb-tone: var(--red); --wb-tone-soft: var(--red-bg); }
.wb-tone-green { --wb-tone: var(--green); --wb-tone-soft: var(--green-bg); }
.wb-stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wb-stat-label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.wb-stat-icon {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: var(--wb-tone-soft); color: var(--wb-tone);
  display: inline-flex; align-items: center; justify-content: center;
}
.wb-stat-num { display: block; font-size: 26px; line-height: 1.15; color: var(--ink); margin-top: 4px; letter-spacing: -.6px; }
.wb-stat-trend {
  display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 11px;
  color: var(--ink-3); min-width: 0;
}
.wb-stat-trend .icon { color: var(--wb-tone); flex: none; }
.wb-stat-trend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 两栏布局 ---------- */
.wb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 324px; gap: 16px; align-items: start; }
.wb-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wb-rail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---------- 列表头 ---------- */
.wb-list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 11px; box-shadow: var(--shadow-xs); flex-wrap: wrap;
}
.wb-list-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wb-filter-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 5px 0 8px;
  border-radius: 5px; background: var(--brand-50); border: 1px solid var(--brand-100);
  color: var(--brand); font-size: 11.5px;
}
.wb-filter-chip b { font-weight: 600; }
.wb-filter-chip button {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border: 0; border-radius: 4px; background: transparent; color: var(--brand); cursor: pointer; padding: 0;
}
.wb-filter-chip button:hover { background: #DCE8FF; }

/* ---------- 任务卡片 ---------- */
.wb-task-list { display: flex; flex-direction: column; gap: 10px; }
.wb-task {
  padding: 12px 15px 0; cursor: pointer;
  transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
}
.wb-task:hover { box-shadow: var(--shadow-md); border-color: #D8E2F2; transform: translateY(-1px); }
.wb-task:hover .wb-task-name { color: var(--brand); }
.wb-task:focus-visible { outline: 2px solid rgba(31, 107, 255, .45); outline-offset: 2px; }
.wb-task-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wb-task-instance {
  font-size: 11.5px; color: var(--ink-3); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wb-task-badges { display: flex; align-items: center; gap: 5px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.wb-task-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.wb-task-name {
  font-size: 14.5px; font-weight: 650; letter-spacing: -.2px; color: var(--ink);
  line-height: 1.4; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color var(--t-fast);
}
.wb-due {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px;
  border-radius: 5px; background: #F4F6FA; color: var(--ink-3); font-size: 11px;
  white-space: nowrap; flex: none; font-variant-numeric: tabular-nums;
}
.wb-due-red { background: var(--red-bg); color: var(--red-600); }
.wb-due-orange { background: var(--orange-bg); color: var(--orange-600); }
.wb-due-green { background: var(--green-bg); color: var(--green-600); }
.wb-task-meta {
  display: flex; align-items: center; gap: 12px; margin-top: 7px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--ink-3); row-gap: 5px;
}
.wb-meta-code {
  font-size: 11px; color: var(--ink-3); background: #F7F9FC; border: 1px solid var(--line-2);
  border-radius: 4px; padding: 1px 6px; letter-spacing: -.1px;
}
.wb-meta-person { display: inline-flex; align-items: center; gap: 5px; }
.wb-meta-label { color: var(--ink-4); font-size: 10.5px; }
.wb-meta-person .u-name { font-size: 12px; }
.wb-meta-secondary { color: var(--ink-3); }
.wb-meta-group { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-4); min-width: 0; }
.wb-meta-group .icon { color: var(--ink-4); }
.wb-task-progress-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.wb-progress-label { font-size: 10.5px; color: var(--ink-4); flex: none; }
.wb-progress-track { flex: 1; min-width: 0; display: block; }
.wb-progress-pct { font-size: 11.5px; color: var(--ink-2); min-width: 38px; text-align: right; }
.wb-task-summary {
  margin-top: 8px; font-size: 12px; color: var(--ink-3); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wb-sum-mark {
  display: inline-flex; align-items: center; height: 16px; padding: 0 5px; margin-right: 6px;
  border-radius: 3px; background: #EEF2F8; color: var(--ink-3); font-size: 10px; font-weight: 500;
  vertical-align: 1px; letter-spacing: .02em;
}
.wb-task-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 10px -15px 0; padding: 8px 15px; border-top: 1px dashed var(--line-2);
  background: #FCFDFF; border-radius: 0 0 10px 10px;
}
.wb-task-updated { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-4); }
.wb-task-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- 分页 / 空态 / 骨架屏 ---------- */
.wb-list-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 2px 2px 0; font-size: 12px; color: var(--ink-3); flex-wrap: wrap;
}
.wb-foot-info b { color: var(--ink-2); font-weight: 600; }
.wb-empty { overflow: hidden; }
.wb-empty-actions { display: flex; justify-content: center; gap: 8px; padding: 0 20px 30px; margin-top: -18px; }
.wb-skel {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.wb-skel-line {
  height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, #EEF2F8 25%, #F7F9FC 37%, #EEF2F8 63%);
  background-size: 400% 100%; animation: wbShimmer 1.2s ease infinite;
}
.wb-skel-line.w30 { width: 30%; } .wb-skel-line.w45 { width: 45%; }
.wb-skel-line.w70 { width: 70%; } .wb-skel-line.w85 { width: 85%; }
@keyframes wbShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 右侧栏 ---------- */
.wb-rail-card .card-head { padding: 13px 14px 0; align-items: flex-start; }
.wb-rail-card .card-title { font-size: 13.5px; }
.wb-rail-card .card-sub { font-size: 10.5px; margin-top: 2px; }
.wb-rail-card .card-body { padding: 11px 10px 12px; }
.wb-rail-card .chip { height: 20px; font-size: 10px; padding: 0 6px; }
.wb-rail-card .link-btn { font-size: 11.5px; }
.wb-focus-tip {
  display: flex; gap: 7px; padding: 8px 9px; border-radius: 7px; margin: 0 4px 7px;
  font-size: 11.5px; line-height: 1.6; border: 1px solid transparent;
}
.wb-focus-tip .icon { flex: none; margin-top: 1px; }
.wb-focus-tip-danger { background: var(--red-bg); border-color: var(--red-line); color: #912018; }
.wb-focus-tip-danger .icon { color: var(--red); }
.wb-focus-tip-warn { background: var(--orange-bg); border-color: var(--orange-line); color: #8A4B00; }
.wb-focus-tip-warn .icon { color: var(--orange); }
.wb-focus-tip-info { background: var(--brand-50); border-color: var(--brand-100); color: #1D4F9C; }
.wb-focus-tip-info .icon { color: var(--brand); }
.wb-focus-tip-safe { background: var(--green-bg); border-color: var(--green-line); color: var(--green-600); }
.wb-focus-tip-safe .icon { color: var(--green); }
.wb-focus-rows { display: flex; flex-direction: column; gap: 1px; }
.wb-focus-row {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px;
  border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left;
  transition: background var(--t-fast);
}
.wb-focus-row:hover { background: var(--hover-blue); }
.wb-focus-icon {
  width: 24px; height: 24px; border-radius: 6px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.wb-focus-red { background: var(--red-bg); color: var(--red); }
.wb-focus-orange { background: var(--orange-bg); color: var(--orange); }
.wb-focus-purple { background: var(--purple-bg); color: var(--purple); }
.wb-focus-blue { background: var(--brand-50); color: var(--brand); }
.wb-focus-fuchsia { background: #FDF2FA; color: #C11574; }
.wb-focus-label { font-size: 12.5px; color: var(--ink-2); }
.wb-focus-num { margin-left: auto; font-size: 14px; color: var(--ink); }
.wb-focus-arrow { color: var(--ink-4); flex: none; }

/* 最近动态 */
.wb-activity-body { display: flex; flex-direction: column; }
.wb-activity-item {
  display: flex; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 7px;
  background: transparent; text-align: left; cursor: pointer; transition: background var(--t-fast);
}
.wb-activity-item + .wb-activity-item { border-top: 1px solid var(--line-2); border-radius: 0; }
.wb-activity-item:hover { background: var(--hover-blue); }
.wb-activity-avatar { flex: none; margin-top: 1px; }
.wb-activity-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wb-activity-top { display: flex; align-items: center; gap: 5px; }
.wb-activity-op { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.wb-activity-top .tag { height: 17px; padding: 0 4px; font-size: 10px; border-radius: 3px; }
.wb-activity-time { margin-left: auto; font-size: 10px; color: var(--ink-4); white-space: nowrap; }
.wb-activity-text {
  font-size: 11px; color: var(--ink-3); line-height: 1.55; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wb-activity-task {
  font-size: 10px; color: var(--ink-4); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 快捷动作 */
.wb-quick { display: flex; flex-direction: column; gap: 7px; }
.wb-quick-btn { justify-content: flex-start; height: 33px; padding: 0 11px; font-size: 12.5px; }
.wb-quick-btn.btn-ghost { color: var(--ink-3); }
.wb-quick-btn.btn-ghost:hover { background: #F2F5FA; color: var(--ink); }
.wb-quick-btn .icon { color: currentColor; opacity: .9; }

/* 按钮 loading */
.is-spinning .icon { animation: spin 1s linear infinite; }

/* 兜底弹窗内的表单 */
.wb-form .alert { align-items: flex-start; }
.wb-range-row { display: flex; align-items: center; gap: 10px; }
.wb-range { flex: 1; accent-color: var(--brand); height: 4px; }
.wb-range-num { width: 76px; flex: none; text-align: center; }
.wb-range-unit { font-size: 12px; color: var(--ink-3); }
.wb-chip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-draft { min-height: 180px; font-size: 12px; line-height: 1.7; }

/* ---------- 响应式 ---------- */
@media (max-width: 1360px) {
  .wb-layout { grid-template-columns: minmax(0, 1fr) 312px; }
}
@media (max-width: 1180px) {
  .wb-layout { grid-template-columns: minmax(0, 1fr); }
  .wb-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .wb-rail .wb-focus-card { grid-column: span 1; }
  .wb-rail .wb-quick-card { grid-column: span 2; }
  .wb-rail .wb-quick { flex-direction: row; flex-wrap: wrap; }
  .wb-rail .wb-quick .btn { flex: 1 1 180px; justify-content: center; }
}
@media (max-width: 1100px) {
  .wb-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .wb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-rail { grid-template-columns: minmax(0, 1fr); }
  .wb-rail .wb-quick-card { grid-column: span 1; }
  .wb-task-title-row { flex-direction: column; align-items: flex-start; gap: 5px; }
  .wb-task-name { white-space: normal; }
  .wb-task-foot { flex-wrap: wrap; }
}
