/* =============================================================================
 * 公共层样式：全站导航 / 页脚 sitemap / 移动端底部栏（design/56 §5.1）
 *
 * 命名全部加 `ruisi-` 前缀，且**不与各页自有样式冲突**：
 *   文档型页面各自带内联 <style>（.doc-nav/.doc-footer…），本文件只负责**新增加的部分**。
 * 颜色一律用 var(--x, 兜底值)：各页的变量名不统一（有的 --ink 有的 --r-ink）。
 * ============================================================================= */

/* ---------- 全站导航（A 型页面） ---------- */
.ruisi-nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 18px;
  /* 顶部安全区：页面用了 viewport-fit=cover（会员/开通等页），横屏或刘海屏下
     导航会压到刘海。原先只有 redeem.html 给自己的 .nav 加了这一段，
     导航上收公共层后必须在这里补回，否则是功能退化（env() 在无刘海设备为 0）。 */
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, 4vw) 10px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line, #eee9e1);
}
.ruisi-nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; color: inherit; text-decoration: none; white-space: nowrap; }
.ruisi-nav-brand img { width: 34px; height: 34px; border-radius: 11px; object-fit: cover; display: block; }
.ruisi-nav-brand small { display: block; font-size: 8px; letter-spacing: .12em; color: #9a9da1; font-weight: 600; line-height: 1.2; }
.ruisi-nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.ruisi-nav-links a {
  position: relative;                                   /* 供选中下划线定位 */
  padding: 0 14px; height: 44px;                         /* 与右侧登录按钮**严格等高**（原先 44 vs 40 不齐） */
  border-radius: 12px; font-size: 14px; font-weight: 700;
  color: var(--muted, #6f747a); text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center;             /* 触控 ≥44px（design/56 §7） */
}
.ruisi-nav-links a:hover { color: var(--ink, #202124); background: rgba(0, 0, 0, .04); }
/**
 * 选中态 = **黄色下划线**（不是黄色填充块）。
 *
 * 为什么改：填充块与右侧「预约体验 / 登录」主 CTA 长得很像，两个并排的黄色块互相抢焦点，
 * 而且高度稍差（44 vs 40）就明显"没对齐"。下划线既表达"当前在哪一栏"，又不与主按钮混淆。
 *
 * 用 ::after 伪元素而不是 border-bottom：border 会把文字顶上去、产生布局位移。
 */
.ruisi-nav-links a.on { color: var(--ink, #202124); background: transparent; font-weight: 900; }
.ruisi-nav-links a.on::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px;
  height: 3px; border-radius: 999px; background: var(--yellow, #ffc928);
}
.ruisi-nav-login {
  margin-left: 10px; padding: 0 18px; height: 44px;      /* 与导航项等同高 */
  display: inline-flex; align-items: center;             /* 文字垂直居中（原先靠 padding 顶） */
  border: 0; cursor: pointer; border-radius: 999px;
  font-size: 14px; font-weight: 800;
  background: var(--yellow, #ffc928); color: #1e1e1e;
}
.ruisi-nav-toggle { display: none; }

/* 移动端：导航折叠为抽屉 */
@media (max-width: 768px) {
  .ruisi-nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-left: auto;
    border: 0; background: transparent; cursor: pointer; font-size: 20px;
  }
  .ruisi-nav-links { display: none; }
  .ruisi-nav.open .ruisi-nav-links {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; left: 0; right: 0; top: 100%;
    padding: 8px 12px 14px; margin: 0;
    background: #fff; border-bottom: 1px solid var(--line, #eee9e1);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .12);
  }
  .ruisi-nav-links a { border-radius: 12px; }
  /* 抽屉里是纵向排列：下划线在竖排里很怪，改成浅黄底 */
  .ruisi-nav-links a.on { background: rgba(255, 201, 40, .18); }
  .ruisi-nav-links a.on::after { display: none; }
  .ruisi-nav-login { margin: 8px 0 0; width: 100%; height: 44px; }
}

/* ---------- 导航 overlay 变体（index 的 8 屏全屏分屏） ----------
 * index 的 body 是 overflow:hidden、每屏 100svh + scroll-snap，导航必须**浮在首屏之上**
 * （绝对定位）：一旦占正常流就会挤掉 65px，整屏高度全部对不上。
 * 配色沿用原 .site-nav 的「深色首图上的白字」口径；抽屉展开后是白底，
 * 所以在下面的媒体查询里再把链接改回深色。 */
.ruisi-nav-overlay {
  position: absolute; top: 0; left: 0; right: 0;
  background: transparent; color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.ruisi-nav-overlay .ruisi-nav-brand small { color: rgba(255, 255, 255, .62); }
.ruisi-nav-overlay .ruisi-nav-links a { color: rgba(255, 255, 255, .82); }
.ruisi-nav-overlay .ruisi-nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.ruisi-nav-overlay .ruisi-nav-links a.on { color: #fff; }
.ruisi-nav-overlay .ruisi-nav-links a.on::after { background: #d8ff63; }

@media (max-width: 768px) {
  /* 抽屉是白底：overlay 的白字在白底上会看不见，改回深色 */
  .ruisi-nav-overlay .ruisi-nav-links a,
  .ruisi-nav-overlay .ruisi-nav-links a.on { color: #202124; }
  .ruisi-nav-overlay .ruisi-nav-links a.on { background: rgba(255, 201, 40, .18); }
}

/* ---------- 页脚 sitemap（A/B 型页面共用，与导航同源生成） ---------- */
.ruisi-sitemap {
  padding: 26px max(16px, 4vw) calc(26px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line, #eee9e1);
  color: var(--muted, #6f747a);
  font-size: 13px;
  text-align: left;
}
.ruisi-sitemap-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; color: var(--ink, #202124); margin-bottom: 12px; }
.ruisi-sitemap-brand img { width: 32px; height: 32px; border-radius: 10px; object-fit: cover; display: block; }
.ruisi-sitemap-brand small { display: block; font-size: 8px; letter-spacing: .12em; color: #9a9da1; font-weight: 600; }
.ruisi-sitemap-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.ruisi-sitemap-nav a { color: var(--muted, #6f747a); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.ruisi-sitemap-nav a:hover { color: var(--ink, #202124); }
.ruisi-sitemap-legal { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; }
.ruisi-sitemap-legal a { color: inherit; text-decoration: none; }
.ruisi-sitemap-copy { margin: 14px 0 0; font-size: 11px; }
/* 客服联系方式：付款类页面（会员/商城）必须有可达的客服入口 */
.ruisi-sitemap-contact { margin: 12px 0 0; font-size: 12px; }
.ruisi-sitemap-contact a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ruisi-sitemap-copy .icp { display: inline-block; margin-top: 6px; color: inherit; }

/* ---------- 移动端底部栏（4 格，design/56 §4.2） ---------- */
.ruisi-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: end;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--line, #eee9e1);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.ruisi-tabbar a, .ruisi-tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 52px;                 /* 触控 ≥44px */
  border: 0; background: transparent; cursor: pointer;
  font-size: 11px; font-weight: 700; color: var(--muted, #6f747a); text-decoration: none;
}
.ruisi-tabbar a.on, .ruisi-tabbar button.on { color: var(--ink, #202124); }
.ruisi-tabbar .ruisi-tab-cta {
  margin-top: -18px; border-radius: 999px;
  background: var(--yellow, #ffc928); color: #1e1e1e;
  box-shadow: 0 8px 18px rgba(255, 201, 40, .45);
}
.ruisi-tabbar-page { padding-bottom: 92px; }   /* 给底部栏留白（与旧实现一致） */

/* ---------- 新页面的通用脚手架 ----------
 * 前缀用 `ruisi-site-`（而非 ruisi-card / ruisi-btn）：`ruisi-ui.css` 里已有 `.ruisi-card` 等
 * 通用名，同名会被后者覆盖 —— 新组件一律加不易冲突的前缀。 */
.ruisi-site-page {
  width: min(100%, 860px); margin: 0 auto;
  padding: 28px max(16px, 4vw) 40px;
  color: var(--ink, #202124);
}
.ruisi-site-panel {
  background: var(--white, #fff);
  border: 1px solid var(--line, #eee9e1);
  border-radius: var(--radius, 18px);
  box-shadow: var(--shadow, 0 10px 30px rgba(95, 78, 45, .07));
  padding: 28px 24px;
}
.ruisi-site-eyebrow {
  margin: 0 0 10px; font-size: 11px; font-weight: 900;
  letter-spacing: .14em; color: var(--orange, #ff7a45);
}
.ruisi-site-panel h1 { margin: 0 0 12px; font-size: clamp(24px, 5vw, 34px); line-height: 1.25; }
.ruisi-site-panel p { margin: 0 0 14px; font-size: 15px; line-height: 1.9; color: var(--muted, #6f747a); }
.ruisi-site-panel strong { color: var(--ink, #202124); }
.ruisi-site-note {
  background: #fff8e8; border: 1px solid #f3dfae; border-radius: 12px;
  padding: 12px 14px; font-size: 13px; color: #6b5c2a;
}
.ruisi-site-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ruisi-site-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;              /* 触控 ≥44px（design/56 §7） */
  border-radius: 999px; font-size: 15px; font-weight: 800;
  text-decoration: none; border: 1px solid var(--line, #eee9e1);
  background: var(--white, #fff); color: var(--ink, #202124);
}
.ruisi-site-btn.primary {
  border-color: transparent; background: var(--yellow, #ffc928); color: #1e1e1e;
}
