// ============ 玄境 sections ============
const { NAV, ARTS, PRODUCTS, BRANCHES, HEXAGRAMS, TESTI } = window.DATA;

// reveal-on-scroll wrapper
function Reveal({ children, delay = 0, as: Tag = 'div', className = '', style = {} }) {
  const ref = useRef(null);
  useEffect(() => {
    const el = ref.current;
    const io = new IntersectionObserver((es) => {
      es.forEach(e => { if (e.isIntersecting) { setTimeout(() => el.classList.add('in'), delay); io.unobserve(el); } });
    }, { threshold: 0.16 });
    io.observe(el);
    return () => io.disconnect();
  }, [delay]);
  return <Tag ref={ref} className={`reveal ${className}`} style={style}>{children}</Tag>;
}

// section heading (brush title + en sub + red divider)
function Heading({ cn, en, enMain, color = '#F4ECD3', size = 64, sub }) {
  const lang = useLang();
  if (lang === 'en' && enMain) {
    return (
      <div style={{ textAlign: 'center' }}>
        <h2 style={{ fontFamily: 'var(--font-en-serif)', fontWeight: 700, fontSize: size * 0.74, color, letterSpacing: '.01em', lineHeight: 1.08 }}>{enMain}</h2>
        <div className="divider-red" />
      </div>
    );
  }
  return (
    <div style={{ textAlign: 'center' }}>
      {sub && <div className="eyebrow-cn" style={{ color, opacity: .9, marginBottom: 14 }}>{sub}</div>}
      <h2 className="sec-title" style={{ fontSize: size, color }}>{cn}</h2>
      {en && <div className="sec-sub-en" style={{ color, fontSize: 24, marginTop: 16 }}>{en}</div>}
      <div className="divider-red" />
    </div>
  );
}

/* ---------------- NAV ---------------- */
function Nav({ cartCount, onCart, lang, setLang }) {
  return (
    <nav className="nav">
      <div className="wrap nav-inner">
        <a href="#top" className="nav-logo"><CloudMark /> 玄境</a>
        <div className="nav-links">
          {NAV.map(n => (
            <a key={n.en} href={n.href} className="nav-link">{lang === 'en' ? n.en : n.cn}<span>{lang === 'en' ? n.cn : n.en}</span></a>
          ))}
          <div className="nav-divider" />
          <span className="nav-lang" onClick={() => setLang(lang === 'en' ? 'cn' : 'en')}>{lang === 'en' ? '中文' : 'EN'}</span>
          <button className="nav-seek" onClick={onCart}>
            {lang === 'en' ? 'Seek Destiny' : '问道'}
            {cartCount > 0 && <span className="cart-pip">{cartCount}</span>}
          </button>
        </div>
      </div>
    </nav>
  );
}

/* ---------------- HERO ---------------- */
function HeroDragon() {
  const wrapRef = useRef(null);
  const bgRef = useRef(null);
  const specRef = useRef(null);
  const canvasRef = useRef(null);
  const target = useRef({ x: 0, y: 0, mx: 0, my: 0, over: 0 });
  const cur = useRef({ x: 0, y: 0, mx: 0, my: 0, over: 0 });

  // mouse / scroll parallax + scale-light tracking
  useEffect(() => {
    const wrap = wrapRef.current;
    const onMove = (e) => {
      const r = wrap.getBoundingClientRect();
      target.current.x = ((e.clientX - r.left) / r.width - 0.5) * 2;
      target.current.y = ((e.clientY - r.top) / r.height - 0.5) * 2;
      target.current.mx = e.clientX - r.left;
      target.current.my = e.clientY - r.top;
      target.current.over = 1;
    };
    const onLeave = () => { target.current.x = 0; target.current.y = 0; target.current.over = 0; };
    wrap.addEventListener('mousemove', onMove);
    wrap.addEventListener('mouseleave', onLeave);
    let raf;
    const tick = () => {
      const t = target.current, c = cur.current;
      c.x += (t.x - c.x) * 0.06; c.y += (t.y - c.y) * 0.06;
      c.mx += (t.mx - c.mx) * 0.18; c.my += (t.my - c.my) * 0.18;
      c.over += (t.over - c.over) * 0.08;
      const sc = window.scrollY || 0;
      const tf = `scale(1.12) translate(${c.x * -16}px, ${c.y * -12 + sc * 0.12}px)`;
      if (bgRef.current) bgRef.current.style.transform = tf;
      if (specRef.current) {
        specRef.current.style.transform = tf;
        specRef.current.style.opacity = c.over * 0.9;
        specRef.current.style.setProperty('--mx', (c.mx + 40) + 'px');
        specRef.current.style.setProperty('--my', (c.my + 40) + 'px');
      }
      raf = requestAnimationFrame(tick);
    };
    tick();
    return () => { cancelAnimationFrame(raf); wrap.removeEventListener('mousemove', onMove); wrap.removeEventListener('mouseleave', onLeave); };
  }, []);

  // rising gold embers
  useEffect(() => {
    const cv = canvasRef.current;
    const ctx = cv.getContext('2d');
    let w, h, raf;
    const resize = () => { const r = cv.getBoundingClientRect(); w = cv.width = r.width; h = cv.height = r.height; };
    resize();
    const ro = new ResizeObserver(resize); ro.observe(cv);
    const N = 46;
    const P = Array.from({ length: N }, () => ({
      x: Math.random() * w, y: Math.random() * h,
      r: Math.random() * 1.8 + 0.6, sp: Math.random() * 0.5 + 0.18,
      dr: (Math.random() - 0.5) * 0.4, a: Math.random() * 0.6 + 0.2,
      tw: Math.random() * Math.PI * 2,
    }));
    const draw = () => {
      ctx.clearRect(0, 0, w, h);
      for (const p of P) {
        p.y -= p.sp; p.x += p.dr + Math.sin(p.tw += 0.02) * 0.15;
        if (p.y < -6) { p.y = h + 6; p.x = Math.random() * w; }
        const tw = 0.6 + Math.sin(p.tw) * 0.4;
        ctx.beginPath();
        ctx.arc(p.x, p.y, p.r, 0, Math.PI * 2);
        ctx.fillStyle = `rgba(255,${200 + Math.floor(Math.random() * 20)},120,${p.a * tw})`;
        ctx.shadowBlur = 8; ctx.shadowColor = 'rgba(255,196,90,0.9)';
        ctx.fill();
      }
      raf = requestAnimationFrame(draw);
    };
    draw();
    return () => { cancelAnimationFrame(raf); ro.disconnect(); };
  }, []);

  return (
    <div ref={wrapRef} style={{ position: 'relative', height: '60vh', minHeight: 470, overflow: 'hidden', background: 'radial-gradient(150% 130% at 72% 16%, #CDA033 0%, #B07F12 40%, #7A540C 80%, #3E2A06 100%)' }}>
      <div ref={bgRef} style={{ position: 'absolute', inset: -40, backgroundImage: 'url("assets/hero-dragon.png")', backgroundSize: 'cover', backgroundPosition: 'center 26%', willChange: 'transform' }} />
      {/* specular layer — glowing gold scales under the cursor */}
      <div ref={specRef} style={{
        position: 'absolute', inset: -40, opacity: 0,
        backgroundImage: 'url("assets/hero-dragon.png")', backgroundSize: 'cover', backgroundPosition: 'center 26%',
        filter: 'brightness(1.42) saturate(1.5) contrast(1.08)', mixBlendMode: 'screen', willChange: 'transform, opacity',
        WebkitMaskImage: 'radial-gradient(circle 190px at var(--mx,50%) var(--my,50%), rgba(0,0,0,.82) 0%, rgba(0,0,0,.4) 42%, transparent 72%)',
        maskImage: 'radial-gradient(circle 190px at var(--mx,50%) var(--my,50%), rgba(0,0,0,.82) 0%, rgba(0,0,0,.4) 42%, transparent 72%)',
      }} />
      {/* drifting qi mist */}
      <div className="qi-mist" style={{ position: 'absolute', inset: 0, pointerEvents: 'none', mixBlendMode: 'screen', background: 'radial-gradient(40% 60% at 30% 40%, rgba(255,230,170,.18), transparent 60%), radial-gradient(38% 50% at 70% 55%, rgba(255,210,140,.16), transparent 60%)' }} />
      {/* pulsing qi glow near dragon pearl */}
      <div className="qi-glow" style={{ position: 'absolute', left: '46%', top: '52%', width: 200, height: 200, transform: 'translate(-50%,-50%)', pointerEvents: 'none', background: 'radial-gradient(circle, rgba(255,224,150,.5), transparent 68%)' }} />
      <canvas ref={canvasRef} style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', pointerEvents: 'none' }} />
      <div style={{ position: 'absolute', inset: 0, pointerEvents: 'none', background: 'linear-gradient(180deg, rgba(20,14,6,.30) 0%, rgba(20,14,6,0) 22%, rgba(214,146,12,0) 54%, rgba(214,146,12,.66) 82%, var(--gold-bg) 100%)' }} />
    </div>
  );
}

