/* ============================================================
   Heyou 官网 · 全局样式
   ------------------------------------------------------------
   ⚠️ 这里所有颜色都**取自小程序的 miniprogram/app.wxss**，一个都不许另调。
      官网和小程序长得不像一家人，是品牌建设里最亏的一种错。
      token 的完整依据见 docs/DESIGN-名片配色规范.md。

   ⚠️ 两条继承自小程序、有实测数字的规矩（别"看着差不多"调回去）：
      1. --text-3 (#9aa69f) 在浅底上只有约 2.5:1，**小字号禁用**。
         小字一律用 --text-2 (#5e6b64，在 --surface-2 上 5.10:1)。
      2. --primary (#0e9f6e) 直接当正文文字色不达标（约 3:1）。
         绿色文字用 --primary-ink (#0b7d57)。

   ⚠️ 本站**不做深色模式**。原因不是偷懒：logo 是"白底转透明 + 颜色不预乘"处理出来的
      （见 scripts/build-site-assets.py），只能用在浅色底上，深色底会泛白晕。
      品牌站固定浅色也更稳。
   ============================================================ */

:root {
  /* ---------- 底色与面 ---------- */
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f4f5f1;
  --line: rgba(31, 41, 36, 0.07);
  --line-strong: rgba(31, 41, 36, 0.14);

  /* ---------- 文字 ---------- */
  --text: #1f2a25;
  --text-2: #5e6b64;
  --text-3: #9aa69f;      /* 只允许用在 ≥18px 的非关键信息上 */
  --text-on-brand: #ffffff;

  /* ---------- 品牌 ---------- */
  --primary: #0e9f6e;
  --primary-ink: #0b7d57;   /* 绿色**文字**专用（--primary 当文字不达标） */
  --primary-light: #e3f5ec;
  --primary-border: rgba(14, 159, 110, 0.32);
  --brand-grad: linear-gradient(135deg, #0d9488 0%, #10b981 100%);

  /* ---------- 形状 ---------- */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* 阴影抄自小程序 .card：0 6rpx 24rpx rgba(15,82,60,.05) */
  --shadow: 0 1px 2px rgba(15, 82, 60, 0.04), 0 8px 24px rgba(15, 82, 60, 0.05);
  --shadow-lift: 0 2px 4px rgba(15, 82, 60, 0.05), 0 14px 34px rgba(15, 82, 60, 0.09);

  --wrap: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
          "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ============================================================
   基础
   ============================================================ */

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }

p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================
   顶部导航
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 247, 0.86);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-header .brand img { height: 30px; width: auto; }
.site-header .brand:hover { text-decoration: none; }

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 7px 13px;
  border-radius: var(--r-pill);
  font-size: 15px;
  color: var(--text-2);
  white-space: nowrap;
}
.site-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  background: var(--primary-light);
  color: var(--primary-ink);
  font-weight: 600;
}

/* 「打开小程序」按钮 —— 本期还没有小程序码，先占位隐藏。
   过审后把 hidden 属性删掉即可（位置、样式都已就位）。 */
.btn-open-mp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--brand-grad);
  color: var(--text-on-brand);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.28);
}
.btn-open-mp:hover { text-decoration: none; opacity: 0.94; }

/* ============================================================
   首屏
   ============================================================ */

.hero { padding: 56px 0 30px; }

.hero .wrap {
  display: grid;
  gap: 34px;
  align-items: center;
}

.hero h1 {
  font-size: 32px;
  line-height: 1.32;
}

.hero h1 .hl {
  background: linear-gradient(transparent 62%, rgba(16, 185, 129, 0.22) 62%);
  padding: 0 2px;
}

.hero .lede {
  margin-top: 18px;
  font-size: 17px;
  color: var(--text-2);
  max-width: 34em;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--brand-grad);
  color: var(--text-on-brand);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.3);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

.hero-art { justify-self: center; }
.hero-art img { width: 210px; height: auto; }

/* ============================================================
   小程序码占位卡
   ============================================================ */

.mp-card {
  margin-top: 26px;
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  max-width: 460px;
}

.mp-code {
  flex-shrink: 0;
  width: 104px;
  height: 104px;
  border-radius: var(--r-md);
  border: 2px dashed var(--primary-border);
  background: var(--primary-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--primary-ink);
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
}

