/* ============================================================
   适老智家 · 改造方向清单页（directions.html）
   依赖 styles.css 的变量与基础组件，这里只放这一页自己的东西
   ============================================================ */

/* ---- 页头下方的一行「怎么用这份清单」 ---- */
.dx-howto {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 0 0 42px;
  padding: 22px 24px;
  background: var(--brand-soft);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
}
.dx-howto svg {
  width: 2rem;
  height: 2rem;
  flex: none;
  color: var(--brand-strong);
}
.dx-howto p {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.65;
  color: var(--ink-2);
}
.dx-howto b { color: var(--ink); font-weight: 750; }

/* ---- 花钱档位说明 ---- */
.dx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink-2);
}
.dx-legend li {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.dx-legend .dx-money { font-size: 1.05rem; }

/* ---- 每个方向一块 ---- */
.dx-sec { padding: 0 0 46px; }
.dx-sec + .dx-sec { padding-top: 6px; }

.dx-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}
.dx-no {
  font-family: var(--mono);
  flex: none;
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  font-size: 1.24rem;
  font-weight: 750;
  letter-spacing: .02em;
  box-shadow: 0 10px 22px -14px rgba(29, 78, 216, .95);
}
.dx-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 3.6vw, 1.8rem);
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: .02em;
}
.dx-head p {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ---- 表格 ---- */
.dx-tablewrap { width: 100%; }
.dx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.dx-table thead th {
  padding: 14px 18px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: .92rem;
  font-weight: 750;
  letter-spacing: .1em;
  text-align: left;
  white-space: nowrap;
  border-bottom: var(--bw) solid var(--line);
}
.dx-table tbody th,
.dx-table tbody td {
  padding: 15px 18px;
  border-bottom: var(--bw) solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink-2);
}
.dx-table tbody th {
  color: var(--ink);
  font-weight: 750;
  white-space: nowrap;
}
.dx-table tbody tr:nth-child(even) th,
.dx-table tbody tr:nth-child(even) td { background: #F7FAFD; }
.dx-table tbody tr:last-child th,
.dx-table tbody tr:last-child td { border-bottom: 0; }

.dx-money {
  font-weight: 750;
  color: var(--brand);
  letter-spacing: .08em;
  white-space: nowrap;
}
.dx-pri {
  display: inline-block;
  padding: .18rem .62rem;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 750;
  letter-spacing: .04em;
  white-space: nowrap;
}
.dx-pri.p1 { background: var(--tone-a); color: var(--tone-a-ink); }
.dx-pri.p2 { background: var(--tone-c); color: var(--tone-c-ink); }
.dx-pri.p3 { background: #EFF3F9; color: #5A6B85; }

/* ---- 三步走 ---- */
.dx-phases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  counter-reset: ph;
}
.dx-phase {
  position: relative;
  padding: 26px 24px 24px;
  background: var(--card);
  border: var(--bw) solid var(--line);
  border-top: 8px solid var(--brand);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
}
.dx-phase h3 {
  margin: 0 0 10px;
  font-size: 1.3rem;
  font-weight: 750;
  letter-spacing: .02em;
}
.dx-phase .dx-phase-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: .24rem .7rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: .86rem;
  font-weight: 750;
  letter-spacing: .08em;
}
.dx-phase ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.dx-phase li {
  position: relative;
  padding: 5px 0 5px 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink-2);
}
.dx-phase li::before {
  content: "";
  position: absolute;
  left: .3rem;
  top: 1.02em;
  width: .5rem;
  height: .5rem;
  border-radius: 2px;
  background: var(--brand);
}

/* ---- 免责/提醒条 ---- */
.dx-note {
  margin: 8px 0 0;
  padding: 20px 22px;
  background: #EDF1F7;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  font-size: .98rem;
  font-weight: 600;
  line-height: 1.65;
  color: var(--ink-2);
}
.dx-note b { color: var(--ink); font-weight: 750; }

/* ---- 从这一页跳去「智能厨房」的入口 ---- */
.dx-more {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 28px 0 0;
}
@media (max-width: 620px) {
  /* 手机上两个按钮各占一整行，竖着排 */
  .dx-more { flex-direction: column; align-items: stretch; }
  .dx-more .btn-more {
    width: 100%;
    padding: .62rem 1.1rem;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }
  .dx-more .btn-more svg { flex: none; }
}

/* ---- 响应式 ---- */
@media (min-width: 760px) {
  .dx-phases { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}

/* 窄屏：四列表格会把「怎么实现」挤成一条竖线，改成一张张卡 */
@media (max-width: 719px) {
  .dx-table thead { display: none; }
  .dx-table,
  .dx-table tbody,
  .dx-table tr,
  .dx-table th,
  .dx-table td { display: block; width: 100%; }
  .dx-table {
    border: 0;
    border-radius: 0;
    background: none;
  }
  .dx-table tr {
    margin-bottom: 14px;
    padding: 4px 0;
    background: var(--card);
    border: var(--bw) solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
  }
  .dx-table tbody tr:nth-child(even) th,
  .dx-table tbody tr:nth-child(even) td { background: transparent; }
  .dx-table tbody th {
    padding: 14px 16px 12px;
    font-size: 1.16rem;
    white-space: normal;
    border-bottom: var(--bw) solid var(--line);
    background: #F7FAFD;
  }
  .dx-table tbody td {
    padding: 12px 16px;
    border-bottom: 0;
  }
  .dx-table tbody td + td { padding-top: 0; }
  .dx-table td::before {
    content: attr(data-l);
    display: block;
    margin-bottom: 3px;
    font-size: .8rem;
    font-weight: 750;
    letter-spacing: .12em;
    color: var(--brand-strong);
  }
  .dx-table tr:last-child { margin-bottom: 0; }
}

/* 长辈模式：数字徽章与表格一并放大 */
html[data-mode="elder"] .dx-no { width: 3.4rem; height: 3.4rem; font-size: 1.32rem; }
html[data-mode="elder"] .dx-sec { padding-bottom: 52px; }
html[data-mode="elder"] .dx-table tbody th,
html[data-mode="elder"] .dx-table tbody td { padding: 16px 18px; }
html[data-mode="elder"] .dx-head h2 { font-size: 1.6rem; }
html[data-mode="elder"] .dx-phases { grid-template-columns: 1fr; }