function Hero() {
  const lang = useLang();
  const en = lang === 'en';
  return (
    <header id="top" className="sec" style={{ background: 'var(--gold-bg)', overflow: 'hidden' }}>
      <HeroDragon />

      {/* hero text block */}
      <div className="wrap" style={{ position: 'relative', paddingBottom: 70, marginTop: -70 }}>
        <Reveal>
          <div style={{ display: 'flex', alignItems: 'center', gap: 14, marginBottom: 26 }}>
            <span style={{ width: 9, height: 9, borderRadius: '50%', background: 'var(--red)' }} />
            <span style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontWeight: 600, fontSize: en ? 19 : 21, letterSpacing: en ? '.08em' : '.14em', color: '#2A1E08' }}>{en ? 'Heir to orthodox Daoism · Reading the mysteries of heaven and earth' : '傳承道家正統　洞悉天地玄机'}</span>
          </div>
        </Reveal>
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', flexWrap: 'wrap', gap: 30 }}>
          <div style={{ flex: '1 1 460px', minWidth: 0 }}>
            <Reveal delay={80}>
              <h1 style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-brush)', fontSize: en ? 'clamp(48px,6.4vw,90px)' : 'clamp(72px,11vw,150px)', fontWeight: en ? 700 : 400, lineHeight: en ? 1.04 : .98, color: 'var(--ink)', letterSpacing: '.02em' }}>{en ? 'The Great Way,' : '大道至简'}</h1>
            </Reveal>
            <Reveal delay={200}>
              <h1 style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-brush)', fontSize: en ? 'clamp(48px,6.4vw,90px)' : 'clamp(72px,11vw,150px)', fontWeight: en ? 700 : 400, lineHeight: en ? 1.04 : 1.05, color: '#F6EFDA', letterSpacing: '.02em', textShadow: '0 3px 18px rgba(80,50,8,.4)' }}>{en ? 'Made Simple' : '萬物歸宗'}</h1>
            </Reveal>
            <Reveal delay={320}>
              <p className="sub-serif" style={{ fontSize: 21, color: '#332407', marginTop: 22, maxWidth: en ? 600 : 560 }}>
                {en
                  ? 'Through the Daoist principles of yin-yang and the five elements, aided by the arts of Zi Wei and the Eight Trigrams, we part the fog of fate — to help you find your true heart, move with heaven\u2019s timing, and reach the union of self and cosmos.'
                  : <>以道家陰陽五行之理，輔以紫微八卦之術。<br />為您撥開命理迷霧，尋得本心，順應天時，達至天人合一之境。</>}
              </p>
            </Reveal>
            <Reveal delay={420}>
              <a href="#today" className="btn-red" style={{ marginTop: 34 }}>{en ? 'Ask Your Future' : '叩問前程'} <span className="arr">→</span></a>
            </Reveal>
          </div>
          <Reveal delay={260} style={{ flexShrink: 0 }}>
            <div className="float" style={{ marginRight: 10 }}><Bagua size={400} /></div>
          </Reveal>
        </div>
      </div>
    </header>
  );
}