.mp-card .mp-text strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}
.mp-card .mp-text span {
  font-size: 14px;
  color: var(--text-2);
}

/* ============================================================
   通用分节
   ============================================================ */

.section { padding: 56px 0; }
.section-alt { background: var(--surface-2); }

.section-head { max-width: 40em; margin-bottom: 30px; }

.section-head h2 { font-size: 24px; }

.section-head p {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 16px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--primary-ink);
  text-transform: uppercase;
}

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h3 { font-size: 17px; margin-bottom: 10px; }
.card p { color: var(--text-2); font-size: 15px; }

/* 处境卡 —— 突出"你遇到过吗"，所以用编号 + 稍大字号 */
.situation .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-ink);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}
.situation h3 { font-size: 16px; line-height: 1.55; }

/* ---------- 四步 ---------- */
.steps { counter-reset: step; }

.step {
  position: relative;
  padding-left: 52px;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: var(--text-on-brand);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.26);
}

.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: 15px; }
.step .hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}

/* ---------- 「我们不做的事」---------- */
.notdo .card {
  border-left: 3px solid var(--primary);
  padding-left: 21px;
}
.notdo .card h3 { color: var(--text); }
.notdo .card .why {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-2);
}

/* ============================================================
   页脚
   ============================================================ */

.site-footer {
  margin-top: 20px;
  padding: 40px 0 46px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  color: var(--text-2);
}

.site-footer .cols {
  display: grid;
  gap: 26px;
}

.site-footer h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text);
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--primary-ink); }

.site-footer .legal {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.9;
}
.site-footer .legal p { margin-bottom: 4px; }

/* ============================================================
   响应式 —— 手机优先（主要流量来自微信里点开）
   ============================================================ */

@media (min-width: 720px) {
  .hero { padding: 76px 0 46px; }
  .hero .wrap { grid-template-columns: 1.35fr 1fr; gap: 48px; }
  .hero h1 { font-size: 44px; }
  .hero .lede { font-size: 18px; }
  .hero-art img { width: 290px; }

  .section { padding: 76px 0; }

  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .notdo { grid-template-columns: repeat(2, 1fr); }

  .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; }

  .site-nav { flex-wrap: nowrap; }
}

@media (min-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .hero h1 { font-size: 50px; }
}

/* 窄屏：导航不折成两行太挤，让它横向滚动 */
@media (max-width: 560px) {
  .site-header .wrap { min-height: 56px; }
  .site-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 6px 10px; font-size: 14px; }
  .hero .lede { font-size: 16px; }
  .mp-card { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   内页（怎么用 / 关于 / 常见问题 / 联系我们 / 协议页 / 404）
   ============================================================ */

/* 窄栏 —— 内页正文比首页窄，一行字数少更好读 */
.wrap.narrow { max-width: 780px; }

.page-head { padding: 44px 0 30px; }
.page-head h1 { font-size: 30px; }
.page-head .lede {
  margin-top: 12px;
  font-size: 16px;
  color: var(--text-2);
  max-width: 40em;
}

/* ---------- 「怎么用」的四步 ---------- */
.flow {
  counter-reset: flow;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 36px;
}

.flow-item {
  position: relative;
  padding-left: 56px;
}

.flow-item::before {
  counter-increment: flow;
  content: counter(flow);
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: var(--text-on-brand);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.26);
}

.flow-item h2 { font-size: 19px; margin-bottom: 10px; }
.flow-item p { font-size: 15px; color: var(--text); margin-bottom: 8px; }
.flow-item .note {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 14px;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 10px 14px;
}

/* ---------- 规则卡片列表 ---------- */
.rule-list { display: grid; gap: 14px; }

.rule {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: var(--r-md);
  padding: 18px 20px;
}
.rule h3 { font-size: 16px; margin-bottom: 6px; }
.rule p { font-size: 15px; color: var(--text-2); }

.cta-line { margin-top: 30px; font-size: 15px; color: var(--text-2); }

/* ---------- 「关于」的长文 ---------- */
.doc-prose h2 { font-size: 20px; margin: 38px 0 12px; }
.doc-prose h2:first-child { margin-top: 0; }
.doc-prose p { font-size: 16px; color: var(--text); margin-bottom: 14px; }

