/* ============================================================
   Wmax Broker — Common Stylesheet
   ------------------------------------------------------------
   共享样式：所有页面均需加载此文件。
   包含：设计 Token、Reset、导航、页脚、风险条、按钮、排版、
   Section 基础、响应式基础、滚动入场动画、Logo 尺寸
   ============================================================ */

/* ─── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  --amber-500: #F5B324;
  --amber-400: #FFC93C;
  --amber-600: #D99811;
  --amber-50:  #FFF7E1;

  --ink-900: #0E0E12;
  --ink-800: #16161B;
  --ink-700: #1E1E25;
  --ink-600: #2A2A33;

  --slate-500: #6B6B78;
  --slate-400: #9395A1;
  --slate-300: #C9CAD2;
  --slate-200: #E4E5EA;

  --bone-50: #FAF8F2;
  --paper: #FFFFFF;

  --line: rgba(14,14,18,.08);
  --line-strong: rgba(14,14,18,.16);
  --line-dark: rgba(255,255,255,.08);
  --line-dark-strong: rgba(255,255,255,.16);

  --up: #16A36B;
  --down: #DB3A3A;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(14,14,18,.04), 0 2px 6px rgba(14,14,18,.04);
  --shadow-md: 0 6px 24px rgba(14,14,18,.06), 0 2px 8px rgba(14,14,18,.04);
  --shadow-lg: 0 24px 60px rgba(14,14,18,.12);

  --max-w: 1280px;
  --gutter: clamp(20px, 4vw, 56px);

  --font-sans: "Manrope", "Noto Sans TC", -apple-system, BlinkMacSystemFont,
               "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--bone-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul, ol { list-style: none; padding: 0; margin: 0; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ─── Top risk strip ─────────────────────────────────────── */
.risk-strip {
  background: var(--ink-900);
  color: var(--slate-400);
  font-size: 12px;
  border-bottom: 1px solid var(--line-dark);
}
.risk-strip__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
}
.risk-strip__tag {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245,179,36,.12);
  color: var(--amber-400);
  font-weight: 600;
  letter-spacing: .04em;
  font-size: 11px;
}
.risk-strip__tag::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber-400);
  box-shadow: 0 0 0 3px rgba(245,179,36,.18);
}
.risk-strip__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Navigation ─────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: var(--ink-900);
  border-bottom: 1px solid var(--line-dark);
  color: #fff;
}
.nav__inner {
  display: flex; align-items: center; gap: 24px;
  height: 72px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.nav__logo {
  display: inline-flex; align-items: center;
  flex: 0 0 auto;
  transition: transform .15s, opacity .15s;
}
.nav__logo:hover { transform: translateY(-1px); }
.nav__logo img { height: 26px; width: auto; display: block; }

.nav__menu {
  display: flex; align-items: center; gap: 4px;
  margin-left: 8px;
}
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  font-size: 14.5px; font-weight: 500;
  color: rgba(255,255,255,.78);
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}
.nav__link:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav__link.is-current { color: var(--amber-400); }
.nav__caret {
  width: 10px; height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .65;
}

/* dropdown */
.nav__dropdown {
  position: absolute;
  top: calc(100% + 6px); left: 0;
  min-width: 280px;
  padding: 10px;
  background: #16161B;
  border: 1px solid var(--line-dark-strong);
  border-radius: var(--r-md);
  box-shadow: 0 30px 70px rgba(0,0,0,.5);
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.nav__item:hover .nav__dropdown,
.nav__item:focus-within .nav__dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav__dd-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.85);
  font-size: 14px;
}
.nav__dd-link:hover { background: rgba(245,179,36,.08); color: var(--amber-400); }
.nav__dd-link strong { font-weight: 600; }
.nav__dd-link span {
  margin-left: auto;
  color: var(--slate-400);
  font-size: 12px;
  font-family: var(--font-mono);
}

.nav__spacer { flex: 1 1 auto; }

