/* ============================================================
 * components.css —— 症状卡片、提示框、药箱条目、规则、信号、计算器
 * ============================================================ */

/* ---------- 症状卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card .hd {
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.card .hd-main { flex: 1; }
.card .nm { font-size: 16.5px; font-weight: 700; }
.card .arrow {
  color: var(--txt3);
  font-size: 13px;
  margin-top: 3px;
  transition: transform .2s;
}
.card.open .arrow { transform: rotate(90deg); }

.card .bd {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}
.card.open .bd { display: block; }

/* 人群标签 */
.tgw { display: block; margin-top: 5px; line-height: 2; }
.tg {
  display: inline-block;
  font-size: 10.5px;
  padding: 1.5px 7px;
  border-radius: 5px;
  margin-right: 4px;
  font-weight: 500;
}
.tg.g1 { background: var(--brand-l); color: var(--brand-d); }
.tg.g2 { background: #fef3c7; color: #b45309; }
.tg.g3 { background: #fce7f3; color: #be185d; }
.tg.g4 { background: var(--danger-l); color: var(--danger); }

/* ---------- 卡片内分区 ---------- */
.sec { margin-top: 14px; }
.sec .sh {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand-d);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sec .sc { font-size: 14px; color: var(--txt); line-height: 1.75; }
.sec .sc ul { margin: 4px 0; padding-left: 18px; }
.sec .sc li { margin-bottom: 4px; }

/* ---------- 药品条目 ---------- */
.med {
  border-left: 3px solid var(--brand);
  background: #fafcfc;
  padding: 8px 11px;
  margin-bottom: 7px;
  border-radius: 0 8px 8px 0;
}
.med .mn { font-weight: 600; font-size: 14.5px; color: var(--txt); }
.med .mu { font-size: 13px; color: var(--txt2); margin-top: 2px; }
.med .mt { font-size: 12px; color: var(--warn); margin-top: 3px; }
.med.key { border-left-color: var(--warn); background: var(--warn-l); }

/* ---------- 通用提示框 ---------- */
.box {
  border-radius: var(--radius-s);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13.5px;
  line-height: 1.7;
}
.box.r { background: var(--danger-l); border: 1px solid #fecaca; color: #991b1b; }
.box.o { background: var(--warn-l);   border: 1px solid #fed7aa; color: #9a3412; }
.box.b { background: var(--info-l);   border: 1px solid #bfdbfe; color: #1e40af; }
.box.g { background: var(--brand-l);  border: 1px solid #99f6e4; color: #115e59; }
.box b.blk { display: block; margin-bottom: 3px; font-size: 13px; }

/* ---------- 特殊人群分区 ---------- */
.pers { display: grid; gap: 7px; }
.pers .p { border-radius: 9px; padding: 8px 11px; font-size: 13.3px; line-height: 1.7; }
.pers .p .lbl { font-weight: 700; margin-right: 5px; }
.pers .p.kid { background: #eef2ff; color: #3730a3; }
.pers .p.old { background: #fef9c3; color: #854d0e; }
.pers .p.pre { background: #fdf2f8; color: #9d174d; }

/* ---------- 安全铁律 ---------- */
.rule {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.rule .rt {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.rule .rt .n {
  background: var(--danger);
  color: #fff;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}
.rule .rc {
  font-size: 13.8px;
  color: var(--txt2);
  margin-top: 6px;
  line-height: 1.75;
}
.rule .rc b { color: var(--danger); }

/* ---------- 就医红色信号 ---------- */
.flag {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 4px solid var(--danger);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.flag h4 {
  margin: 0 0 7px;
  font-size: 15px;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 6px;
}
.flag ul { margin: 0; padding-left: 18px; font-size: 13.8px; color: var(--txt2); }
.flag li { margin-bottom: 4px; }
.flag li b { color: var(--txt); }

/* ---------- 药箱内搜索 ---------- */
.kitsearch {
  position: relative;
  margin-bottom: 12px;
}
.kitsearch input {
  width: 100%;
  padding: 11px 40px 11px 36px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  font-size: 14.5px;
  background: #fff;
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  -webkit-appearance: none;
  appearance: none;
}
.kitsearch input:focus { border-color: var(--brand); }
.kitsearch .ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--txt3);
}
.kitsearch .clear {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: var(--line);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: none;
}

/* ---------- 药箱清单 ---------- */
.kgroup {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 11px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.kgroup .kh {
  background: var(--brand-l);
  padding: 11px 14px;
  font-weight: 700;
  color: var(--brand-d);
  font-size: 14.5px;
}
.kgroup .kb { padding: 6px 14px 12px; }

.krow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
}
.krow:last-child { border-bottom: none; }
.krow input[type=checkbox] {
  width: 19px;
  height: 19px;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.krow .ki { flex: 1; }
.krow .ki .kn { font-size: 14.5px; font-weight: 600; }
.krow .ki .kd { font-size: 12.5px; color: var(--txt2); margin-top: 1px; }
.krow .ki .kd.kw { color: var(--warn); }
.krow.have .ki .kn { color: var(--txt3); text-decoration: line-through; }

/* 「必备」徽章 */
.core {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: var(--brand-d);
  background: var(--brand-l);
  border: 1px solid #99f6e4;
  border-radius: 4px;
  padding: 0 5px;
  margin-left: 6px;
  vertical-align: 2px;
  letter-spacing: .5px;
}
.krow.have .core { opacity: .5; }

/* 「只看必备」切换按钮 */
.core-toggle {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  color: var(--txt2);
  cursor: pointer;
}
.core-toggle.on {
  background: var(--brand-l);
  border-color: #99f6e4;
  color: var(--brand-d);
  font-weight: 600;
}

/* ---------- 儿童剂量计算器 ---------- */
.calc {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.calc h4 { margin: 0 0 10px; font-size: 15px; color: var(--brand-d); }
.calc .f { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.calc input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font-size: 15px;
  outline: none;
}
.calc input:focus { border-color: var(--brand); }

.calc .out {
  background: var(--brand-l);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 13.8px;
  line-height: 1.8;
  color: #115e59;
}
.calc .out b { font-size: 15px; }
.calc .out .row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #99f6e4;
  padding: 3px 0;
}
.calc .out .row:last-child { border: none; }
.calc .out .dose-note {
  margin-top: 6px;
  font-size: 12.5px;
}
