/* ============================================================
   银发经济日报 · H5 引导页
   移动端优先，独立于管理后台的视觉体系（更轻、更聚焦引导）
   ============================================================ */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e6eaf0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --accent-hover: #1d4ed8;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px rgba(15, 23, 42, .06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(40px + var(--safe-bottom));
}

/* ---------------- 顶部品牌 ---------------- */
.hero {
  padding: 44px 4px 26px;
  text-align: center;
}
.hero-mark {
  width: 60px; height: 60px; margin: 0 auto 16px;
  border-radius: 17px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; display: grid; place-items: center;
  font-size: 27px; font-weight: 700;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .26);
}
.hero-title {
  font-size: 25px; font-weight: 700; letter-spacing: -.4px;
  margin-bottom: 8px;
}
.hero-sub {
  font-size: 14.5px; color: var(--text-muted);
  max-width: 340px; margin: 0 auto;
}
.hero-stats {
  display: flex; justify-content: center; gap: 10px;
  margin-top: 22px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 15px; min-width: 84px;
  box-shadow: var(--shadow);
}
.stat b {
  display: block; font-size: 18px; font-weight: 700;
  letter-spacing: -.3px; color: var(--text);
}
.stat span { font-size: 11.5px; color: var(--text-muted); }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 17px; font-weight: 650; letter-spacing: -.2px;
  margin-bottom: 5px;
}
.card-desc {
  font-size: 13.5px; color: var(--text-muted);
  margin-bottom: 16px;
}

