/* ═══════════════════════════════════════════════
   安脑智联 · 脑健康评估（BHA）样式
   全屏 sheet，覆盖在 .phone 内；沿用全局设计变量
   ═══════════════════════════════════════════════ */

.bha {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f7fbff 0%, #eaf4ff 55%, #dfefff 100%);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .32s cubic-bezier(.32, .72, 0, 1), opacity .24s ease;
}
.bha.open { transform: none; opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .bha { transition: none; } }

/* ── 头部 ── */
.bha-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(223, 233, 245, .9);
}
.bha-x {
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #eef4fd;
  color: var(--muted);
}
.bha-head-mid { flex: 1; min-width: 0; }
.bha-title { font-size: 15.5px; font-weight: 800; color: var(--ink); }
.bha-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.bha-progress {
  height: 4px;
  border-radius: 999px;
  background: #e2edfa;
  margin-top: 6px;
  overflow: hidden;
}
.bha-progress i {
  display: block;
  height: 100%;
  width: 16.6%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6aa9ff, var(--blue));
  transition: width .3s ease;
}
.bha-stepno {
  flex: none;
  font-size: 11.5px;
  color: var(--blue);
  font-weight: 700;
  background: #eaf3ff;
  border-radius: 999px;
  padding: 4px 9px;
}

/* ── 主体 ── */
.bha-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 24px;
  scrollbar-width: none;
}
.bha-body::-webkit-scrollbar { display: none; }
.bha-body > * { animation: bhaIn .3s ease both; }
@keyframes bhaIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.bha-h2 { font-size: 20px; font-weight: 800; color: var(--ink); line-height: 1.35; }
.bha-p { font-size: 13.5px; line-height: 1.7; color: var(--text); margin-top: 8px; }
.bha-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 10px; }
.bha-note b { color: var(--text); }

.bha-card {
  background: var(--card);
  border: 1px solid #e8f1fb;
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  margin-top: 14px;
}
.bha-card-title { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 10px; }

/* 排除项 / 开关行 */
.bha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px dashed #edf4fc;
}
.bha-row:last-child { border-bottom: none; }
.bha-row-txt { flex: 1; font-size: 13px; line-height: 1.5; color: var(--text); }
.bha-row-txt small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.bha-row.danger .bha-row-txt { color: #c22a2f; font-weight: 600; }

.bha-switch {
  flex: none;
  width: 44px; height: 26px;
  border-radius: 999px;
  background: #e3ecf7;
  position: relative;
  transition: background .2s;
}
.bha-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(22, 50, 92, .22);
  transition: transform .2s;
}
.bha-switch.on { background: var(--blue); }
.bha-switch.on::after { transform: translateX(18px); }

