/* features.html 专用样式(2026-09-21 重做)。
 *
 * 点解独立一个档而唔係加落 styles.css:
 *  ① features.html 原本用嘅 feature-hero / feature-shot-grid / how-grid / muted-band ……
 *     喺 styles.css **一条都冇定义** ⇒ 截图按原图 760×1652 铺开(每张 = 1.8 个屏幕高),
 *     「4 步上手」係冇排版嘅裸文字。Sam 09-21:「图片根本就不符合网页的浏览，太大了」。
 *  ② styles.css 同 CSS/JS 一样被 CF + 浏览器缓存 4 个钟,而且冇版本号 ⇒ 改佢,回访用户最多
 *     4 个钟睇唔到。呢个档由 features.html 用 `?v=` 引用,改完即刻生效。
 *
 * 只复用 styles.css 嘅 token 同组件(.shell / .section-heading / .kicker / .button / .hero-actions),
 * 唔另起一套视觉。
 */

/* ── 手机媒体(截图 / 动态预览)通用框:同教程页一样限宽又限高 ─────────────── */
.fx-phone {
  position: relative;
  display: flex;
  justify-content: center;
}
.fx-phone img,
.fx-phone video {
  display: block;
  height: auto;
  /* 阔度用确定值(由高度上限反推),唔用 auto:auto 嘅话图未载到塌成 2×2,载完先撑开(CLS)。
     本页全部係竖长手机图(900×1956 / 900×1950,比例 ≈ 0.46)。 */
  width: min(300px, 100%, calc(min(600px, 66vh) * 0.46));
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg-2);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03);
}
/* 片有固定比例(540×1170),由高度上限反推阔度,片未载到都唔会跳版(CLS)。 */
.fx-phone video {
  aspect-ratio: 540 / 1170;
  width: min(300px, 100%, calc(min(600px, 66vh) * 540 / 1170));
  object-fit: cover;
}

/* 三语各一份图/片,跟页面语言显示一份。要压过 styles.css 第 53 行嘅 display:inline。 */
.fx-phone > [data-zh-cn],
.fx-phone > [data-zh-tw],
.fx-phone > [data-en] { display: none; }
html[lang="zh-CN"] .fx-phone > [data-zh-cn],
html[lang="zh-TW"] .fx-phone > [data-zh-tw],
html[lang="en"] .fx-phone > [data-en] { display: block; }
/* ⚠️ 用 `>`:唔可以连「动态预览」小标入面啲文字 span 都一齐变 block。 */

/* 「动态预览」小标:话畀人知呢格係会郁嘅,唔係坏咗嘅图。 */
.fx-live {
  position: absolute;
  top: 14px;
  left: 50%;
  translate: -50% 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-pill);
  background: rgba(6, 8, 11, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.fx-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 101, 84, 0.25);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.fx-hero {
  padding-block: clamp(56px, 8vw, 104px) clamp(48px, 7vw, 88px);
}
.fx-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.fx-hero h1 {
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.fx-hero .fx-lede {
  max-width: 34em;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.65;
}

/* ── 通用段落间距 ─────────────────────────────────────────────────────── */
.fx-section { padding-block: clamp(64px, 9vw, 120px); }
.fx-band {
  background: var(--bg-2);
  border-block: 1px solid var(--line);
}

/* ── 4 步上手:真係有先后次序,所以用 01–04 编号 ─────────────────────────── */
.fx-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  counter-reset: none;
}
.fx-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-1, rgba(255, 255, 255, 0.037));
}
.fx-step-num {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}
.fx-step h3 { font-size: 19px; line-height: 1.3; }
.fx-step p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.fx-step .fx-more { margin-top: auto; padding-top: 6px; }

/* ── 功能展示:一行一个功能,图文左右交替 ─────────────────────────────── */
.fx-rows {
  display: grid;
  gap: clamp(72px, 10vw, 128px);
}
.fx-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.fx-row:nth-child(even) .fx-phone { order: 2; }
.fx-row-copy { max-width: 30em; }
.fx-row:nth-child(odd) .fx-row-copy { justify-self: start; }
.fx-row:nth-child(even) .fx-row-copy { justify-self: end; }
.fx-label {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fx-row h3 {
  margin-top: 12px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.fx-row p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}
.fx-row .fx-more { margin-top: 22px; }

/* 「看教程 →」链接 */
.fx-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-2, #ff9a8d);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.fx-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.fx-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ── 仲有呢啲:冇截图嘅功能,用卡片 ───────────────────────────────────── */
.fx-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 880px;
  margin-inline: auto;
  gap: 16px;
}
.fx-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-1, rgba(255, 255, 255, 0.037));
}
.fx-card h3 { font-size: 19px; }
.fx-card p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.fx-card .fx-more { margin-top: auto; padding-top: 6px; }

/* ── Bridge 收尾 ───────────────────────────────────────────────────────── */
.fx-bridge {
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}
.fx-bridge h2 {
  font-size: clamp(32px, 3.8vw, 50px);
  line-height: 1.1;
  text-wrap: balance;
}
.fx-bridge p {
  max-width: 40em;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}
.fx-bridge .hero-actions { justify-content: center; }

/* ── 窄屏 ─────────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .fx-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .fx-hero-grid,
  .fx-row { grid-template-columns: minmax(0, 1fr); }
  /* 手机:图喺上、字喺下,唔再左右交替 */
  .fx-row:nth-child(even) .fx-phone { order: 0; }
  .fx-row .fx-row-copy { justify-self: stretch; max-width: none; }
  /* hero 喺手机上保持「标题先、图后」:图放前面会把标题挤出首屏,访客唔知呢页讲乜。 */
  .fx-phone img { width: min(300px, 100%, calc(min(520px, 60vh) * 0.46)); }
  .fx-phone video { width: min(300px, 100%, calc(min(520px, 60vh) * 540 / 1170)); }
  .fx-steps { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .fx-live::before { box-shadow: none; }
}
