/* Nyoki Marketing — 使用教學頁專用樣式（沿用 style.css 的變數與字體） */

.guide-lead {
  font-size: 1.08rem;
  color: var(--muted);
}

/* 深連結跳轉時不被 sticky 平台列蓋住 */
.step,
.platform-section,
.guide-faq {
  scroll-margin-top: 4.75rem;
}

/* ---- 語言 / 平台切換 ---- */

.guide-switches[hidden],
.platform-section[hidden] {
  display: none;
}

/* 五個語言在窄螢幕上排不下，讓它換行（style.css 的 inline-flex 不換行） */
.guide-switches .lang-switch {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.4rem;
}

.platform-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0;
  margin: 1.25rem 0 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.platform-tabs button {
  flex: 1;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.platform-tabs button:hover {
  color: var(--fg);
}

.platform-tabs button[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.platform-tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- 步驟 ---- */

.platform-section > h2:first-child {
  border-top: none;
  padding-top: 1.5rem;
}

.step {
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
  margin-top: 2.25rem;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.step-num {
  flex: none;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.step-head h3 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.35;
}

.step-body {
  display: grid;
  grid-template-columns: 1fr minmax(195px, 220px);
  gap: 1.25rem 2rem;
  align-items: start;
  margin-top: 1.1rem;
}

.step-text > *:first-child {
  margin-top: 0;
}

.step-text ol {
  padding-left: 1.35rem;
}

.step-text ol li {
  margin: 0.5rem 0;
}

.step-text kbd {
  font-family: inherit;
  font-size: 0.95em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05em 0.4em;
  white-space: nowrap;
}

/* ---- 影片示範 ---- */

.demo {
  margin: 0;
}

.phone {
  position: relative;
  border: 7px solid #26261f;
  border-radius: 30px;
  background: #26261f;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
}

.phone[data-ratio="ios"] {
  aspect-ratio: 1206 / 2622;
}

.phone[data-ratio="android"] {
  aspect-ratio: 1080 / 2400;
}

.phone video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #26261f;
}

.phone .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(20, 20, 15, 0.3);
  color: #fff;
  transition: background 0.15s;
}

.phone .play:hover {
  background: rgba(20, 20, 15, 0.18);
}

.phone .play svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.demo.is-playing .play {
  display: none;
}

.demo figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* ---- 提示 / 疑難排解 ---- */

.callout {
  border-left: 3px solid var(--accent);
  background: var(--code-bg);
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1rem;
  margin: 1.1rem 0;
  font-size: 0.95rem;
}

.callout p {
  margin: 0.3rem 0 0;
}

.callout > strong:first-child {
  display: block;
}

.guide-faq details {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.guide-faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.guide-faq summary::-webkit-details-marker {
  display: none;
}

.guide-faq summary::before {
  content: "＋";
  color: var(--accent);
  margin-right: 0.5rem;
  font-weight: 700;
}

.guide-faq details[open] summary::before {
  content: "－";
}

.guide-faq details p {
  margin: 0.6rem 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 620px) {
  .step-body {
    grid-template-columns: 1fr;
  }
  .demo {
    max-width: 250px;
    margin: 0.5rem auto 0;
  }
  .step-head h3 {
    font-size: 1.15rem;
  }
}
