/* ============================================================
 * 阶段4 商户后台待办台首屏 · 紫蓝品牌组件（深色主题适配）
 * 方案文档 §4：待办区 + 健康度圆环 + 快捷宫格 + 跨域分润卡
 * 复用 :root 的 --brand 系列变量（styles.css 已落地）
 * 适配 merchant 后台深色主题（dash-dark）
 * ============================================================ */

/* ---------- 待办台容器 ---------- */
.stage4-todo-shell {
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}
@media (max-width: 1024px) {
  .stage4-todo-shell { grid-template-columns: 1fr; }
}

/* ---------- 待办区（左栏） ---------- */
.stage4-todo-panel {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 14px;
  padding: 18px 20px;
  backdrop-filter: blur(8px);
}
.stage4-todo-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.stage4-todo-title {
  font-size: 16px; font-weight: 700; color: #e0e7ff;
  display: flex; align-items: center; gap: 8px;
}
.stage4-todo-title::before {
  content: ''; width: 4px; height: 18px;
  background: var(--gradient-brand); border-radius: 2px;
}
.stage4-todo-count {
  padding: 2px 10px; font-size: 12px; font-weight: 600;
  background: rgba(239, 68, 68, 0.18); color: #fca5a5;
  border-radius: 10px; border: 1px solid rgba(239, 68, 68, 0.3);
}
.stage4-todo-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
@media (max-width: 640px) { .stage4-todo-list { grid-template-columns: 1fr; } }
.stage4-todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.stage4-todo-item:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(30, 41, 59, 0.8);
}
.stage4-todo-item.urgent {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(127, 29, 29, 0.18);
}
.stage4-todo-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  background: rgba(99, 102, 241, 0.18);
}
.stage4-todo-item.urgent .stage4-todo-icon { background: rgba(239, 68, 68, 0.2); }
.stage4-todo-info { flex: 1; min-width: 0; }
.stage4-todo-label { font-size: 13px; color: #cbd5e1; font-weight: 500; }
.stage4-todo-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.stage4-todo-badge {
  padding: 2px 8px; font-size: 11px; font-weight: 700;
  border-radius: 8px; flex-shrink: 0;
}
.stage4-todo-badge.urgent { background: #ef4444; color: #fff; }
.stage4-todo-badge.normal { background: rgba(99, 102, 241, 0.3); color: #c7d2fe; }
.stage4-todo-empty {
  text-align: center; padding: 24px; color: #64748b; font-size: 13px;
}

/* ---------- 健康度圆环（右栏） ---------- */
.stage4-health-panel {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex; flex-direction: column; align-items: center;
  backdrop-filter: blur(8px);
}
.stage4-health-title {
  font-size: 14px; font-weight: 700; color: #e0e7ff;
  margin-bottom: 14px; align-self: stretch;
  display: flex; align-items: center; gap: 8px;
}
.stage4-health-title::before {
  content: ''; width: 4px; height: 16px;
  background: var(--gradient-brand); border-radius: 2px;
}
.stage4-health-ring {
  position: relative; width: 140px; height: 140px;
  margin-bottom: 12px;
}
.stage4-health-ring svg { transform: rotate(-90deg); }
.stage4-health-ring-bg { stroke: rgba(99, 102, 241, 0.15); }
.stage4-health-ring-fg {
  stroke: url(#stage4GradBrand);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}
.stage4-health-ring-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.stage4-health-score { font-size: 32px; font-weight: 800; color: #818cf8; line-height: 1; }
.stage4-health-label { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* 四维拆解 */
.stage4-health-breakdown {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  width: 100%; margin-top: 8px;
}
.stage4-health-bd-item { text-align: center; }
.stage4-health-bd-label { font-size: 10px; color: #94a3b8; margin-bottom: 3px; }
.stage4-health-bd-bar { height: 5px; background: rgba(99,102,241,0.15); border-radius: 3px; overflow: hidden; }
.stage4-health-bd-fill { height: 100%; background: var(--gradient-brand); border-radius: 3px; transition: width 0.6s; }
.stage4-health-bd-val { font-size: 11px; font-weight: 600; color: #a5b4fc; margin-top: 2px; }

/* ---------- 快捷宫格 ---------- */
.stage4-quick-grid {
  margin-top: 16px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
@media (max-width: 640px) { .stage4-quick-grid { grid-template-columns: repeat(4, 1fr); } }
.stage4-quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.stage4-quick-item:hover {
  background: rgba(79, 70, 229, 0.18);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}
.stage4-quick-icon { font-size: 20px; }
.stage4-quick-label { font-size: 11px; color: #cbd5e1; text-align: center; }

/* ---------- 跨域收益今日分润卡 ---------- */
.stage4-rebate-card {
  margin-top: 16px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.25) 0%, rgba(99, 102, 241, 0.15) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.stage4-rebate-left { flex: 1; }
.stage4-rebate-title {
  font-size: 13px; font-weight: 600; color: #c7d2fe;
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.stage4-rebate-amount {
  font-size: 28px; font-weight: 800; color: #fff;
  line-height: 1;
}
.stage4-rebate-amount::before { content: '¥'; font-size: 18px; margin-right: 2px; opacity: 0.8; }
.stage4-rebate-meta { font-size: 11px; color: #a5b4fc; margin-top: 6px; }
.stage4-rebate-right {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.stage4-rebate-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.stage4-rebate-detail {
  font-size: 11px; color: #a5b4fc; cursor: pointer;
}
.stage4-rebate-detail:hover { color: #c7d2fe; text-decoration: underline; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .stage4-todo-shell { gap: 12px; }
  .stage4-todo-panel, .stage4-health-panel { padding: 14px; }
  .stage4-todo-list { grid-template-columns: 1fr; }
  .stage4-health-ring { width: 120px; height: 120px; }
  .stage4-health-score { font-size: 28px; }
  .stage4-quick-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .stage4-quick-item { padding: 10px 4px; }
  .stage4-quick-icon { font-size: 18px; }
  .stage4-quick-label { font-size: 10px; }
  .stage4-rebate-card { flex-direction: column; align-items: stretch; text-align: center; }
  .stage4-rebate-right { flex-direction: row; justify-content: center; }
}