/* 选择组 */
.bha-field { margin-top: 16px; }
.bha-field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.bha-field-label small { font-weight: 400; color: var(--muted); font-size: 11px; }
.bha-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bha-chip {
  padding: 9px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #dbe8f8;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  transition: all .16s;
}
.bha-chip.sel {
  background: linear-gradient(135deg, #eaf3ff, #d9e9ff);
  border-color: var(--blue);
  color: var(--blue-deep);
  box-shadow: 0 4px 12px rgba(47, 123, 255, .14);
}
.bha-num {
  width: 100%;
  background: #fff;
  border: 1px solid #dbe8f8;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
  font-weight: 700;
}
.bha-num::placeholder { color: #a8bcd6; font-weight: 400; }

/* 题目列表 */
.bha-q { padding: 12px 0; border-bottom: 1px solid #eef4fc; }
.bha-q:last-child { border-bottom: none; }
.bha-q-t { font-size: 13.5px; line-height: 1.6; color: var(--ink); font-weight: 600; }
.bha-q-t i { color: var(--muted); font-style: normal; font-weight: 400; font-size: 11.5px; }
.bha-q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.bha-q-opts.c4 { grid-template-columns: repeat(4, 1fr); }
.bha-opt {
  padding: 9px 8px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid #e0ebf8;
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
  text-align: center;
}
.bha-opt.sel { background: #e9f3ff; border-color: var(--blue); color: var(--blue-deep); }

/* 提示条 */
.bha-tip {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  background: #f1f8ff;
  border: 1px solid #dbeafc;
  border-radius: 13px;
  padding: 11px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #46618a;
  margin-top: 12px;
}
.bha-tip.warn { background: #fff8ec; border-color: #f7e3c2; color: #8a6320; }
.bha-tip.danger { background: #fff1f1; border-color: #f8d4d4; color: #b02a2f; }
.bha-tip b { color: inherit; }

/* ── 认知任务 ── */
.bha-task { text-align: center; }
.bha-task-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: #eaf3ff;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}
.bha-task-t { font-size: 19px; font-weight: 800; color: var(--ink); line-height: 1.4; }
.bha-task-d { font-size: 13px; color: var(--text); line-height: 1.65; margin-top: 8px; }
.bha-timer {
  height: 5px;
  border-radius: 999px;
  background: #e3eefb;
  overflow: hidden;
  margin: 16px auto 0;
  max-width: 300px;
}
.bha-timer i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #58a0ff, var(--blue));
  transform-origin: left center;
  transition: transform .25s linear;
}
.bha-timer.low i { background: linear-gradient(90deg, #ff9c5b, #ef5b5b); }
.bha-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 7px;
}

.bha-stage {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 0 6px;
}
.bha-word {
  font-size: 38px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 6px;
  animation: bhaPop .3s ease;
}
@keyframes bhaPop { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
.bha-hint-big { font-size: 15px; color: var(--muted); }

.bha-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.bha-pick {
  padding: 15px 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e0ebf8;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.bha-pick.sel { background: #e9f3ff; border-color: var(--blue); color: var(--blue-deep); }
.bha-pick .emo { display: block; font-size: 26px; margin-bottom: 4px; }

.bha-emoji { font-size: 76px; line-height: 1; filter: drop-shadow(0 8px 16px rgba(47, 123, 255, .16)); }

.bha-keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; }
.bha-key {
  height: 48px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e0ebf8;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}
.bha-key:active { background: #e9f3ff; }

.bha-digits { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bha-digit {
  width: 46px; height: 58px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(160deg, #fff, #eef6ff);
  border: 1px solid #dbe8f8;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.bha-symtable {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #e6f0fb;
  border-radius: 13px;
  padding: 9px 10px;
}
.bha-symtable span {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.bha-symtable b { font-size: 17px; color: var(--ink); }

.bha-symbol {
  font-size: 56px;
  line-height: 1;
  color: var(--blue-deep);
}

.bha-input-line { display: flex; gap: 8px; width: 100%; }
.bha-input-line input {
  flex: 1;
  background: #fff;
  border: 1.5px solid #cfe0f5;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
}
.bha-input-line button {
  flex: none;
  padding: 0 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f8cff, var(--blue-deep));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.bha-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-height: 26px;
}
.bha-words span {
  font-size: 12px;
  background: #eaf3ff;
  color: var(--blue-deep);
  border-radius: 8px;
  padding: 3px 8px;
}

.bha-clocks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.bha-clock {
  background: #fff;
  border: 1.5px solid #e0ebf8;
  border-radius: 14px;
  padding: 8px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.bha-clock.sel { border-color: var(--blue); background: #f4f9ff; }
.bha-clock svg { display: block; }

.bha-shapes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.bha-shape {
  background: #fff;
  border: 1.5px solid #e0ebf8;
  border-radius: 14px;
  padding: 8px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.bha-shape.sel { border-color: var(--blue); background: #f4f9ff; }

/* ── 报告 ── */
.bha-report-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #ffffff, #f0f7ff 70%, #e6f1ff);
  border: 1px solid #e4eefb;
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.bha-ring { position: relative; width: 108px; height: 108px; flex: none; }
.bha-ring svg { transform: rotate(-90deg); }
.bha-ring-txt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.1;
}
.bha-ring-txt b { font-size: 30px; font-weight: 800; color: var(--ink); display: block; }
.bha-ring-txt span { font-size: 10px; color: var(--muted); }
.bha-report-head { flex: 1; min-width: 0; }
.bha-level {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 6px;
}
.bha-level.good { background: #e5f8ef; color: #1c8a5d; }
.bha-level.watch { background: #fff5e3; color: #a5730f; }
.bha-level.refer { background: #ffefe3; color: #b45a12; }
.bha-level.urgent { background: #ffe9e9; color: #b02a2f; }
.bha-report-head h3 { font-size: 16.5px; font-weight: 800; color: var(--ink); line-height: 1.4; }
.bha-report-head p { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 5px; }

.bha-sec { margin-top: 16px; }
.bha-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}
.bha-sec-head b { font-size: 14.5px; font-weight: 800; color: var(--ink); }
.bha-sec-head span { font-size: 11px; color: var(--muted); }

.bha-radar-card {
  background: #fff;
  border: 1px solid #e8f1fb;
  border-radius: 16px;
  padding: 8px 6px 4px;
  box-shadow: var(--shadow-sm);
}
.bha-radar-card svg { display: block; width: 100%; height: auto; }

.bha-domains { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.bha-domain {
  display: grid;
  grid-template-columns: 62px 1fr 34px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}
.bha-domain em { font-style: normal; font-weight: 700; color: var(--ink); }
.bha-bar { height: 7px; border-radius: 999px; background: #e9f1fb; overflow: hidden; }
.bha-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6aa9ff, var(--blue)); }
.bha-domain b { font-size: 12.5px; color: var(--ink); text-align: right; }

.bha-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.bha-metric {
  background: #fff;
  border: 1px solid #e9f1fb;
  border-radius: 13px;
  padding: 10px 11px;
}
.bha-metric span { font-size: 10.5px; color: var(--muted); display: block; }
.bha-metric b { font-size: 17px; font-weight: 800; color: var(--ink); }
.bha-metric small { font-size: 10px; color: var(--muted); margin-left: 3px; }
.bha-metric.hot b { color: #d9534f; }

.bha-advice { display: flex; flex-direction: column; gap: 8px; }
.bha-advice-item {
  display: flex;
  gap: 10px;
  background: #fff;
  border: 1px solid #e9f1fb;
  border-radius: 13px;
  padding: 11px 12px;
}
.bha-advice-item i {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, #4f8cff, var(--blue-deep));
  color: #fff;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 800;
  display: grid; place-items: center;
}
.bha-advice-item div { flex: 1; }
.bha-advice-item b { display: block; font-size: 12.5px; color: var(--ink); margin-bottom: 3px; }
.bha-advice-item p { font-size: 11.5px; line-height: 1.6; color: var(--text); }

.bha-plan { display: flex; flex-direction: column; gap: 8px; }
.bha-plan-row {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #f7fbff;
  border: 1px solid #e6f0fb;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text);
}
.bha-plan-row b { font-size: 12.5px; color: var(--ink); }
.bha-plan-row .dot {
  flex: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.bha-ai {
  background: #fff;
  border: 1px solid #e6f0fb;
  border-radius: 14px;
  padding: 12px 13px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text);
  min-height: 44px;
}
.bha-ai p { margin-bottom: 6px; }
.bha-ai p:last-child { margin-bottom: 0; }
.bha-ai .cursor { display: inline-block; width: 6px; height: 13px; background: var(--blue); vertical-align: -2px; animation: bhaBlink 1s steps(1) infinite; }
@keyframes bhaBlink { 50% { opacity: 0; } }

.bha-hist { display: flex; gap: 8px; align-items: flex-end; height: 74px; }
.bha-hist-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bha-hist-bar {
  width: 100%;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #8dbcff, #4f8cff);
  min-height: 6px;
}
.bha-hist-col span { font-size: 9.5px; color: var(--muted); }
.bha-hist-col b { font-size: 10.5px; color: var(--ink); }

/* 底部操作 */
.bha-foot {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  border-top: 1px solid #e8f0fa;
}
.bha-foot.hide { display: none; }
.bha-back {
  flex: 0 0 96px;
  height: 46px;
  border-radius: 14px;
  background: #eef4fd;
  color: #5b7499;
  font-size: 14px;
  font-weight: 700;
}
.bha-back:disabled { opacity: .4; }
.bha-next {
  flex: 1;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f8cff, var(--blue-deep));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(47, 123, 255, .28);
}
.bha-next:disabled { background: #cfdded; box-shadow: none; color: #fff; }
.bha-next.ghost {
  background: #eef4fd;
  color: var(--blue-deep);
  box-shadow: none;
}
.bha-next.ghost:disabled {
  background: #f2f5f9;
  color: #9aabc1;
  cursor: default;
}

/* ═══════════ 「我的」页评估摘要卡 ═══════════ */
.bha-card-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e8f1fb;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: transform .15s;
}
.bha-card-entry:active { transform: scale(.985); }
.bce-ring {
  width: 52px; height: 52px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--bce-color, #2f7bff) calc(var(--v, 0) * 1%), #e8f1fb 0);
}
.bce-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}
.bce-ring b {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
.bce-info { flex: 1; min-width: 0; }
.bce-info b {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bce-info span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}
.bce-arrow { flex: none; }
