/* 手機優化：教學步驟（文字說明 + 截圖）改成編號步驟卡片
   只作用在「含圖片的清單」，不影響首頁導覽等一般清單 */

.md-typeset ul:has(img) {
  list-style: none;
  padding-left: 0;
  counter-reset: step-counter;
}

.md-typeset ul:has(img) > li {
  counter-increment: step-counter;
  position: relative;
  margin: 0 0 1.5rem;
  padding: 1rem 1rem 1rem 3rem;
  background: var(--md-code-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.6;
}

.md-typeset ul:has(img) > li::before {
  content: counter(step-counter);
  position: absolute;
  top: 1rem;
  left: 0.85rem;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
}

.md-typeset ul:has(img) > li > p {
  margin: 0;
}

.md-typeset ul:has(img) img {
  display: block;
  margin: 0.75rem auto 0;
  max-width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 手機螢幕再加大字級與行高，長截圖也給多一點喘息空間 */
@media (max-width: 480px) {
  .md-typeset {
    font-size: 1.05rem;
    line-height: 1.75;
  }

  .md-typeset ul:has(img) > li {
    padding: 0.85rem 0.85rem 0.85rem 2.75rem;
  }
}