/* ---------------- MASTER ---------------- */
function Master() {
  const lang = useLang();
  const en = lang === 'en';
  return (
    <section id="master" className="sec" style={{ background: 'var(--gold-bg)', padding: '40px 0 90px' }}>
      <div className="wrap">
        <Reveal>
          <div style={{ background: 'linear-gradient(150deg,#EFE3BE,#E2D2A4)', boxShadow: '0 28px 60px rgba(70,46,8,.3)', padding: '54px 60px', display: 'grid', gridTemplateColumns: '300px 1fr', gap: 50, alignItems: 'center' }}>
            <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 28 }}>
              <img src="assets/hand-seal.jpg" alt="如意珠手印" style={{ width: 168, boxShadow: '0 12px 30px rgba(70,46,8,.22)' }} />
              <a href="#arts" className="btn-ink" style={{ width: '100%' }}>{en ? "Read the Master's Path" : '閱覽修行履歷'} <span className="arr">→</span></a>
            </div>
            <div style={{ textAlign: 'center' }}>
              <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 18, marginBottom: 6 }}>
                <span style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontWeight: 700, fontSize: 34, color: 'var(--ink)' }}>{en ? 'About the Master' : '關于道長'}</span>
                <span style={{ width: 3, height: 34, background: 'var(--red)' }} />
                <span style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-brush)', fontWeight: en ? 700 : 400, fontSize: en ? 30 : 40, color: 'var(--ink)' }}>{en ? 'Master Xuanyin' : '玄隱山人'}</span>
              </div>
              <div style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: 15, color: 'var(--red)', letterSpacing: en ? '.08em' : '.22em', marginBottom: 8 }}>{en ? 'Maoshan Shangqing Lineage · Bearer of the “Jia” Generation' : '茅山上清派 · 嘉字輩傳人'}</div>
              <div style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontStyle: en ? 'italic' : 'normal', fontSize: 17, color: '#5C4A1E', letterSpacing: en ? '.06em' : '.3em', marginBottom: 26 }}>{en ? 'The Dao endures · To save and ferry all' : '道炁長存 · 濟世度人'}</div>
              <p style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: en ? 17 : 18, lineHeight: 2.05, color: 'var(--paper-ink)' }}>
                {en
                  ? <>A son of the Dao from his earliest years, he entered the altars of Maoshan, ascended the platform and received the sacred registers, taking his place in the Shangqing lineage of the &ldquo;Jia&rdquo; generation. For over twenty years he has pored over the scriptures of the Three Caverns and the secret essentials of cinnabar and talisman. Heir to teachings passed mouth to ear, he is master above all of the <span style={{ fontWeight: 700 }}>secretly transmitted Da Liu Ren oracle, of consecrated talismans and charms, and of feng shui for the dwellings of the living and the dead</span> &mdash; reading the courses of the stars above, the dragon-veins and waters below, and the unseen that lies between. <span style={{ fontWeight: 700 }}>To cultivate the Dao is to cultivate the heart;</span> these arts are no means of profit, but a raft to ferry others across. Heaven&rsquo;s secrets may be glimpsed, yet good and ill remain each soul&rsquo;s to keep &mdash; may every seeker tell right from wrong and do good, for only so is fortune truly courted and harm escaped.</>
                  : <>道號玄隱山人，夙具道緣，入茅山道場，登壇受籙，列上清嘉字之輩。參研三洞經法、丹符秘要二十余載。<br />承師門口耳秘傳，尤精<span style={{ fontWeight: 700 }}>大六壬神課、靈符符籙、陰陽宅風水</span>之秘術——上窺星躔垣局，下察龍脈砂水，中通幽明鬼神。<br /><span style={{ fontWeight: 700 }}>修道即修心，</span>數術非為斂財，實乃度人之舟筏。天機雖可洞見，善惡終須自持；願緣主明辨是非、積德行善，方得趨吉避凶，福澤綿長。</>}
              </p>
            </div>
          </div>
        </Reveal>
      </div>
    </section>
  );
}

