/* iFengPai theme — shared chrome (nav, footer, tokens, modals).
   This is the LOCKED design: editors never touch it. Page-specific section
   styles live in each template's own <style> block. Single-language build. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green: #2C9B49;
  --orange: #ff7648;
  --blue-gray: #545e69;
  --footer-bg: #f0f0f0;
  --nav-h: 88px;
  --max-w: 1440px;
}
html { scroll-behavior: smooth; }
body { font-family: 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
       color: #1a1a1a; overflow-x: hidden; }

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--nav-h);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  display: flex; align-items: center;
  padding: 0 clamp(16px, 4vw, 60px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.nav-logo { height: 52px; width: auto; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 40px); margin: 0 auto; list-style: none; }
.nav-links a { text-decoration: none; color: #1a1a1a; font-size: clamp(13px, 1vw, 15px); font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--green); }
.nav-cta { display: flex; align-items: center; }
.nav-cta a { background: var(--green); color: #fff !important; padding: 6px 18px; display: inline-flex; align-items: center; font-weight: 400; line-height: 1; border-radius: 8px; }
.nav-cta a:hover { opacity: .85; color: #fff !important; }
.nav-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.hamburger span { width: 24px; height: 2px; background: #1a1a1a; border-radius: 2px; transition: all .3s; }
.mobile-menu {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: #fff; z-index: 850; padding: 24px;
  flex-direction: column; gap: 20px;
  border-bottom: 1px solid #eee; box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.mobile-menu.open { display: flex; }
.mobile-menu a { text-decoration: none; color: #1a1a1a; font-size: 17px; font-weight: 500; }

/* ─── SECTION COMMON ─── */
section { width: 100%; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(20px, 4vw, 60px); }
.section-title { font-size: clamp(16px, 2.1vw, 30px); font-weight: 700; color: #1a1a1a; margin-bottom: 16px; }
.section-line { width: 126px; height: 7px; background: var(--green); margin: 16px 0 clamp(24px, 3vw, 40px); }

/* ─── SHARED CTA BUTTON (Line-Login style) ─── */
.ifp-cta {
  display: inline-flex; align-items: center;
  height: 38px; padding: 0 24px 0 9px;
  background: #237c3a; color: #fff !important;
  font-size: 14px; font-weight: 500; line-height: 1;
  text-decoration: none; width: fit-content; border-radius: 8px; transition: opacity .2s;
}
.ifp-cta:hover { opacity: .9; }
.ifp-cta img { height: 18px; width: auto; display: block; flex-shrink: 0; margin-right: 10px; }
.ifp-cta .cta-div { width: 1px; height: 24px; background: #fff; flex-shrink: 0; margin-right: 16px; }
.ifp-cta .cta-txt { white-space: nowrap; }

/* ─── FOOTER ─── */
footer { background: var(--footer-bg); padding: clamp(40px, 6vw, 80px) clamp(20px, 4vw, 60px); }
.footer-inner { max-width: var(--max-w); margin: 0 auto; display: flex; flex-direction: column; gap: 32px; min-height: 320px; }
.footer-top { display: flex; align-items: flex-start; gap: clamp(40px, 5vw, 100px); flex-wrap: wrap; }
.footer-logo { height: 56px; width: auto; flex-shrink: 0; }
.footer-nav { display: flex; align-items: flex-start; gap: clamp(32px, 5vw, 80px); flex-shrink: 0; }
.footer-nav-col { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.footer-link { display: block; text-decoration: none; color: #1a1a1a; font-size: clamp(12px, 0.9vw, 15px); font-weight: 400; transition: color .2s; }
.footer-link:hover { color: var(--green); }
.footer-link-green { background: var(--green); color: #fff !important; padding: 4px 14px; display: inline-flex; align-items: center; line-height: 1; border-radius: 8px; }
.footer-link-green:hover { opacity: .85; color: #fff !important; }
.footer-divider { width: 100%; height: 1px; background: #d8d8d8; margin-top: auto; }
.footer-legal { font-size: clamp(11px, .85vw, 13px); color: #888; line-height: 2; flex-wrap: wrap; }
.footer-legal a { color: #888; text-decoration: underline; cursor: pointer; }
.footer-legal a:hover { color: var(--green); }

/* ─── MODALS ─── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.50); z-index: 9999; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 8px; max-width: 680px; width: 100%; max-height: 80vh; overflow-y: auto; padding: clamp(24px, 4vw, 48px); position: relative; }
.modal-close { position: absolute; top: 16px; right: 20px; font-size: 22px; cursor: pointer; color: #888; background: none; border: none; line-height: 1; }
.modal-close:hover { color: #1a1a1a; }
.modal-box h2 { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.modal-box p { font-size: 14px; line-height: 1.8; color: #555; margin-bottom: 12px; }

/* ─── RESPONSIVE (shared) ─── */
@media (max-width: 768px) {
  :root { --nav-h: 64px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-right { margin-left: auto; }
}
@media (max-width: 480px) {
  .footer-top { flex-direction: column; gap: 28px; }
  .footer-nav { gap: 28px; }
}

/* ─── LANGUAGE TOGGLE (client-side, no reload) ─── */
/* Both languages render into the DOM; the switch flips <html lang>.
   Default (pre-JS / no match) is English; lang="zh" shows Chinese. */
.lang.zh { display: none; }
html[lang="zh"] .lang.en { display: none; }
html[lang="zh"] .lang.zh { display: revert; }
.lang-toggle { display: flex; border: 1.5px solid #ccc; border-radius: 20px; overflow: hidden; cursor: pointer; font-size: 13px; }
.lang-toggle span { padding: 5px 14px; user-select: none; transition: all .2s; font-weight: 500; color: #666; }
.lang-toggle span.active { background: #1a1a1a; color: #fff; }
