:root {
  --bg: #fffaf3;
  --ink: #2b2620;
  --muted: #7a7066;
  --primary: #ff7a3d;
  --primary-dark: #e85f23;
  --teal: #2bb3a3;
  --card: #ffffff;
  --shadow: 0 8px 24px rgba(120, 90, 60, 0.12);
  --shadow-lg: 0 18px 50px rgba(120, 90, 60, 0.18);
  --radius: 18px;
  --maxw: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

/* 去除移动端点击高亮闪烁，贴近原生体验 */
a, button { -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 18px;
}

/* 导航 */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 250, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(120, 90, 60, 0.08);
  transition: box-shadow .25s ease, background .25s ease;
}
.nav--scrolled {
  box-shadow: 0 6px 20px rgba(120, 90, 60, 0.1);
  background: rgba(255, 250, 243, 0.98);
}
.nav__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav__logo { font-size: 22px; font-weight: 800; color: var(--primary); text-decoration: none; letter-spacing: .5px; }
.nav__links { display: flex; gap: 22px; margin-left: auto; }
.nav__links a { color: var(--ink); text-decoration: none; font-weight: 600; position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px;
  background: var(--primary); border-radius: 2px; transition: width .2s ease;
}
.nav__links a:hover { color: var(--primary); }
.nav__links a:hover::after { width: 100%; }
.nav__cta { margin-left: 8px; }