/* ---------------- 今日玄机 (draw fortune) ---------------- */
function Today() {
  const lang = useLang();
  const en = lang === 'en';
  const [shaking, setShaking] = useState(false);
  const [result, setResult] = useState(null);
  const [flying, setFlying] = useState(null);
  const draw = () => {
    if (shaking || flying) return;
    setResult(null); setShaking(true);
    const hex = HEXAGRAMS[Math.floor(Math.random() * HEXAGRAMS.length)];
    setTimeout(() => {
      setShaking(false);
      setFlying(hex);
      setTimeout(() => { setFlying(null); setResult(hex); }, 1050);
    }, 1000);
  };
  return (
    <section id="today" className="sec" style={{ background: 'var(--gold-bg)', padding: '20px 0 96px' }}>
      <div className="wrap" style={{ textAlign: 'center' }}>
        <Reveal><Heading cn="今日玄机" enMain="Today's Oracle" color="#F4ECD3" size={62} /></Reveal>
        <Reveal delay={80}>
          <p className="sub-serif" style={{ fontSize: 22, color: '#33270C', maxWidth: 640, margin: '26px auto 0' }}>
            {en
              ? <>Still your mind and breathe; a sincere heart draws true.<br />Touch the lot-tube to draw today&rsquo;s <i>Yijing</i> verse and divine counsel, cast just for you.</>
              : <>凝神靜氣，心誠則靈。<br />觸動簽筒，抽取屬于您今日的《易經》爻辭與神明啟示。</>}
          </p>
        </Reveal>
        <Reveal delay={140}>
          <div style={{ marginTop: 40, display: 'flex', justifyContent: 'center' }}>
            <div style={{ position: 'relative' }}>
              <button onClick={draw} aria-label="draw" style={{ cursor: (shaking || flying) ? 'default' : 'pointer' }} className="float">
                <FortuneTube shaking={shaking} />
              </button>
              {flying && <div className="slip-fly"><span>{flying.name}</span></div>}
            </div>
          </div>
          <div style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontStyle: 'italic', color: '#4A380F', marginTop: 6, fontSize: 16, minHeight: 24 }}>
            {shaking ? (en ? 'The tube is shaking\u2026' : '簽筒搖動中……') : (flying ? (en ? 'A lot flies out\u2026' : '一签飞出……') : (result ? (en ? '\u2014 Tap the tube to draw again \u2014' : '— 點擊簽筒可再求一签 —') : (en ? 'Tap the tube to seek today\u2019s oracle' : '輕觸簽筒，求取今日玄机')))}
          </div>

          {result && (
            <div style={{ maxWidth: 620, margin: '24px auto 0', background: 'var(--card-dark)', border: '1px solid rgba(226,176,68,.22)', borderTop: '3px solid var(--red)', padding: '32px 36px', color: '#E7DCBE', animation: 'scaleIn .5s ease' }}>
              <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 16 }}>
                <span style={{ fontSize: 56, color: 'var(--gold-text)', lineHeight: 1 }}>{result.gua}</span>
                <div style={{ textAlign: 'left' }}>
                  <div style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-brush)', fontWeight: en ? 700 : 400, fontSize: en ? 26 : 34, color: '#F2E8CF' }}>{en ? result.nameEn : result.name + '卦'}</div>
                  <div style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontStyle: en ? 'italic' : 'normal', fontSize: 16, color: 'var(--gold-text-soft)', letterSpacing: en ? '.02em' : '.2em' }}>{en ? result.judgeEn : result.judge}</div>
                </div>
              </div>
              <div style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontStyle: 'italic', fontSize: 18, color: '#D8C99E', margin: '20px 0 14px' }}>{en ? <>&ldquo;{result.lineEn}&rdquo;</> : <>「{result.line}」</>}</div>
              <p style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: 16.5, lineHeight: 1.95, color: '#C7B98F' }}>{en ? result.textEn : result.text}</p>
            </div>
          )}
        </Reveal>
        <Reveal delay={120}>
          <a href="#form" className="btn-red" style={{ marginTop: 40 }}>{en ? 'Get a Full Reading' : '專業解簽'} <span className="arr">→</span></a>
        </Reveal>
      </div>
    </section>
  );
}

/* ---------------- 本命流年 (zodiac) ---------------- */
function Natal() {
  const lang = useLang();
  const en = lang === 'en';
  const elEn = { 水: 'Water', 土: 'Earth', 木: 'Wood', 火: 'Fire', 金: 'Metal' };
  const [active, setActive] = useState(null);
  return (
    <section id="gateway" className="sec" style={{ padding: '90px 0 96px', backgroundColor: '#14110C', backgroundImage: 'linear-gradient(rgba(17,13,8,.62), rgba(17,13,8,.62)), url("assets/brocade.jpg")', backgroundSize: 'auto, 460px auto', backgroundRepeat: 'repeat' }}>
      <div className="wrap" style={{ textAlign: 'center', position: 'relative' }}>
        <Reveal><Heading cn="本命流年" enMain="Natal &amp; Annual Fortune" color="#F4ECD3" size={62} /></Reveal>
        <Reveal delay={80}>
          <p className="sub-serif" style={{ fontSize: 21, color: '#D8C89A', maxWidth: 680, margin: '24px auto 0' }}>
            {en
              ? <>The year is Bing-Wu &mdash; its stem is Fire, its branch the Horse.<br />Each of the twelve signs holds its own making; touch a jade tablet to explore the turning fortunes of your year.</>
              : <>歲在丙午，天干屬火，地支屬馬。<br />十二生肖各具造化，觸動玉牌，探尋您本命之年的流轉玄机。</>}
          </p>
        </Reveal>
        <Reveal delay={120}>
          <div className="zgrid">
            {BRANCHES.map((b, i) => (
              <button key={b.zhi} className={`ztile ${active === i ? 'active' : ''}`} onClick={() => setActive(active === i ? null : i)}>
                <div className="ztile-inner">
                  <div className="ztile-face ztile-front">
                    <span className="zhi">{b.zhi}</span>
                    <span className="ani">{en ? `${b.animalEn} · ${elEn[b.el]}` : `${b.animal} · ${b.el}`}</span>
                  </div>
                  <div className="ztile-face ztile-back">
                    <span className="zb-h" style={en ? { fontFamily: 'var(--font-en-serif)', fontSize: 16 } : null}>{en ? `${b.zhi} · ${b.animalEn}` : `${b.zhi} · ${b.animal}`}</span>
                    <span className="zb-p" style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? b.readEn : b.read}</span>
                  </div>
                </div>
              </button>
            ))}
          </div>
          <div style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontStyle: 'italic', marginTop: 22, fontSize: 15, color: '#C9B98C', opacity: .85 }}>
            {active === null ? (en ? '\u2014 Touch a tablet to flip and read its verdict \u2014' : '— 触动玉牌，翻看本命流年批语 —') : (en ? `Viewing \u201C${BRANCHES[active].animalEn}\u201D · tap to close` : `已观「${BRANCHES[active].zhi}」· 再触可收`)}
          </div>
        </Reveal>
      </div>
    </section>
  );
}