/* ---------------- 步骤 ---------------- */
.steps { list-style: none; }
.step {
  display: flex; gap: 13px;
  padding-bottom: 26px;
  position: relative;
}
.step:last-child { padding-bottom: 0; }
/* 连接线 */
.step:not(:last-child)::before {
  content: ""; position: absolute;
  left: 15px; top: 34px; bottom: 6px;
  width: 2px; background: var(--border);
}
.step-num {
  flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-size: 14.5px; font-weight: 700;
  position: relative; z-index: 1;
}
.step.is-done .step-num { background: var(--success); color: #fff; }
.step.is-active .step-num {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.step-body { flex: 1; min-width: 0; padding-top: 4px; }
.step-body h3 {
  font-size: 15.5px; font-weight: 620; margin-bottom: 6px;
}
.step-desc { font-size: 14px; color: var(--text-muted); }
.step-desc b { color: var(--text); font-weight: 600; }
.step-tip {
  font-size: 12.5px; color: var(--warn);
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  padding: 8px 11px; margin-top: 9px;
}

/* ---------------- 加入二维码 ---------------- */
.qr-block { margin: 14px 0 12px; }
.qr-frame {
  position: relative;
  width: 208px; height: 208px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  box-shadow: var(--shadow);
}
.qr-frame img {
  width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated;
  border-radius: 3px;
}
.qr-loading {
  position: absolute; inset: 8px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13px;
  border-radius: 3px;
}
.qr-frame.has-img .qr-loading { display: none; }
.qr-status {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 11px;
  min-height: 20px;
}
.qr-status.is-ok { color: var(--success); font-weight: 560; }
.qr-status.is-warn { color: var(--warn); }

/* 文字兜底路径 */
.fallback {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.fallback summary {
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 560;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.fallback summary::-webkit-details-marker { display: none; }
.fallback summary::after {
  content: "›";
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  transition: transform .18s;
}
.fallback[open] summary::after { transform: translateY(-50%) rotate(90deg); }
.fallback-body { padding: 0 14px 14px; }
.fallback-body .step-desc { font-size: 13.5px; }
.fallback-body .step-tip { margin-top: 9px; }
.fallback-body .step-tip strong { color: var(--warn); }

/* ---------------- 配对码 ---------------- */
.code-box {  background: var(--surface-2);
  border: 1px dashed var(--border-strong, #cbd5e1);
  border-radius: var(--radius-sm);
  padding: 13px 14px; margin: 14px 0 12px;
}
.code-label {
  font-size: 12px; color: var(--text-muted); margin-bottom: 7px;
}
.code-value {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
#pairCode {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 25px; font-weight: 700; letter-spacing: 3px;
  color: var(--accent);
}
.code-copy {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px; padding: 6px 13px;
  border-radius: 7px; cursor: pointer;
  font-family: inherit;
  transition: all .13s;
}
.code-copy:active { transform: scale(.95); }
.code-hint {
  font-size: 12px; color: var(--text-faint); margin-top: 8px;
}
.code-hint.is-ready { color: var(--success); }

/* ---------------- 按钮 ---------------- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 15px; font-weight: 560;
  font-family: inherit;
  cursor: pointer;
  transition: all .14s;
  width: 100%;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .22);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost {
  background: var(--surface); color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

/* ---------------- 状态 ---------------- */
.status-box {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px; margin-top: 12px;
}
.status-icon {
  flex-shrink: 0; width: 26px; height: 26px;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  background: var(--border); color: var(--text-muted);
}
.status-text b { display: block; font-size: 14.5px; font-weight: 600; }
.status-text span { font-size: 13px; color: var(--text-muted); }
.status-box.is-pending { background: var(--accent-soft); border-color: #c7d9fd; }
.status-box.is-pending .status-icon { background: var(--accent); color: #fff; }
.status-box.is-done { background: var(--success-soft); border-color: #bbf0d4; }
.status-box.is-done .status-icon { background: var(--success); color: #fff; }
.status-box.is-warn { background: var(--warn-soft); border-color: #fde68a; }
.status-box.is-warn .status-icon { background: var(--warn); color: #fff; }

/* ---------------- 订阅结果 ---------------- */
.result-card { border-color: #bbf0d4; background: linear-gradient(180deg, var(--success-soft), var(--surface) 55%); }
.result-body { font-size: 14px; }
.result-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.result-row:last-child { border-bottom: none; }
.result-row span { color: var(--text-muted); flex-shrink: 0; }
.result-row b { font-weight: 600; text-align: right; }
.result-badge {
  display: inline-block; padding: 2px 10px;
  border-radius: 999px; font-size: 12.5px; font-weight: 560;
  background: var(--success); color: #fff;
}

/* ---------------- 分类 ---------------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 9px;
}
.cat-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.cat-item b {
  display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px;
}
.cat-item span {
  font-size: 11.5px; color: var(--text-faint);
  display: block; line-height: 1.5;
}

/* ---------------- 日报样例 ---------------- */
.sample-list { list-style: none; }
.sample-list li {
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
  display: flex; gap: 9px;
}
.sample-list li:last-child { border-bottom: none; }
.sample-idx {
  flex-shrink: 0; color: var(--text-faint);
  font-size: 12.5px; font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding-top: 1px;
}

/* ---------------- FAQ ---------------- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%; text-align: left;
  background: none; border: none;
  font-family: inherit; font-size: 14.5px; font-weight: 560;
  color: var(--text);
  padding: 14px 26px 14px 0;
  cursor: pointer; position: relative;
  display: block;
}
.faq-q::after {
  content: "›";
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  font-size: 20px; color: var(--text-faint);
  transition: transform .18s;
}
.faq-item.open .faq-q::after { transform: translateY(-50%) rotate(90deg); }
.faq-a {
  font-size: 13.5px; color: var(--text-muted);
  padding: 0 0 14px;
  display: none;
}
.faq-item.open .faq-a { display: block; }

/* ---------------- 页脚 ---------------- */
.foot {
  text-align: center;
  padding: 22px 10px 8px;
  font-size: 12.5px; color: var(--text-faint);
}
.foot-dim { margin-top: 4px; font-size: 11.5px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(15, 23, 42, .93);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  padding: 11px 18px;
  /* 长文案会换行，用圆角矩形而不是胶囊形 */
  border-radius: var(--radius-sm);
  z-index: 99;
  animation: toast-in .2s ease;
  max-width: min(340px, calc(100vw - 40px));
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .2);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------- 大屏优化 ---------------- */
@media (min-width: 640px) {
  .page { max-width: 600px; padding: 0 20px 56px; }
  .hero { padding: 56px 4px 32px; }
  .hero-title { font-size: 28px; }
}
