/* ============================================================
   脉象模拟训练模块样式
   —— 沿用 CRM 现有设计语言（主题 #0ea5a4、圆角 14px、卡片阴影），
      只新增模块专属类，不覆盖任何现有样式。
   ============================================================ */

/* ---------- 模块容器 ---------- */
.pulse-page { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }

/* ---------- 能力提示条 / 免责声明 ---------- */
.pulse-capbar {
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.pulse-capbar-ok { background: #e6f7f6; color: #0c8c8b; border: 1px solid #cdeae9; }
.pulse-capbar-warn { background: #fff7ed; color: #9a5b00; border: 1px solid #fed7aa; }

.pulse-disclaimer {
  background: #f1f5f9;
  color: #64748b;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.pulse-foot-note {
  text-align: center;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.6;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
}

/* ---------- 难度解锁 / 红线卡 ---------- */
.pulse-unlock { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pulse-unlock .badge { background: #f1f5f9; color: #94a3b8; }
.pulse-unlock .badge.badge-stage-member { background: #e6f7f6; color: #0c8c8b; }

.pulse-redcard { border-left: 4px solid #ef4444; }
.pulse-redcard-text { margin: 0; font-size: 14px; line-height: 1.8; color: #b91c1c; }

/* ---------- 免责声明弹窗 ---------- */
.pulse-ds-body { font-size: 14px; line-height: 1.75; }
.pulse-ds-lead { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.pulse-ds-list { margin: 0 0 14px; padding-left: 20px; color: #475569; }
.pulse-ds-list li { margin-bottom: 6px; }
.pulse-ds-check {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  align-items: flex-start;
}
.pulse-ds-check input { margin-top: 2px; min-width: 22px; min-height: 22px; }

/* ---------- 模式切换 ---------- */
.pulse-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.pulse-mode.active { background: #0ea5a4; color: #fff; border-color: #0ea5a4; font-weight: 700; }

/* 兼容：若宿主未定义 .chip 则由本文件兜底 */
.chip {
  border: 1px solid #cdeae9;
  background: #eefaf9;
  color: #0e7a77;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.chip:active { transform: scale(0.96); }

/* ---------- 播放器 ---------- */
.pulse-player { padding-bottom: 12px; }
.pulse-player-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.pulse-qno { font-size: 14px; font-weight: 700; color: #0c8c8b; }
.pulse-player-head .pulse-countdown { margin-left: auto; }

.pulse-canvas {
  display: block;
  width: 100%;
  height: 168px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e6ebf0;
}
.pulse-canvas-sm { height: 118px; }
.pulse-canvas-xs { height: 92px; }

/* ---------- 搏动指示灯 ---------- */
.pulse-beatline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 6px;
  min-height: 18px;
}
.pulse-beatdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cdeae9;
  flex-shrink: 0;
}
.pulse-beatdot.on { background: #0ea5a4; box-shadow: 0 0 0 6px rgba(14, 165, 164, 0.18); }

/* ---------- 最短感知时长进度 ---------- */
.pulse-perceive {
  height: 4px;
  background: #e6ebf0;
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 4px;
}
.pulse-perceive-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5a4, #34d399);
  border-radius: 999px;
  transition: width 0.15s linear;
}
.pulse-perceive-tip { font-size: 11px; line-height: 1.5; }

.pulse-transport { margin-top: 12px; }

/* ---------- 播放设置 ---------- */
.pulse-settings {
  margin-top: 12px;
  border-top: 1px dashed #e6ebf0;
  padding-top: 10px;
}
.pulse-set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pulse-set-k {
  width: 52px;
  flex-shrink: 0;
  font-size: 13px;
  color: #7b8a99;
}
.pulse-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pulse-chip { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.pulse-chip.active { background: #0ea5a4; color: #fff; border-color: #0ea5a4; font-weight: 700; }
.pulse-range { flex: 1; height: 44px; }

/* ---------- 题目与选项 ---------- */
.pulse-question { margin-top: 14px; }
.pulse-question.locked { opacity: 0.55; }
.pulse-q-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; line-height: 1.5; }
.pulse-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pulse-opt {
  border: 1px solid #cdeae9;
  background: #eefaf9;
  color: #0c8c8b;
  border-radius: 12px;
  padding: 14px 10px;
  font-size: 16px;
  font-weight: 600;
  min-height: 56px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  transition: transform 0.06s ease;
}
.pulse-opt:active { transform: scale(0.97); }
.pulse-opt:disabled { cursor: not-allowed; }
.pulse-opt.right { background: #d1fae5; border-color: #10b981; color: #047857; }
.pulse-opt.wrong { background: #fee2e2; border-color: #ef4444; color: #b91c1c; }

.pulse-countdown {
  margin-top: 10px;
  text-align: right;
  font-size: 13px;
  color: #7b8a99;
  min-height: 18px;
}
.pulse-countdown.urgent { color: #ef4444; font-weight: 700; }

/* ---------- 反馈卡 ---------- */
.pulse-feedback:empty { display: none; }
.pulse-fb { border-radius: 12px; padding: 12px 14px; margin-top: 14px; }
.pulse-fb.ok { background: #ecfdf5; border: 1px solid #a7f3d0; }
.pulse-fb.no { background: #fef2f2; border: 1px solid #fecaca; }
.pulse-fb-head { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.pulse-fb.ok .pulse-fb-head { color: #047857; }
.pulse-fb.no .pulse-fb-head { color: #b91c1c; }
.pulse-fb-answer { font-size: 14px; color: #334155; }

.pulse-fb-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
}
.pulse-fb-k { font-size: 12px; color: #7b8a99; margin-bottom: 4px; font-weight: 600; }
.pulse-fb-v { font-size: 14px; line-height: 1.7; color: #1f2d3d; }

.pulse-confuse-item { margin-bottom: 8px; }
.pulse-confuse-item:last-child { margin-bottom: 0; }
.pulse-confuse-h { font-size: 13px; font-weight: 700; color: #0c8c8b; }
.pulse-confuse-t { font-size: 13px; line-height: 1.65; color: #475569; }

.pulse-fb-actions { margin-top: 14px; }

/* ---------- 练习小结 ---------- */
.pulse-summary { text-align: center; padding: 28px 18px; }
.pulse-sum-icon { font-size: 42px; margin-bottom: 8px; }
.pulse-sum-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.pulse-summary .btn-row { margin-top: 16px; }

/* ---------- 红线卡 ---------- */
.pulse-redline {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  border-radius: 12px;
  padding: 12px 14px;
  color: #a8071a;
}
.pulse-redline.urgent {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
}
.pulse-redline-lead { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.pulse-redline-text { font-size: 14px; line-height: 1.7; margin: 0 0 8px; }
.pulse-redline-list { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.8; }

/* ---------- A/B 对比 ---------- */
.pulse-ab-q {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pulse-ab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pulse-ab-cell {
  background: #f8fafc;
  border: 1px solid #e6ebf0;
  border-radius: 12px;
  padding: 10px;
}
.pulse-ab-tag { font-size: 13px; font-weight: 700; color: #0c8c8b; margin-bottom: 6px; text-align: center; }
.pulse-ab-cell .btn { width: 100%; margin-top: 8px; }

/* ---------- 考核结果 ---------- */
.pulse-result { text-align: center; padding: 24px 16px; }
.pulse-result.pass { border-top: 4px solid #10b981; }
.pulse-result.fail { border-top: 4px solid #f59e0b; }
.pulse-result-icon { font-size: 44px; margin-bottom: 6px; }
.pulse-result-title { font-size: 19px; font-weight: 800; }
.pulse-result-score { font-size: 46px; font-weight: 800; color: #0c8c8b; line-height: 1.1; margin: 4px 0; }
.pulse-result-score span { font-size: 16px; margin-left: 4px; font-weight: 600; }
.pulse-result-reason { font-size: 13px; color: #b45309; background: #fffbeb; border-radius: 8px; padding: 8px; display: inline-block; }

.pulse-cert { border: 1px dashed #0ea5a4; background: linear-gradient(160deg, #f0fdfa, #ffffff); }
.pulse-cert-head { font-size: 16px; font-weight: 800; color: #0c8c8b; text-align: center; margin-bottom: 10px; letter-spacing: 1px; }
.pulse-cert-body .card-row { font-size: 13px; }
.pulse-cert-note {
  margin-top: 10px;
  font-size: 11px;
  color: #7b8a99;
  text-align: center;
  line-height: 1.6;
}

/* ---------- 脉象详情弹窗 ---------- */
.pulse-detail { font-size: 14px; line-height: 1.7; }
.pulse-detail-sec { margin-bottom: 12px; }
.pulse-detail-k { font-size: 12px; color: #7b8a99; font-weight: 700; margin-bottom: 2px; }
.pulse-detail-v { color: #1f2d3d; }

/* ---------- 身体信号映射（脉象 → 身体问题 / 证型倾向） ---------- */
.pulse-bodymap { background: #f5f9ff; border: 1px solid #d7e6ff; border-radius: 12px; padding: 12px 14px; }
.pulse-bodymap .pulse-detail-k { color: #2b6cb0; }
.pulse-bodymap-organ { margin-top: 6px; font-size: 13px; color: #34495e; }
.pulse-bodymap-syns { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pulse-syn-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #e6f0ff; color: #1d4ed8; font-size: 12px; font-weight: 700; }
.pulse-bodymap-warn { margin-top: 8px; color: #c0392b; font-weight: 700; font-size: 13px; }
.pulse-bodymap-note { margin-top: 8px; font-size: 11px; color: #8a98a6; line-height: 1.5; }

/* ---------- confirm-msg（ui.confirm 依赖） ---------- */
.confirm-msg { font-size: 15px; line-height: 1.7; margin: 0; color: #1f2d3d; }

/* ---------- 小屏适配（≤360px：选项改单列，避免误触） ---------- */
@media (max-width: 360px) {
  .pulse-opts { grid-template-columns: 1fr; }
  .pulse-canvas { height: 148px; }
  .pulse-canvas-sm { height: 104px; }
}