/* ---------------- 玄門數術 (arts cards) ---------------- */
function Arts() {
  const lang = useLang();
  const en = lang === 'en';
  return (
    <section id="arts" className="sec" style={{ background: 'var(--gold-bg)', padding: '90px 0 96px' }}>
      <div className="wrap" style={{ textAlign: 'center' }}>
        <Reveal><Heading cn="玄門數術" enMain="The Mystic Arts" color="#F4ECD3" size={62} /></Reveal>
        <Reveal delay={70}>
          <p className="sub-serif" style={{ fontSize: 21, color: '#33270C', margin: '22px auto 50px' }}>
            {en ? 'Carrying the essence of the Quanzhen and Zhengyi schools, we ease your troubles through the arts of the Yijing.' : '秉承全真與正一之精髓，以易學數術為您排憂解難。'}
          </p>
        </Reveal>
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4,1fr)', gap: 22 }}>
          {ARTS.map((a, i) => (
            <Reveal key={a.title} delay={i * 90}>
              <a href={a.href || '#booking'} className="art-card">
                <span className="icn"><ArtIcon name={a.icon} /></span>
                <h3 style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? a.titleEn : a.title}</h3>
                <p style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? a.descEn : a.desc}</p>
                <div className="ft"><span className="pr">{en ? a.priceEn : a.price}</span><span className="ch">›</span></div>
              </a>
            </Reveal>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ---------------- helpers for booking ---------------- */
const PROD_IMG = { luopan: 'assets/art-qimen.jpg', wuxing: 'assets/art-wuxing.jpg', ziwei: 'assets/art-ziwei.jpg' };
function ProductArt({ kind }) {
  return <img src={PROD_IMG[kind]} alt="" style={{ width: '100%', display: 'block' }} />;
}

function ProductRow({ p, addToCart }) {
  const lang = useLang();
  const en = lang === 'en';
  const [opt, setOpt] = useState(0);
  const [qty, setQty] = useState(1);
  return (
    <Reveal className="prod">
      <div className="prod-art"><ProductArt kind={p.art} /></div>
      <div>
        <h2 style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? p.titleEn : p.title}</h2>
        <div className="ptag" style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? p.tagEn : p.tag}</div>
        <div className="pprice">{p.priceText}</div>
        <div className="prod-body">
          {p.body.map((b, i) => {
            const lead = en ? b.leadEn : b.lead;
            const text = en ? b.textEn : b.text;
            return <p key={i} style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{lead && <span className="lead">{lead}{en ? ' — ' : '：'}</span>}{text}</p>;
          })}
        </div>
        <div className="field">
          <label style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? 'Select a package' : '選擇套餐 · Select'}</label>
          <select className="sel" value={opt} onChange={e => setOpt(+e.target.value)} style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>
            {p.options.map((o, i) => <option key={i} value={i}>{en ? o.labelEn : o.label}</option>)}
          </select>
        </div>
        <div className="field">
          <div className="qty-row">
            <label style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? 'Quantity' : '數量 · Quantity'}</label>
            <div className="qty-ctrl">
              <button onClick={() => setQty(q => Math.max(1, q - 1))}>−</button>
              <span className="qn">{qty}</span>
              <button onClick={() => setQty(q => q + 1)}>＋</button>
            </div>
          </div>
        </div>
        <button className="btn-cart" style={{ marginTop: 30 }}
          onClick={() => addToCart({ id: p.id + opt, title: en ? p.titleEn : p.title, option: en ? p.options[opt].labelEn : p.options[opt].label, price: p.options[opt].price, qty })}>
          {en ? 'Add to cart' : '加入緣囊 · Add to cart'}
        </button>
      </div>
    </Reveal>
  );
}

/* ---------------- 订阅服务 ---------------- */
function Booking({ addToCart }) {
  return (
    <section id="booking" className="sec" style={{ background: 'var(--gold-bg)', padding: '20px 0 60px' }}>
      <div className="wrap">
        <Reveal><Heading cn="訂閱服務" en="Book a session" enMain="Book a Session" color="#F4ECD3" size={62} /></Reveal>
        <div style={{ marginTop: 70 }}>
          {PRODUCTS.map(p => <ProductRow key={p.id} p={p} addToCart={addToCart} />)}
        </div>
      </div>
    </section>
  );
}

/* ---------------- 靈符符籙 ---------------- */
function Talisman() {
  const lang = useLang();
  const en = lang === 'en';
  return (
    <section id="talisman" className="sec" style={{ padding: '90px 0 96px', backgroundColor: '#14110C', backgroundImage: 'linear-gradient(rgba(17,13,8,.74), rgba(17,13,8,.74)), url("assets/brocade.jpg")', backgroundSize: 'auto, 460px auto', backgroundRepeat: 'repeat' }}>
      <div className="wrap" style={{ textAlign: 'center' }}>
        <Reveal><Heading cn="靈符符籙" enMain="Talismans &amp; Charms" color="#F4ECD3" size={62} /></Reveal>
        <Reveal delay={70}>
          <p className="sub-serif" style={{ fontSize: 21, color: '#D8C89A', maxWidth: 700, margin: '24px auto 0' }}>
            {en
              ? <>Each talisman is hand-drawn and consecrated by the Master to your wish.<br />Wealth, love, peace, career &mdash; the fee is set by the charm you request.</>
              : <>每一道靈符皆由道長親手繪製、開光加持，依願而成。<br />求財、姻緣、平安、事業……潤金依所求符籙而定。</>}
          </p>
        </Reveal>
        <Reveal delay={120}>
          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4,1fr)', gap: 18, marginTop: 44 }}>
            {TALISMANS.map((t) => (
              <div key={t.name} className="fu-card">
                <div className="fu-glyph">{t.glyph}</div>
                <h3 style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? t.nameEn : t.name}</h3>
                <p style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? t.descEn : t.desc}</p>
              </div>
            ))}
          </div>
        </Reveal>
        <Reveal delay={140}>
          <div style={{ marginTop: 46 }}>
            <a href="#form" className="btn-red">{en ? 'Enquire · Custom Talisman' : '咨詢定製 · 求符'} <span className="arr">→</span></a>
            <p style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontStyle: 'italic', color: '#C9B98C', marginTop: 16, fontSize: 15 }}>
              {en ? <>Tell the Master your wish; the fee is quoted once the charm is set. Add WeChat <WeChatId />.</> : <>將所求告知道長，定符後告知潤金。敬加微信 <WeChatId />。</>}
            </p>
          </div>
        </Reveal>
      </div>
    </section>
  );
}