/* 移动端汉堡按钮（桌面隐藏） */
.nav__toggle {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  border: none; background: transparent; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  padding: 0;
}
.nav__toggle span {
  display: block; width: 22px; height: 2px; border-radius: 2px;
  background: var(--ink);
  transition: transform .25s ease, opacity .2s ease;
}
.nav__toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-active span:nth-child(2) { opacity: 0; }
.nav__toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn--ghost { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn--ghost:hover { background: rgba(255, 122, 61, 0.08); }
.btn--lg { padding: 16px 34px; font-size: 19px; }
.btn--block { display: block; width: 100%; text-align: center; }
.btn--wxlink { background: #07c160; border-color: #07c160; }
.btn--wxlink:hover { background: #06ad56; border-color: #06ad56; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(7, 193, 96, 0.32); }

.hero__enter { margin-top: 18px; }
.hero__enter .hero__note { margin-top: 0; margin-bottom: 14px; }
/* 点击「打开小程序」后的高亮动画（URL Link 未配置时回落到二维码） */
.hero__enter--flash .qr-box {
  animation: qrFlash 1.5s ease;
  border-radius: 14px;
}
@keyframes qrFlash {
  0%   { box-shadow: 0 0 0 0 rgba(255, 122, 61, 0.0); transform: scale(1); }
  25%  { box-shadow: 0 0 0 8px rgba(255, 122, 61, 0.28); transform: scale(1.04); }
  100% { box-shadow: 0 0 0 0 rgba(255, 122, 61, 0.0); transform: scale(1); }
}

/* 首屏 */
.hero {
  background: radial-gradient(1200px 600px at 50% -10%, #fff6ec 0%, #ffe9d6 55%, #ffe1cb 100%);
  padding: 84px 20px 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 85% 15%, rgba(43, 179, 163, 0.10), transparent 70%);
  pointer-events: none;
}
.hero__inner { max-width: 760px; margin: 0 auto; position: relative; }
.hero__title {
  font-size: clamp(30px, 7vw, 46px); line-height: 1.25; font-weight: 800;
  background: linear-gradient(120deg, #2b2620 0%, #e85f23 120%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__subtitle { font-size: 20px; color: var(--muted); margin: 20px 0 32px; }
.hero__actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero__note { margin-top: 22px; color: var(--muted); font-size: 16px; }

/* 区块标题 */
.section__title {
  text-align: center;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 800;
  margin-bottom: 14px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}
.section__title::after {
  content: ""; display: block; width: 56px; height: 4px; border-radius: 4px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, var(--primary), var(--teal));
}
.features, .membership, .recharge, .safe {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 20px;
}

/* 功能卡片 */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 36px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(120, 90, 60, 0.06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 122, 61, 0.4);
}
.card__icon { font-size: 40px; margin-bottom: 12px; }
.card h3 { font-size: 21px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 16px; }

/* 会员 */
.membership { text-align: center; }
.membership__lead { color: var(--muted); margin-bottom: 36px; }
.plan {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  background: linear-gradient(180deg, #fffdfa 0%, #fff6ee 100%);
  border-radius: var(--radius);
  padding: 36px 30px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--primary);
  transition: transform .2s ease;
}
.plan:hover { transform: translateY(-4px); }
.plan__badge {
  position: absolute; top: -14px; right: 24px;
  background: var(--primary); color: #fff;
  padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.plan__name { font-size: 26px; margin-bottom: 8px; }
.plan__price { font-size: 18px; color: var(--muted); margin-bottom: 20px; }
.plan__num { font-size: 40px; font-weight: 800; color: var(--primary); }
.plan__list { list-style: none; text-align: left; margin: 0 0 24px; }
.plan__list li { padding: 8px 0 8px 26px; position: relative; }
.plan__list li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800; }

/* 充值 */
.recharge { text-align: center; }
.recharge__lead { color: var(--muted); margin: 10px 0 28px; }

/* 安全 */
.safe__list { max-width: 720px; margin: 30px auto 0; list-style: none; }
.safe__list li { padding: 12px 0 12px 30px; position: relative; border-bottom: 1px solid rgba(120,90,60,.08); }
.safe__list li::before { content: "🛡"; position: absolute; left: 0; }

/* 页脚 */
.footer { background: #2b2620; color: #e9e2d8; padding: 28px 20px; }
.footer__inner { max-width: 1080px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 15px; }

/* 二维码槽位（小程序码 / 收款码） */
.qr-box { display: inline-block; margin: 18px auto 0; text-align: center; }
.qr-img {
  width: 200px; height: 200px; object-fit: contain;
  border-radius: 14px; box-shadow: var(--shadow); background: #fff;
  border: 1px solid rgba(120, 90, 60, 0.1);
}
.qr-fallback {
  display: none; width: 200px; height: 200px;
  border: 2px dashed rgba(120, 90, 60, 0.35); border-radius: 14px;
  align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-size: 13px; padding: 12px; line-height: 1.6;
}
.qr-fallback code { font-size: 11px; word-break: break-all; color: var(--primary-dark); }
.qr-caption { margin-top: 12px; color: var(--muted); font-size: 15px; }
.features__lead { max-width: 760px; margin: 14px auto 0; color: var(--muted); text-align: center; font-size: 17px; }
.recharge__qr { margin-top: 30px; }
.recharge__qr-note { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.recharge__qrs { display: flex; gap: 32px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.qr-cap { margin-top: 12px; color: var(--muted); font-size: 15px; }

/* 充值套餐选择（合并自 recharge.html） */
.pkg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 460px; margin: 28px auto 0; }
.pkg__item {
  border: 2px solid rgba(120,90,60,.12); border-radius: 14px; padding: 18px 12px;
  text-align: center; cursor: pointer; background: #fff; transition: all .15s ease;
}
.pkg__item.is-active { border-color: var(--primary); box-shadow: var(--shadow); }
.pkg__coin { font-size: 24px; font-weight: 800; color: var(--primary); }
.pkg__price { color: var(--muted); font-size: 15px; margin-top: 4px; }
.pay__submit { margin: 28px auto 0; max-width: 460px; }
.pay__note { margin: 16px auto 0; max-width: 460px; font-size: 14px; color: var(--muted); text-align: center; line-height: 1.6; }
.pay__loading { opacity: .6; pointer-events: none; }

/* ============ 响应式 / 多端自适应 ============ */

/* 平板：缩小间距，功能卡 2 列 */
@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .features, .membership, .recharge, .safe { padding: 56px 20px; }
  .hero { padding: 72px 20px 84px; }
  .footer__inner { max-width: 100%; }
}

/* 手机：折叠导航 + 单列 + 字号收敛 + 安全区 */
@media (max-width: 860px) {
  .nav__inner {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + 0px);
  }
  .nav__toggle { display: flex; }
  .nav__cta { display: none; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(255, 250, 243, 0.98);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(120, 90, 60, 0.08);
    margin-left: 0;
    max-height: 0; overflow: hidden;
    transition: max-height .3s ease;
  }
  .nav__links--open { max-height: 340px; box-shadow: 0 10px 24px rgba(120, 90, 60, 0.08); }
  .nav__links a { padding: 15px 20px; font-size: 17px; }
  .nav__links a::after { display: none; }

  .cards { grid-template-columns: 1fr; }
  .hero { padding: 88px 18px 64px; }
  .hero__subtitle { font-size: 17px; }
  .features, .membership, .recharge, .safe { padding: 48px 18px; }
  .footer__inner {
    flex-direction: column; align-items: center; text-align: center; gap: 8px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  .qr-img, .qr-fallback {
    width: clamp(150px, 40vw, 200px);
    height: clamp(150px, 40vw, 200px);
  }
}

/* 小屏手机：进一步收敛 */
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .recharge__qrs { gap: 18px; }
  .plan { padding: 28px 20px; }
  .card { padding: 24px 18px; }
  .nav__logo { font-size: 20px; }
}

/* ============ 操作系统级微调 ============ */
/* iOS：刘海 / 灵动岛安全区已在导航与页脚用 env() 处理；补充字体平滑 */
.os-ios body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