/* lang switcher */
.lang-wrap { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-dark-strong);
  background: transparent;
  color: rgba(255,255,255,.85);
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.lang-btn:hover { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.28); }
.lang-btn__globe { color: var(--amber-400); }
.lang-btn__caret { opacity: .65; transition: transform .2s; }
.lang-wrap.is-open .lang-btn__caret { transform: rotate(180deg); }
.lang-wrap.is-open .lang-btn { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.28); }

.lang-pop {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  min-width: 320px;
  padding: 10px;
  background: #16161B;
  border: 1px solid var(--line-dark-strong);
  border-radius: var(--r-md);
  box-shadow: 0 30px 70px rgba(0,0,0,.55);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s;
  z-index: 80;
}
.lang-wrap.is-open .lang-pop { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-pop__head {
  font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--slate-400);
  padding: 8px 12px 12px;
  border-bottom: 1px solid var(--line-dark);
  margin-bottom: 6px;
}
.lang-pop__row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.85);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.lang-pop__row:hover { background: rgba(245,179,36,.08); }
.lang-pop__row.lang-pop__row--on {
  background: rgba(245,179,36,.12);
  color: var(--amber-400);
}
.lang-pop__row.lang-pop__row--on svg { margin-left: auto; color: var(--amber-400); }
.lang-pop__row.is-disabled {
  opacity: .42; cursor: not-allowed; pointer-events: none;
}
.flag {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line-dark);
  font-size: 11px; font-weight: 700;
  letter-spacing: .04em;
  flex: 0 0 auto;
}
.lang-pop__row--on .flag {
  background: rgba(245,179,36,.18);
  border-color: rgba(245,179,36,.4);
  color: var(--amber-400);
}
.lang-pop__name {
  display: flex; flex-direction: column;
  font-weight: 600;
  line-height: 1.2;
}
.lang-pop__name small {
  font-size: 11px; font-weight: 500;
  color: var(--slate-400);
  margin-top: 2px;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid transparent;
  background: transparent;
  transition: transform .12s, background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: var(--amber-500);
  color: var(--ink-900);
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 8px 18px -8px rgba(245,179,36,.7);
}
.btn--primary:hover { background: var(--amber-400); }
.btn--ghost {
  color: rgba(255,255,255,.85);
  border-color: var(--line-dark-strong);
}
.btn--ghost:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.3); }
.btn--lg {
  height: 52px;
  padding: 0 24px;
  font-size: 15px;
}
.btn--block { width: 100%; }
.btn--dark {
  background: var(--ink-900);
  color: #fff;
  border-color: var(--ink-900);
}
.btn--dark:hover { background: var(--ink-700); }
.btn--outline {
  border-color: var(--line-strong);
  color: var(--ink-900);
}
.btn--outline:hover { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }

.nav__cta { display: flex; align-items: center; gap: 8px; }

/* ─── Hamburger ──────────────────────────────────────────── */
.nav__burger {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line-dark-strong);
  border-radius: var(--r-sm);
  background: transparent;
  position: relative;
  margin-left: auto;
}
.nav__burger span {
  position: absolute; left: 12px; right: 12px; height: 1.5px;
  background: #fff; border-radius: 2px;
  transition: transform .25s, top .25s, opacity .2s;
}
.nav__burger span:nth-child(1) { top: 16px; }
.nav__burger span:nth-child(2) { top: 21px; }
.nav__burger span:nth-child(3) { top: 26px; }
body.is-menu-open .nav__burger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
body.is-menu-open .nav__burger span:nth-child(2) { opacity: 0; }
body.is-menu-open .nav__burger span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ─── Mobile Drawer ──────────────────────────────────────── */
.drawer {
  position: fixed; inset: 0;
  z-index: 70;
  background: var(--ink-900);
  color: #fff;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.6,.1,.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
body.is-menu-open .drawer { transform: translateX(0); }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--line-dark);
}
.drawer__head img { height: 24px; }
.drawer__brand {
  display: inline-flex; align-items: center;
}
.drawer__close {
  width: 44px; height: 44px; border-radius: var(--r-sm);
  border: 1px solid var(--line-dark-strong);
  background: transparent; color: #fff;
  font-size: 22px; line-height: 1;
}
.drawer__body { padding: 12px var(--gutter) 160px; flex: 1 1 auto; }