/* ---------------- 填写表单 ---------------- */
/* ---------------- 八字命盘 ---------------- */
function BaziChart({ data }) {
  const lang = useLang();
  const en = lang === 'en';
  const elEn = data.elEn;
  const [grow, setGrow] = useState(false);
  useEffect(() => { const t = setTimeout(() => setGrow(true), 120); return () => clearTimeout(t); }, []);
  const max = Math.max(...Object.values(data.count), 1);
  return (
    <div className="bazi-panel">
      <div className="bazi-head" style={en ? { fontFamily: 'var(--font-en-serif)', letterSpacing: '.02em' } : null}>{en ? 'Chart Cast · The Four Pillars' : '命盤既成 · 八字四柱'}</div>
      <div className="bazi-head-sub" style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? 'Stems reveal, branches conceal · the flow of the five elements below' : '天干透象，地支藏机 · 五行之气如下流转'}</div>
      <div className="bazi-pillars">
        {data.pillars.map(p => (
          <div key={p.label} className="bz-col">
            <div className="bz-lab" style={en ? { fontFamily: 'var(--font-en-serif)', letterSpacing: '.06em' } : null}>{en ? p.labelEn : p.label}</div>
            <div className="bz-gz" style={{ color: data.elColor[p.ganEl] }}>{p.ganChar}</div>
            <div className="bz-gz" style={{ color: data.elColor[p.zhiEl] }}>{p.zhiChar}</div>
            <div className="bz-sub" style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? `${p.animalEn} · ${p.subEn}` : `${p.animal} · ${p.sub}`}</div>
          </div>
        ))}
      </div>
      <div className="bazi-bars">
        {['木', '火', '土', '金', '水'].map(el => (
          <div key={el} className="bz-bar-row">
            <span className="el" style={{ color: data.elColor[el], width: en ? 52 : 24, fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: en ? 14 : 18 }}>{en ? elEn[el] : el}</span>
            <div className="bz-track"><div className="bz-fill" style={{ width: grow ? `${(data.count[el] / max) * 100}%` : 0, background: data.elColor[el] }} /></div>
            <span className="cnt">{data.count[el]}</span>
          </div>
        ))}
      </div>
      <p className="bazi-verdict" style={en ? { fontFamily: 'var(--font-en-serif)' } : null}>{en ? data.verdictEn : data.verdict}</p>
    </div>
  );
}

