/* ---------- 我的心跳（摄像头测脉搏） ---------- */

.c8 { background: #d6336c; }
body.pulse-white, body.pulse-white #view, body.pulse-white .pm-stage { background: #fff; } /* 前摄像头模式：屏幕变白给手指照明 */
.pulse-hub, .pulse-page { max-width: 1000px; margin: 0 auto; }
.pulse-page h2 { font-size: 30px; margin: 6px 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.pulse-page h2 small { font-size: 18px; color: var(--muted); font-weight: normal; }
.pulse-note { font-size: 18px; line-height: 1.6; color: var(--muted); margin: 6px 0 16px; }
.pulse-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pulse-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; border-radius: var(--radius); color: #fff; font-size: 28px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18); }
.pulse-card:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.pulse-card span { font-size: 60px; line-height: 1; }
.pulse-card small { font-size: 18px; opacity: 0.95; }
.pulse-card.p1 { background: #d6336c; }
.pulse-card.p2 { background: #ff8c1a; }
.pulse-card.p3 { background: var(--blue); }

.pm { display: flex; flex-direction: column; gap: 10px; }
.pm-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-modes button { padding: 10px 16px; border-radius: 999px; background: #fff; border: 3px solid #f0e2d0; font-size: 18px; }
.pm-modes button.on { background: var(--pink); border-color: var(--pink-dark); color: #fff; font-weight: bold; }
.pm-modes i { font-style: normal; font-size: 13px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #fff3c4; color: #b06d00; }
.pm-howto { margin: 0; font-size: 18px; line-height: 1.5; }
.pm-stage { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.pm-wave { width: 100%; height: 30vh; min-height: 170px; display: block; border-radius: 18px; border: 4px solid #ffd0dc; background: #fff1f4; }
.pm-dial { position: relative; width: 170px; height: 170px; }
.pm-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pm-dial circle { fill: none; stroke-width: 9; }
.pm-ring-bg { stroke: #ffe1ea; }
.pm-ring { stroke: var(--pink); stroke-linecap: round; transition: stroke-dashoffset 0.2s linear; }
.pm-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pm-heart { font-size: 30px; display: inline-block; }
.pm-heart.beat { animation: beat 0.3s ease-out; }
.pm-bpm { font-size: 48px; line-height: 1.05; color: var(--pink-dark); }
.pm-center small { color: var(--muted); font-size: 16px; }
.pm-status { margin: 0; padding: 12px 16px; border-radius: 14px; background: #fff3c4; font-size: 20px; font-weight: bold; }
.pm-status.ok { background: #dcf7e9; }
.pm-status.bad { background: #ffe1e8; }
.pm-hint { margin: 0; min-height: 1.4em; font-size: 16px; color: var(--muted); text-align: center; }
.pm-preview { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 15px; }
.pm-diag { font-size: 12px; color: #b0b3c2; font-family: ui-monospace, Menlo, monospace; }
.pm-preview video { width: 80px; height: 60px; object-fit: cover; border-radius: 10px; background: #000; flex: none; }

.pulse-result { margin-top: 16px; padding: 18px 20px; border-radius: var(--radius); background: #fff; display: flex; flex-direction: column; gap: 10px; }
.pr-top { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 26px; }
.pr-top b { font-size: 72px; color: var(--pink-dark); }
.pr-top small { display: block; font-size: 16px; color: var(--muted); }
.pr-heart { font-size: 60px; animation: beat 0.8s infinite; }
.pr-save { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 18px; text-align: center; }
.pr-save.ok { background: #dcf7e9; }
.pr-save.full { background: #ffe1e8; }
.pr-ecg-title { margin: 6px 0 0; font-size: 17px; color: var(--muted); }
.pulse-ecg { height: 150px; }
.pr-ref { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }

.pc-best { font-size: 20px; color: #b06d00; background: #fff3c4; padding: 4px 14px; border-radius: 999px; }
.pc-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.pc-steps button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 18px; background: #fff; border: 3px solid #f0e2d0; font-size: 18px; font-weight: bold; }
.pc-steps button span { font-size: 34px; }
.pc-steps button small { font-size: 15px; color: var(--pink-dark); min-height: 1.2em; }
.pc-steps button.on { border-color: #ff8c1a; background: #fff4e6; }
.pc-next { margin-top: 14px; text-align: center; font-size: 24px; }
.pc-next b { color: var(--pink-dark); font-size: 36px; }
.pc-compare { text-align: center; font-size: 20px; }
.pc-compare p { margin: 4px 0; }
.pc-compare b { color: var(--pink-dark); }
.pc-compare .record { font-size: 24px; font-weight: bold; }
.pc-compare .record.new { color: #ff8c1a; }
.pc-why { font-size: 16px; color: var(--muted); }
.pc-ex { text-align: center; padding: 20px; border-radius: var(--radius); background: #fff4e6; }
.pc-ex-fig { font-size: 110px; line-height: 1.1; display: inline-block; }
.pc-ex.go .pc-ex-fig { animation: jump 0.4s ease-in-out infinite alternate; }
@keyframes jump { from { transform: translateY(0) scaleX(1); } to { transform: translateY(-24px) scaleX(-1); } }
.pc-ex-count { font-size: 90px; font-weight: bold; color: #ff8c1a; line-height: 1.1; }
.pc-ex p { font-size: 22px; }

.rec-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 12px; }
.rec-stats div { background: #fff; border-radius: 16px; padding: 10px; text-align: center; font-size: 15px; color: var(--muted); }
.rec-stats small { display: block; }
.rec-stats b { font-size: 30px; color: var(--pink-dark); margin-right: 2px; }
.rec-chart { background: #fff; border-radius: 16px; padding: 8px; margin-bottom: 12px; }
.rec-chart canvas { width: 100%; height: 180px; display: block; }
.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec { background: #fff; border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.rec-main { display: grid; grid-template-columns: auto 1fr 180px; gap: 14px; align-items: center; }
.rec-bpm { text-align: center; min-width: 80px; }
.rec-bpm b { display: block; font-size: 40px; color: var(--pink-dark); line-height: 1.05; }
.rec-bpm small { color: var(--muted); font-size: 14px; }
.rec-date { font-size: 18px; font-weight: bold; }
.rec-kind { font-size: 14px; background: #fff4e6; color: #c26100; padding: 2px 8px; border-radius: 999px; }
.rec-sub { font-size: 15px; color: var(--muted); }
.rec-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.rec-tag, .rec-note { font-size: 15px; padding: 2px 10px; border-radius: 999px; background: #f3eee8; }
.rec-note { background: #e9f1ff; }
.rec-wave { width: 100%; height: 50px; }
.rec-btns { display: flex; justify-content: flex-end; gap: 8px; }
.rec-btns button { padding: 6px 14px; border-radius: 999px; background: #f6efe6; font-size: 16px; }
.rec-btns .rec-del { background: #ffe1e8; }
.rec-empty, .pr-pending { text-align: center; padding: 20px; background: #fff; border-radius: 18px; font-size: 20px; }
.pr-pending { background: #fff3c4; margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.pe-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-tags button { padding: 10px 16px; border-radius: 999px; background: #f6efe6; border: 3px solid #f0e2d0; font-size: 20px; }
.pe-tags button.on { background: var(--pink); color: #fff; border-color: var(--pink-dark); }
.pe-note { width: 100%; font: inherit; font-size: 22px; padding: 12px 16px; border-radius: 14px; border: 3px solid #f0e2d0; margin-bottom: 14px; -webkit-user-select: text; user-select: text; }

@media (max-width: 700px) {
  .pulse-cards { grid-template-columns: 1fr; }
  .pm-stage { grid-template-columns: 1fr; justify-items: center; }
  .pm-dial { width: 140px; height: 140px; }
  .pm-wave { height: 22vh; }
  .rec-stats { grid-template-columns: repeat(3, 1fr); }
  .rec-main { grid-template-columns: auto 1fr; }
  .rec-wave { grid-column: 1 / -1; }
  .pc-steps button { font-size: 15px; }
}