.plain-list {
  margin: 12px 0 0;
  padding-left: 1.25em;
  color: var(--text-2);
  font-size: 15px;
}
.plain-list li { margin-bottom: 6px; }

/* 键值表格 —— 用 grid + 1px 间隙做分隔线，比 table 好控制 */
.table-simple {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: 14px;
}
.table-simple .row {
  display: grid;
  gap: 4px;
  background: var(--surface);
  padding: 16px 18px;
}
.table-simple .k { font-weight: 600; font-size: 15px; }
.table-simple .v { font-size: 15px; color: var(--text-2); }

/* ---------- 常见问题（零 JS：用 details/summary）---------- */
.faq-list { display: grid; gap: 10px; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 20px;
  box-shadow: var(--shadow);
}

.faq-item summary {
  cursor: pointer;
  padding: 17px 0;
  font-size: 16px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  color: var(--primary-ink);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item[open] summary { padding-bottom: 14px; }

.faq-a {
  padding-bottom: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.faq-a p { font-size: 15px; color: var(--text-2); }
.faq-a p + p, .faq-a > p + ul { margin-top: 10px; }
.faq-a ul { margin: 8px 0 0; padding-left: 1.25em; }

/* ---------- 联系我们 ---------- */
.contact-grid { display: grid; gap: 16px; }
.contact-card h3 { font-size: 17px; margin-bottom: 8px; }
.contact-card p { font-size: 15px; color: var(--text-2); }
.contact-card .big { font-size: 17px; font-weight: 600; margin: 4px 0 10px; }
.contact-card .note {
  margin-top: 12px;
  font-size: 14px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 10px 14px;
}
.contact-card .plain-list { font-size: 14px; }

.operator-box {
  margin-top: 26px;
  padding: 26px 22px;
  background: var(--primary-light);
  border-radius: var(--r-lg);
  text-align: center;
}
.operator-box h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--primary-ink);
  margin-bottom: 8px;
}
.operator-box .big { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.operator-box p { font-size: 14px; color: var(--text-2); }

/* ---------- 协议正文 ---------- */
.document {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 24px;
  box-shadow: var(--shadow);
}

.document h2 { font-size: 18px; margin: 34px 0 12px; }
.document h2:first-child { margin-top: 0; }

/* 协议是主要阅读内容 ⇒ 正文用最深的 --text，不用 --text-2 */
.document p { font-size: 15px; color: var(--text); }
.document p + p { margin-top: 10px; }

.document .doc-meta {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 0;
  margin-bottom: 2px;
}
.document .doc-num { font-weight: 600; margin-top: 16px; }
.document .doc-indent { padding-left: 16px; }

.document .doc-list {
  margin: 8px 0 0;
  padding-left: 1.2em;
  font-size: 15px;
  color: var(--text);
}
.document .doc-list li { margin-bottom: 6px; }

/* 【】标出的条款 —— 协议里说"与你权益密切相关"，要看得出来 */
.document .hl,
.faq-a .hl {
  font-weight: 600;
  color: var(--text);
  background: rgba(16, 185, 129, 0.15);
  border-radius: 4px;
  padding: 0 3px;
}

.doc-foot {
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 64px 0 86px; }
.nf-art { width: 128px; margin: 0 auto 20px; }
.notfound h1 { font-size: 28px; }
.notfound .lede { margin: 12px auto 26px; }
.notfound .hero-actions { justify-content: center; }

/* ---------- 页脚 logo ---------- */
.footer-logo { height: 26px; width: auto; margin-bottom: 10px; }

@media (min-width: 720px) {
  .page-head { padding: 62px 0 40px; }
  .page-head h1 { font-size: 36px; }
  .flow-item { padding-left: 62px; }
  .flow-item h2 { font-size: 21px; }
  .document { padding: 44px 42px; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .table-simple .row { grid-template-columns: 148px 1fr; gap: 18px; }
  .doc-prose h2 { font-size: 22px; }
}

@media (max-width: 560px) {
  .document { padding: 24px 18px; }
  .flow-item { padding-left: 46px; }
  .flow-item::before { width: 32px; height: 32px; font-size: 15px; }
  .page-head { padding: 34px 0 24px; }
  .page-head h1 { font-size: 26px; }
}
