/* 伴学中心 — 仅包含伴学新增样式，复用 agents.css 的 .agent-page/.plan-card/.task-card 等 */

/* ── 空状态 ── */
.companion-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light, #6b7280);
}
.companion-empty .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.companion-empty .empty-title { font-size: 1.25rem; font-weight: 600; color: var(--text, #1f2937); margin-bottom: 8px; }
.companion-empty p { margin-bottom: 18px; }

/* ── Hero / 目标链 ── */
.companion-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 22px;
}
.hero-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-greet { font-size: 1.05rem; font-weight: 600; color: #1e3a8a; }
.hero-badge {
  font-size: 0.78rem; padding: 3px 10px; border-radius: 999px;
  background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd;
}
.goal-chain { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.goal-node {
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 10px 14px; min-width: 150px;
}
.goal-node.past { border-style: dashed; opacity: 0.85; }
.goal-node.target { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.goal-dot { color: #9ca3af; }
.goal-flag { font-size: 0.72rem; font-weight: 700; color: #2563eb; }
.goal-label { font-weight: 600; color: #1f2937; font-size: 0.95rem; }
.goal-countdown {
  font-size: 0.8rem; color: #b45309; background: #fef3c7;
  padding: 2px 8px; border-radius: 999px; align-self: flex-start;
}
.goal-countdown.urgent { color: #b91c1c; background: #fee2e2; font-weight: 700; }
.goal-date { font-size: 0.75rem; color: #6b7280; }
.goal-arrow { align-self: center; color: #9ca3af; font-weight: 700; }
.hero-note { margin-top: 12px; font-size: 0.8rem; color: #b45309; }

/* ── 通用区块 ── */
.companion-section { margin-bottom: 22px; }
.companion-section-title {
  font-size: 1.1rem; font-weight: 700; color: #1f2937; margin-bottom: 12px;
  display: flex; align-items: baseline; gap: 10px;
}
.section-sub { font-size: 0.8rem; font-weight: 500; color: #6b7280; }
.companion-next-empty {
  color: #6b7280; font-size: 0.92rem; padding: 14px 16px;
  background: var(--bg, #f8fafc); border-radius: 10px; border: 1px dashed #e5e7eb;
}
.inline-link, .inline-link:visited { color: #2563eb; text-decoration: none; font-weight: 600; }
.inline-link:hover { text-decoration: underline; }

/* 下一步任务高亮 */
.next-task { border-color: #2563eb !important; box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }

/* ── 掌握度热力图 ── */
.overall-mastery {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 0.9rem;
}
.om-label { color: #374151; font-weight: 600; white-space: nowrap; }
.overall-mastery .plan-progress { flex: 1; max-width: 320px; }
.plan-progress-pct { color: #2563eb; font-weight: 700; }

.heatmap-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.heat-cell {
  border-radius: 10px; padding: 12px 10px; color: #fff; text-align: center;
  border: 1px solid rgba(0,0,0,0.05); min-height: 78px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.heat-cell.hm-weak { background: #dc2626; }
.heat-cell.hm-mid { background: #d97706; }
.heat-cell.hm-good { background: #059669; }
.heat-name { font-size: 0.82rem; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.heat-val { font-size: 1.15rem; font-weight: 800; }
.heat-trend { font-size: 0.8rem; opacity: 0.9; }

.heatmap-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 0.8rem; color: #6b7280; }
.heatmap-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.heatmap-legend .hm-weak { background: #dc2626; }
.heatmap-legend .hm-mid { background: #d97706; }
.heatmap-legend .hm-good { background: #059669; }

/* ── AI 伴学工具枢纽 ── */
.companion-hub-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px;
}
.hub-card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 16px 12px; text-align: center; transition: transform .12s ease, box-shadow .12s ease;
}
.hub-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); border-color: #bfdbfe; }
.hub-icon { font-size: 1.8rem; margin-bottom: 6px; }
.hub-title { font-weight: 700; color: #1f2937; font-size: 0.95rem; }
.hub-desc { font-size: 0.78rem; color: #6b7280; margin-top: 2px; }
.companion-comingsoon {
  margin-top: 14px; font-size: 0.82rem; color: #6b7280;
  background: #f8fafc; border: 1px dashed #e5e7eb; border-radius: 10px; padding: 10px 14px;
}

/* ── P0 教练式伴学：今日任务 + 教练语 + toast ── */
.today-group { margin-bottom: 14px; }
.today-group-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.95rem;
  margin: 10px 0 8px;
}
.today-group.overdue .today-group-title { color: #b91c1c; }
.today-group.this-week .today-group-title { color: #1d4ed8; }
.today-group.later .today-group-title { color: #6b7280; }
.today-group-count {
  background: #e2e8f0; color: #334155;
  font-size: 0.75rem; padding: 1px 8px; border-radius: 999px;
}
.today-group.overdue .today-group-count { background: #fee2e2; color: #b91c1c; }
.task-complete-btn { margin-left: auto; }
.coach-line {
  margin-top: 12px; padding: 10px 14px;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px;
  color: #9a3412; font-size: 0.9rem; line-height: 1.6;
  white-space: normal;
}
.hero-badge { margin-left: 4px; }
.coach-toast {
  position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  background: #1f2937; color: #f9fafb;
  padding: 12px 18px; border-radius: 12px;
  font-size: 0.9rem; line-height: 1.6; white-space: pre-line;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 9999; animation: coach-toast-in 0.25s ease-out;
}
@keyframes coach-toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ── 薄弱点对应题单 ── */
.companion-rec-lists { display: flex; flex-direction: column; gap: 8px; }
.companion-rec-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 14px;
}
.rec-kp { font-weight: 600; color: #1f2937; font-size: 0.9rem; }
