/* ============================================================
   适老智家 · 为什么要改
   只放本页专有版式，公共部分全部复用 styles.css
   ============================================================ */

/* ---- 三张事实卡 ------------------------------------------ */
.facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.fact {
  padding: 32px 26px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r);
  text-align: center;
  box-shadow: var(--shadow);
}
.fact-ico {
  width: 4.2rem;
  height: 4.2rem;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
}
.fact-ico svg { width: 2.4rem; height: 2.4rem; }
.fact b {
  display: block;
  font-size: 1.34rem;
  font-weight: 900;
  line-height: 1.38;
  letter-spacing: .02em;
}
.fact p {
  margin: 12px 0 0;
  font-size: 1.04rem;
  line-height: 1.6;
  color: var(--ink-2);
  font-weight: 700;
}
.note-line {
  margin: 26px 0 0;
  text-align: center;
  font-size: .95rem;
  line-height: 1.6;
  font-weight: 700;
  color: var(--ink-2);
}

/* ============================================================
   改前 / 改后 户型对比
   ============================================================ */
.compare {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
.fp-card {
  padding: 24px 20px 22px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r);
}
.fp-card.after {
  background: #fffaf6;
  border-color: #e9b992;
}
.fp-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 16px;
  font-size: 1.32rem;
  font-weight: 900;
  letter-spacing: .02em;
}
.fp-title .dot {
  width: .95rem;
  height: .95rem;
  flex: none;
  border-radius: 50%;
}
.fp-card.before .dot { background: var(--warn); }
.fp-card.after  .dot { background: var(--ok); }

.floorplan svg {
  display: block;
  width: 100%;
  height: auto;
}
.floorplan rect.room {
  fill: #efe9e1;
  stroke: #d6c9ba;
  stroke-width: 2.4;
}
.fp-card.after .floorplan rect.room {
  fill: #fdf1e6;
  stroke: #e9b992;
}
.floorplan text {
  fill: #6b5f52;
  /* SVG 会随容器等比缩放，里面的字号也跟着缩 —— 手机上「卫生间」
     会被压到 13px，比正文小一截，老人看不清；而且老人调大字号时
     它也不会跟着变大。所以这里用 rem 跟着字号档走，窄屏再补放大系数。 */
  font-size: min(1rem, 22px);
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               system-ui, sans-serif;
  pointer-events: none;
}
.fp-card.after .floorplan text { fill: #1c1713; }

.fp-cap {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 2px dashed var(--line);
  font-size: 1.04rem;
  line-height: 1.55;
  font-weight: 800;
}
.fp-card.before .fp-cap { color: var(--warn); }
.fp-card.after  .fp-cap { color: var(--ok); }

/* ============================================================
   六个危险角落
   ============================================================ */
.risk-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.risk-card {
  padding: 28px 24px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r);
}
.risk-card h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-size: 1.36rem;
  font-weight: 900;
  letter-spacing: .02em;
}
.risk-card h3 svg {
  width: 1.85rem;
  height: 1.85rem;
  flex: none;
  color: var(--brand-strong);
}
.risk-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border-radius: var(--r-sm);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.55;
}
.risk-row + .risk-row { margin-top: 10px; }
.risk-row.before {
  background: #f7f2ec;
  color: #6b5f52;
}
.risk-row.after {
  background: var(--brand-soft);
  border: 2px solid #f0dccd;
  color: var(--ink);
}
.risk-row b {
  flex: none;
  padding-top: .1rem;
  font-size: .92rem;
  font-weight: 900;
  letter-spacing: .06em;
}
.risk-row.before b { color: var(--warn); }
.risk-row.after  b { color: var(--ok); }

/* ============================================================
   一分钟自检清单
   ============================================================ */
.check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}
.check-item label {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.5;
  transition: border-color .16s, background .16s;
}
.check-item label:hover { border-color: var(--brand); }
.check-item input:checked ~ span { color: var(--ink); }
.check-item input {
  appearance: none;
  -webkit-appearance: none;
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
  margin: 0;
  border: 3px solid #d6c9ba;
  border-radius: 9px;
  background-color: #fff;
  cursor: pointer;
  transition: background-color .16s, border-color .16s;
}
.check-item input:checked {
  border-color: var(--brand-strong);
  background-color: var(--brand-strong);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.4 4.4L18.5 6.8'/%3E%3C/svg%3E");
  background-size: 1.4rem;
  background-position: center;
  background-repeat: no-repeat;
}

.check-sum {
  padding: 32px 26px;
  border-radius: var(--r);
  background: var(--brand-soft);
  border: 2px solid #f0dccd;
  text-align: center;
}
.check-count {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.4;
}
.check-count em {
  font-style: normal;
  font-size: 2rem;
  color: var(--brand-strong);
}
.check-advice {
  margin: 0 0 24px;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.55;
  color: var(--ink-2);
}
.check-reset {
  min-height: 3.2rem;
  padding: 0 1.7rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .16s, color .16s;
}
.check-reset:hover { border-color: var(--brand); color: var(--brand-strong); }

/* ============================================================
   常见误区
   ============================================================ */
.myth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.myth-card {
  padding: 28px 26px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r);
}
.myth-wrong,
.myth-right {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  font-size: 1.06rem;
  line-height: 1.6;
}
.myth-wrong {
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 2px dashed var(--line);
  font-weight: 900;
  color: var(--warn);
}
.myth-right {
  margin: 0;
  font-weight: 700;
  color: var(--ink-2);
}
.myth-wrong svg,
.myth-right svg {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  margin-top: .22rem;
}
.myth-right svg { color: var(--ok); }

/* ============================================================
   响应式
   ============================================================ */
@media (min-width: 660px) {
  .facts      { grid-template-columns: repeat(3, 1fr); }
  .compare    { grid-template-columns: repeat(2, 1fr); }
  .risk-grid  { grid-template-columns: repeat(2, 1fr); }
  .check-grid { grid-template-columns: repeat(2, 1fr); }
  /* 13 条清单在 2 列下剩最后一条，占满整行，旁边不留半格空 */
  .check-grid > .check-item:last-child { grid-column: 1 / -1; }
}

@media (min-width: 960px) {
  .risk-grid  { grid-template-columns: repeat(3, 1fr); }
  .myth-grid  { grid-template-columns: repeat(2, 1fr); }
  .fp-card    { padding: 30px 28px 26px; }
}

/* 窄屏的户型图被缩放得最狠，房间名要单独放大补偿。
   上限按房间格子宽度反推：格子约 130 个用户单位宽，三个字最多 42。
   实测各档缩放比：≤400px 0.63 / 430px 0.91 / 660~959px 0.79 / 桌面 ≥1.1 */
@media (max-width: 659px) {
  .floorplan text { font-size: min(1.6rem, 34px); }
}
/* 平板竖屏（768px 级）：改成两列后每列只剩 300 出头，图缩到 0.79 倍 */
@media (min-width: 660px) and (max-width: 959px) {
  .floorplan text { font-size: min(1.5rem, 32px); }
}
@media (max-width: 400px) {
  /* 上限 38 而不是 42：「卫生间」三个字 38×3=114 个用户单位，
     格子宽 130，左右还能各留 8 的余量，不会压到格线 */
  .floorplan text { font-size: min(1.85rem, 38px); }
}