/* Drawer accordion */
.drawer__body > .acc { border-bottom: 1px solid var(--line-dark); }
.drawer__body > .acc__single {
  display: flex; align-items: center;
  padding: 18px 4px;
  font-size: 18px; font-weight: 600;
  color: #fff;
  border-bottom: 1px solid var(--line-dark);
  text-decoration: none;
}
.drawer__body > .acc__single:hover { color: var(--amber-400); }

.acc__head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px;
  background: transparent;
  border: 0;
  font-family: var(--font-sans);
  font-size: 18px; font-weight: 600;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: color .2s;
}
.acc__head:hover { color: var(--amber-400); }
.acc__head[aria-expanded="true"] { color: var(--amber-400); }
.acc__chev {
  flex: 0 0 auto;
  margin-left: 12px;
  transition: transform .25s ease;
  opacity: .75;
}
.acc__head[aria-expanded="true"] .acc__chev { transform: rotate(180deg); opacity: 1; }

.acc__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.acc__head[aria-expanded="true"] + .acc__panel { max-height: 500px; }
.acc__panel a {
  display: block;
  padding: 12px 0 12px 16px;
  font-size: 15px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  transition: color .15s;
}
.acc__panel a:first-child { padding-top: 4px; }
.acc__panel a:last-child { padding-bottom: 18px; }
.acc__panel a:hover { color: #fff; }
.acc__panel a.is-active { color: var(--amber-400); font-weight: 600; }
.acc__panel a[aria-disabled="true"] {
  color: rgba(255,255,255,.3);
  pointer-events: none;
}
.drawer__cta {
  position: sticky; bottom: 0;
  display: grid; gap: 10px;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--ink-900) 30%);
}
.drawer__cta .btn { height: 56px; font-size: 16px; }

/* ─── Section base ───────────────────────────────────────── */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section--alt { background: var(--paper); }
.section--dark { background: var(--ink-900); color: #fff; }

.section + .section:not(.section--dark) {
  border-top: 1px solid rgba(14,14,18,.10);
}

.sec-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 40px; margin-bottom: 56px;
  flex-wrap: wrap;
}
.sec-head__copy { max-width: 640px; }
.sec-head h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.15;
  letter-spacing: -.012em;
  font-weight: 700;
  margin: 14px 0 14px;
  text-wrap: balance;
}
.sec-head p {
  font-size: 16px; line-height: 1.7;
  color: var(--slate-500);
  margin: 0;
}
.section--dark .sec-head p { color: var(--slate-400); }

.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--amber-600);
}
.kicker::before {
  content: ""; width: 6px; height: 6px;
  background: var(--amber-500); border-radius: 1px;
  transform: rotate(45deg);
}
.section--dark .kicker { color: var(--amber-400); }
.brand { text-transform: none; letter-spacing: 0; }

/* ─── Footer ─────────────────────────────────────────────── */
.foot {
  background: var(--ink-900);
  color: rgba(255,255,255,.7);
  padding: 80px 0 32px;
  border-top: 1px solid var(--line-dark);
}
.foot__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line-dark);
}
.foot__brand img { height: 28px; display: block; }
.foot__brand-chip {
  display: inline-flex; align-items: center;
  margin-bottom: 22px;
}
.foot__brand p {
  font-size: 13px; line-height: 1.7;
  color: rgba(255,255,255,.55);
  margin: 0 0 20px;
  max-width: 320px;
}
.foot__addr {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255,255,255,.5);
  display: grid; gap: 4px;
}
.foot__addr b {
  color: rgba(255,255,255,.85); font-weight: 600;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
}
.foot__col h5 {
  font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: #fff;
  margin: 0 0 18px;
}
.foot__col ul { display: grid; gap: 12px; }
.foot__col a {
  font-size: 14px;
  color: rgba(255,255,255,.6);
  transition: color .15s;
}
.foot__col a:hover { color: var(--amber-400); }

