/* =========================
   主题与基础变量（中文注释）
   ========================= */
:root{
  --bg: #ffffff;          /* 白底 */
  --text: #111111;        /* 黑字 */
  --muted: #6b7280;       /* 次要文字 */
  --border: #e5e7eb;      /* 边框色 */
  --accent: #8deb51;      /* 主题色（按钮/标记/进度） */
  --accent-ink: #0f3d00;  /* 主题深色文字 */
  --radius: 16px;         /* 统一圆角 */
  --shadow: 0 6px 18px rgba(17,17,17,.06); /* 阴影 */
}

/* 全局排版 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial;
  line-height: 1.55;
}

/* 顶部栏（放大高度 + 左“<”返回 + 右主题色按钮） */
.site-header{
  position: sticky; top: 0; z-index: 20;
  display: grid;
  grid-template-columns: 64px 1fr 144px; /* 左返回 / 中标题 / 右按钮 */
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.1) blur(6px);
  padding: 14px 12px;              /* 加高内边距 */
  min-height: 64px;                /* 顶部最小高度 */
}
.title{ margin: 0; font-size: 17px; font-weight: 900; text-align: center; }
.link{ color: #111; text-decoration: none; font-weight: 700; }

/* 左侧返回：仅“<”，扩大触控范围 */
.link.back{
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff; color: #111;
  box-shadow: var(--shadow);
}
.link.back:active{ transform: translateY(1px); }
.back-icon{ font-size: 20px; line-height: 1; }

/* 右侧主题色客服按钮 */
.btn-support{
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 12px;
  font-weight: 800; letter-spacing: .2px;
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(141,235,81,.25);
}
.btn-support:active{ transform: translateY(1px); }

/* Sticky 步骤条（跟随 header 高度调整） */
/* ===== Sticky 步骤条（跟随 header 高度调整） ===== */
/* ===== Sticky 步骤条（跟随 header 高度） ===== */
.steps-nav{
  position: sticky; top: 64px; z-index: 19;
  background: #fff; border-bottom: 1px solid var(--border);
}

/* 中文注释：可配置每屏可见列数（此项目固定 4 等分）与间距 */
:root{
  --pill-visible-cols: 4;   /* 每屏显示 4 个步骤按钮 */
  --pill-gap: 8px;          /* 按钮间距 */
}

/* 中文注释：
   - 使用 CSS Grid 的“列流式”横向布局
   - 每个步骤按钮（.pill）自动占据“整行宽度的 1/4”
   - 当步骤数 >4 时，容器横向滚动
*/
.pills{
  display: grid;
  grid-auto-flow: column;                                 /* 横向流 */
  grid-auto-columns: calc(100% / var(--pill-visible-cols)); /* 4 等分 */
  gap: var(--pill-gap);
  overflow-x: auto;                                       /* 超出时横向滚动 */
  padding: 10px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;                          /* 滚动贴合体验更好 */
  -webkit-overflow-scrolling: touch;
}

/* 中文注释：精简的 pill（移除 dot），文字居中，点击区更大 */
.pill{
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 8px;
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff; color: #111;
  font-weight: 800; font-size: 13px;
  white-space: nowrap; cursor: pointer;
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
  scroll-snap-align: center;                               /* 居中对齐 */
}

/* 当前步骤高亮 */
.pill[aria-current="step"]{
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(141,235,81,.25);
  background: #fafff3;
}

/* 已完成步骤样式 */
.pill.completed{
  color: var(--accent-ink);
  border-color: var(--accent);
  background: #ecfedf;
}

/* 顶部薄进度条保持不变 */
.thin-progress{ height: 4px; background: #f2f4f7; }
.thin-progress .bar{ height: 100%; width: 0%; background: var(--accent); transition: width .25s ease; }



/* 主体容器 */
.container{ width: min(920px, 94vw); margin: 12px auto 80px; padding: 0 6px; }

/* 步骤卡片 */
.step{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: clip;
  margin: 12px 0;
  scroll-margin-top: 126px; /* header(64) + steps-nav(约62) 的安全值 */
}
.step-head{ padding: 14px; border-bottom: 1px dashed var(--border); }
.step-index{ font-weight: 900; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 2px 10px; margin-right: 8px; }
.step-title{ margin: 0; font-weight: 900; font-size: 18px; }
.step-sub{ margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.step-body{ padding: 10px 12px 12px; }
.step-tips{ margin: 0 0 8px; padding-left: 18px; color: #222; }
.step-tips li{ margin: 2px 0; }

/* 图片组标题（可选）：对整组图片起名 */
.images-group-title{
  margin: 6px 0 6px;
  font-weight: 900; font-size: 15px; color: #111;
}

/* 图片 figure：紧凑留白，多图时上下拼接有间距 */
.step-figure{ margin: 8px 0; }
.step-figure + .step-figure{ margin-top: 10px; }

/* 图片本体：保持原图比例，按屏宽适应 */
.step-img{
  display: block;
  width: 100%;
  height: auto;                 /* 关键：保持原图比例 */
  background: #f6f7f9;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* caption 在图片上方（cap-top），加粗放大 */
.cap.cap-top{
  font-weight: 900;
  font-size: 15px;
  line-height: 1.35;
  color: #111;
  margin: 0 0 6px 0;            /* 与图片的间距 */
}

/* 兜底：下方 caption 的通用样式（此项目默认不使用） */
.step-figure figcaption{
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

/* 底部导航按钮 */
.step-actions{ margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.btn{
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800; letter-spacing: .2px;
  cursor: pointer;
}
.btn:active{ transform: translateY(1px); }
.btn-outline{ background: #fff; color: #111; border-color: var(--border); }

/* 完成提示 */
.finish-toast{
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px);
  background: #111; color: #fff; padding: 12px 16px; border-radius: 12px;
  font-weight: 800; font-size: 14px;
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
  opacity: 0; transition: all .22s ease; z-index: 50;
}
.finish-toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }

/* 小屏优化 */
@media (max-width: 420px){
  .title{ font-size: 16px; }
  .step-title{ font-size: 17px; }
}
@media (max-width: 380px){
  .site-header{ grid-template-columns: 56px 1fr 120px; }
  .btn-support{ padding: 0 10px; font-size: 13px; }
  .title{ font-size: 16px; }
}