/* ---------------- 填写表单 ---------------- */
function FormSection({ toast }) {
  const lang = useLang();
  const en = lang === 'en';
  const ff = en ? { fontFamily: 'var(--font-en-serif)' } : null;
  const [form, setForm] = useState({ dob: '', city: '', email: '', q: '', gender: '' });
  const [pref, setPref] = useState([]);
  const [method, setMethod] = useState('');
  const [pay, setPay] = useState([]);
  const [chart, setChart] = useState(null);
  const [submitting, setSubmitting] = useState(false);
  const tog = (arr, set, v) => set(arr.includes(v) ? arr.filter(x => x !== v) : [...arr, v]);
  const submit = async (e) => {
    e.preventDefault();
    if (!form.dob || !form.city || !form.email || !form.q || !form.gender) { toast(en ? 'Please fill in all required fields ✦' : '請填寫所有必填項 ✦'); return; }
    const d = new Date(form.dob);
    if (isNaN(d)) { toast(en ? 'Please enter a valid birth time ✦' : '請填寫有效的出生時間 ✦'); return; }
    setSubmitting(true);
    try {
      const res = await window.api('/api/inquiry', { dob: form.dob, city: form.city, email: form.email, q: form.q, gender: form.gender, pref, method, pay });
      setChart(res.chart || window.BAZI.computeBazi(d));
      toast(en ? 'Your chart is cast · the Master will read it in person ✦' : '命盤推演既成 · 道長將親為詳批 ✦');
    } catch (err) {
      // 后端未就绪也不影响体验：用本地引擎出盘
      setChart(window.BAZI.computeBazi(d));
      toast(en ? 'Chart cast (saved locally · connect backend to notify the Master) ✦' : '命盤已成 · 暫存本地，後端接通後自動通知道長 ✦');
    } finally {
      setSubmitting(false);
    }
  };
  return (
    <section id="form" className="sec" style={{ background: 'var(--gold-bg)', padding: '70px 0 0' }}>
      <div className="wrap" style={{ paddingBottom: 30 }}>
        <Reveal><Heading cn="填寫表單" en="Fill the form" enMain="Fill the Form" color="#F4ECD3" size={62} /></Reveal>
      </div>
      <div className="bg-bamboo" style={{ padding: '70px 0' }}>
        <form className="wrap" style={{ maxWidth: 720 }} onSubmit={submit}>
          <div className="form-field">
            <label className="flabel">{en ? <b>Date &amp; Time of Birth (Gregorian, to the minute)</b> : <>陽歷(公歷) 出生日期&精確到分的時間 <b>Date &amp; Time of Birth</b></>}<span className="req">*</span></label>
            <input className="inp" type="datetime-local" value={form.dob} onChange={e => setForm({ ...form, dob: e.target.value })} />
          </div>
          <div className="form-field">
            <label className="flabel">{en ? <b>City of Birth</b> : <>出生地點 <b>City of Birth</b></>}<span className="req">*</span></label>
            <input className="inp" placeholder={en ? 'e.g. Chongqing' : '如：重慶市 / Chongqing'} value={form.city} onChange={e => setForm({ ...form, city: e.target.value })} style={ff} />
          </div>
          <div className="form-field">
            <label className="flabel">{en ? <b>Gender</b> : <>性別 <b>Gender</b></>}<span className="req">*</span></label>
            <div style={{ display: 'flex', gap: 32 }}>
              {[['male', 'Male', '男'], ['female', 'Female', '女']].map(([v, enL, cn]) => (
                <div key={v} className="opt-row" onClick={() => setForm({ ...form, gender: v })} style={{ ...ff, marginTop: 0 }}>
                  <span className={`opt-radio ${form.gender === v ? 'on' : ''}`} />{en ? enL : cn}
                </div>
              ))}
            </div>
          </div>
          <div className="form-field">
            <label className="flabel">{en ? <b>Email Address</b> : <>個人郵箱 <b>Email Address</b></>}<span className="req">*</span></label>
            <input className="inp" type="email" placeholder="name@example.com" value={form.email} onChange={e => setForm({ ...form, email: e.target.value })} style={ff} />
          </div>
          <div className="form-field">
            <label className="flabel">{en ? <b>Main Question</b> : <>側重問題 <b>Main Question</b></>}<span className="req">*</span></label>
            <textarea className="ta" placeholder={en ? 'Briefly describe what you most want to know…' : '請簡述您最想了解的事項……'} value={form.q} onChange={e => setForm({ ...form, q: e.target.value })} style={ff} />
          </div>

          <div className="form-group-label">{en ? <b style={{ color: '#EFE5C9' }}>Communication Preference</b> : <>溝通偏好 <b style={{ color: '#EFE5C9' }}>Preference of Communication</b></>}</div>
          {[['注重分析過程與推演原理 · 學術專業派', 'Focused on analysis and reasoning · Academic', 'Academic'], ['以結論結果為導向 · 通俗易懂 · 社會實戰派', 'Results-oriented and plain-spoken · Practical', 'Practical']].map(([cn, enL, key]) => (
            <div key={key} className="opt-row" onClick={() => tog(pref, setPref, key)} style={ff}>
              <span className={`opt-box ${pref.includes(key) ? 'on' : ''}`} />{en ? enL : `${cn} ${key}`}
            </div>
          ))}

          <div className="form-group-label">{en ? <b style={{ color: '#EFE5C9' }}>Communication Method</b> : '溝通方式'} <span className="req">*</span></div>
          {[['微信 WeChat', 'WeChat'], ['Instagram', 'Instagram'], ['WhatsApp', 'WhatsApp'], ['PDF 書面詳批', 'PDF written report']].map(([cn, enL]) => (
            <div key={cn} className="opt-row" onClick={() => setMethod(cn)} style={ff}>
              <span className={`opt-radio ${method === cn ? 'on' : ''}`} />{en ? enL : cn}
            </div>
          ))}

          <div className="form-group-label">{en ? <b style={{ color: '#EFE5C9' }}>Payment Method</b> : <>支付方式 <b style={{ color: '#EFE5C9' }}>Payment method</b></>}<span className="req">*</span></div>
          {[['微信支付 WeChat Pay', 'WeChat Pay'], ['支付寶 Alipay', 'Alipay'], ['Zelle', 'Zelle'], ['Venmo', 'Venmo']].map(([cn, enL]) => (
            <div key={cn} className="opt-row" onClick={() => tog(pay, setPay, cn)} style={ff}>
              <span className={`opt-box ${pay.includes(cn) ? 'on' : ''}`} />{en ? enL : cn}
            </div>
          ))}

          <div style={{ textAlign: 'center', marginTop: 44 }}>
            <button className="btn-submit" type="submit" disabled={submitting} style={submitting ? { opacity: .6, cursor: 'default' } : null}>{submitting ? (en ? 'Casting…' : '排盤中…') : (en ? 'Submit · Cast My Chart' : 'Submit · 立即排盤')}</button>
          </div>
          {chart && <BaziChart data={chart} />}
        </form>
      </div>
    </section>
  );
}

/* ---------------- appointment ---------------- */
function Appointment({ toast }) {
  const lang = useLang();
  const en = lang === 'en';
  const [dt, setDt] = useState('');
  return (
    <section id="appt" className="sec bg-stone" style={{ padding: '70px 0' }}>
      <div className="wrap">
        <Reveal>
          <div style={{ textAlign: 'center', marginBottom: 40 }}>
            <h3 style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontWeight: 700, fontSize: 34, color: '#F2E8CF' }}>{en ? 'Schedule Your Consultation　Select a date ⏳' : '預約咨詢時間　Select a date ⏳'}</h3>
            <p style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontStyle: 'italic', fontSize: 18, color: '#E4D9BC', marginTop: 14 }}>{en ? <>To confirm a reading, add WeChat <WeChatId /> to arrange your appointment ⚖</> : <>如確認看盤，請添加工作微信 <WeChatId /> 作進一步預約安排 ⚖</>}</p>
          </div>
        </Reveal>
        <Reveal delay={80}>
          <div style={{ display: 'grid', gridTemplateColumns: '0.9fr 1.1fr', gap: 46, alignItems: 'center' }}>
            <img src="assets/art-ziwei.jpg" alt="" style={{ width: '100%', height: 260, objectFit: 'cover', borderRadius: 4, border: '1px solid rgba(226,176,68,.25)', boxShadow: '0 14px 36px rgba(0,0,0,.4)' }} />
            <div>
              <h4 style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontWeight: 700, fontSize: 28, color: '#F2E8CF', marginBottom: 16 }}>{en ? 'Schedule an Appointment' : '預約咨詢'}</h4>
              <p style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: 19, lineHeight: 1.7, color: '#EBE0C4', marginBottom: 8 }}>
                <span style={{ color: 'var(--red-bright)', fontSize: 28, verticalAlign: '-6px', marginRight: 6 }}>”</span>
                {en ? 'To complete your appointment, please select a date and time available for the personalised consultation.' : '確認看盤後，請在此選擇您方便的日期與時間，完成個性化咨詢預約。'}
              </p>
              <p style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: 16, color: '#D8CDB0', marginBottom: 20 }}>{en ? 'Times shown in Beijing time; please convert to your local time zone.' : '默認北京時間，請根據當地時區換算時差。'}</p>
              <input className="inp" type="datetime-local" value={dt} onChange={e => setDt(e.target.value)} style={{ marginBottom: 12 }} />
              <div style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: 16, color: '#D8CDB0', marginBottom: 18 }}>{en ? 'Event time zone: Asia/Chongqing GMT+08:00' : '時區：Asia/Chongqing GMT+08:00（北京時間）'}</div>
              <button className="btn-submit" style={{ width: '100%' }} onClick={async () => {
                if (!dt) { toast(en ? 'Please select a date and time first' : '請先選擇日期時間'); return; }
                try { const r = await window.api('/api/appointment', { datetime: dt }); toast((en ? 'Appointment submitted · ' : '預約已提交 · ') + r.ref); }
                catch (e) { toast(en ? 'Appointment noted · add WeChat to confirm ✦' : '預約已記 · 加微信確認 ✦'); }
              }}>{en ? 'Book Now' : '立即預約'}</button>
            </div>
          </div>
        </Reveal>
      </div>
    </section>
  );
}