.foot__risk {
  padding: 32px 0;
  border-bottom: 1px solid var(--line-dark);
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255,255,255,.55);
}
.foot__risk h6 {
  margin: 0 0 12px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--amber-400);
}
.foot__risk p { margin: 0 0 12px; }
.foot__risk p:last-child { margin: 0; }
.foot__risk strong { color: rgba(255,255,255,.8); font-weight: 600; }

.foot__bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  padding-top: 32px;
  font-size: 12px;
  color: rgba(255,255,255,.45);
}
.foot__legal { display: flex; flex-wrap: wrap; gap: 18px; }
.foot__legal a:hover { color: var(--amber-400); }

/* ─── Scroll reveal entry animations ─────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.2,.6,.2,1), transform .8s cubic-bezier(.2,.6,.2,1);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: translateY(0); }
[data-reveal] [data-reveal-child] {
  opacity: 0; transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2,.6,.2,1) var(--rd, 0ms),
              transform .7s cubic-bezier(.2,.6,.2,1) var(--rd, 0ms);
}
[data-reveal].is-in [data-reveal-child] { opacity: 1; transform: translateY(0); }

/* ─── Logo sizes ─────────────────────────────────────────── */
.nav__logo-icon {
  height: 34px !important;
  width: auto;
  display: block;
  border-radius: 6px;
}
.nav__logo-text {
  height: 22px !important;
  width: auto;
  display: block;
  margin-left: 6px;
}

.drawer__brand-icon {
  height: 40px !important;
  width: auto;
  display: block;
  border-radius: 6px;
}
.drawer__brand-text {
  height: 26px !important;
  width: auto;
  display: block;
  margin-left: 7px;
}

.foot__brand-icon {
  height: 34px !important;
  width: auto;
  display: block;
  border-radius: 6px;
}
.foot__brand-text {
  height: 22px !important;
  width: auto;
  display: block;
  margin-left: 6px;
}

/* ─── Lock scroll while drawer open ──────────────────────── */
body.is-menu-open { overflow: hidden; }

/* ─── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal] [data-reveal-child] {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
}

/* ════════════════ RESPONSIVE ═══════════════════════════════ */

@media (max-width: 1100px) {
  .nav__menu { display: none; }
  .nav__cta .btn--ghost { display: none; }
  .nav .lang-wrap { display: none; }
  .nav__burger { display: block; }
  .nav__inner { gap: 12px; }

  .foot__top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .foot__brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .risk-strip__inner { padding: 8px 16px; gap: 8px; }
  .risk-strip__tag { font-size: 10px; padding: 3px 7px; }
  .risk-strip__text {
    font-size: 11px;
    white-space: normal;
    line-height: 1.45;
  }
  .risk-strip__inner { align-items: flex-start; padding: 8px 16px; }
  .risk-strip__tag { margin-top: 1px; }

  .nav__cta .btn--primary { display: none; }
  .nav__inner { height: 64px; }
  .nav__logo img { height: 26px; }

  .foot { padding: 56px 0 24px; }
  .foot__top {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
    padding-bottom: 32px;
  }
  .foot__brand { grid-column: 1 / -1; }
  .foot__brand img { height: 28px; margin-bottom: 14px; }
  .foot__brand p { font-size: 13px; margin-bottom: 18px; line-height: 1.6; }
  .foot__addr { font-size: 12px; line-height: 1.6; }
  .foot__col h5 { margin-bottom: 12px; font-size: 11px; letter-spacing: .14em; }
  .foot__col ul { gap: 10px; }
  .foot__col a { font-size: 13.5px; }
  .foot__risk { padding: 22px 0; font-size: 11.5px; line-height: 1.7; }
  .foot__risk p { margin-bottom: 10px; }
  .foot__bottom {
    flex-direction: column; align-items: flex-start;
    padding-top: 18px; gap: 12px;
  }
  .foot__legal { gap: 16px; flex-wrap: wrap; }
  .foot__legal a { font-size: 12px; }
}

@media (max-width: 420px) {
  .foot__top { grid-template-columns: 1fr; gap: 28px; }
}