/* ---------------- 缘主香火 + footer ---------------- */
function Karma() {
  const lang = useLang();
  const en = lang === 'en';
  return (
    <section id="karma" className="sec" style={{ background: 'var(--gold-bg)', paddingTop: 90, position: 'relative', overflow: 'hidden' }}>
      <div style={{ position: 'absolute', top: 0, right: '-2%', bottom: 0, width: 560, opacity: .55, pointerEvents: 'none', display: 'flex', alignItems: 'flex-start', justifyContent: 'flex-end' }}>
        <img src="assets/zhenzhai.jpg" alt="鎮宅龜蛇" style={{ width: '100%', maskImage: 'linear-gradient(90deg, transparent, #000 38%)', WebkitMaskImage: 'linear-gradient(90deg, transparent, #000 38%)' }} />
      </div>
      <div className="wrap" style={{ position: 'relative' }}>
        <Reveal><Heading cn="緣主香火" enMain="Words from Seekers" color="#F4ECD3" size={62} /></Reveal>
        <Reveal delay={70}>
          <p className="sub-serif" style={{ fontSize: 21, color: '#33270C', textAlign: 'center', margin: '22px auto 54px' }}>
            {en ? 'Gratitude from those who have sought the Master\u2019s counsel.' : '秉承全真與正一之精髓，以易學數術為您排憂解難。'}
          </p>
        </Reveal>
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3,1fr)', gap: 24 }}>
          {TESTI.map((t, i) => (
            <Reveal key={t.name} delay={i * 100}>
              <div style={{ background: 'var(--card-dark)', border: '1px solid rgba(226,176,68,.16)', padding: '28px 26px', height: '100%', display: 'flex', flexDirection: 'column' }}>
                <div style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: 13, color: 'var(--red-bright)', letterSpacing: '.2em', marginBottom: 16 }}>{en ? "A SEEKER'S THANKS" : '緣主感謝'}</div>
                <p style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: 16, lineHeight: 1.95, color: '#D8C99E', flex: 1 }}>{en ? <>&ldquo;{t.quoteEn}&rdquo;</> : <>「{t.quote}」</>}</p>
                <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderTop: '1px solid rgba(226,176,68,.16)', paddingTop: 16, marginTop: 18 }}>
                  <span style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-brush)', fontWeight: en ? 700 : 400, fontSize: en ? 17 : 22, color: '#EFE5C9', letterSpacing: en ? '.02em' : '.08em' }}>{en ? t.nameEn : t.name}</span>
                  <span style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: 13, color: 'var(--gold-text-soft)', border: '1px solid rgba(226,176,68,.3)', padding: '4px 12px' }}>{en ? t.tagEn : t.tag}</span>
                </div>
              </div>
            </Reveal>
          ))}
        </div>
      </div>
      <div style={{ height: 230, marginTop: 70 }}><Mountains /></div>
      <Footer />
    </section>
  );
}

function Footer() {
  const lang = useLang();
  const en = lang === 'en';
  return (
    <footer style={{ background: 'var(--ink)', padding: '64px 0 56px' }}>
      <div className="wrap" style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', flexWrap: 'wrap', gap: 40 }}>
        <div>
          <div style={{ display: 'flex', alignItems: 'center', gap: 12, color: '#F2E6C9', fontFamily: 'var(--font-brush)', fontSize: 34, letterSpacing: '.08em' }}><CloudMark size={32} /> 玄境</div>
          <p style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: 15, color: '#9E9270', marginTop: 18, lineHeight: 1.9 }}>{en ? <>Upholding Daoist culture and the classics of Chinese learning.<br />With a heart beyond the world, doing the work of the world.</> : <>弘揚道家文化，傳承國學經典。<br />以出世之心，做入世之事。</>}</p>
        </div>
        <div style={{ textAlign: 'right' }}>
          <div style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-brush)', fontWeight: en ? 700 : 400, fontSize: en ? 22 : 26, color: 'var(--gold-text)', letterSpacing: en ? '.04em' : '.2em', marginBottom: 14 }}>{en ? 'Make a Bond' : '結緣相聚'}</div>
          <p style={{ fontFamily: en ? 'var(--font-en-serif)' : 'var(--font-serif)', fontSize: 15, color: '#9E9270', marginBottom: 20 }}>{en ? 'The immortal way honours life and ferries all without limit. Only three seekers are received each day.' : '仙道貴生，無量度人。每日僅接待三位有緣善信。'}</p>
          <div style={{ display: 'inline-block', border: '1px solid rgba(226,176,68,.4)', padding: '14px 26px', fontFamily: 'var(--font-en-serif)', fontSize: 17, color: '#E9DEC2', letterSpacing: '.06em' }}>{en ? <>Add WeChat: <WeChatId /></> : <>敬加微信：<WeChatId /></>}</div>
        </div>
      </div>
    </footer>
  );
}

Object.assign(window, { Nav, Hero, Master, Today, Natal, Arts, Booking, Talisman, FormSection, Appointment, Karma });
