/* ==========================================================================
   Gate.com 首页克隆 —— 基础样式
   配色取自官网：品牌蓝 #0055FF / 上涨绿 #0ECB81 / 下跌红 #F6465D
   ========================================================================== */

/* ---------- 变量 ---------- */
:root {
  --brand: #0055ff;
  --brand-soft: rgba(0, 85, 255, 0.14);
  --green: #0ecb81;
  --green-soft: rgba(14, 203, 129, 0.12);
  --red: #f6465d;
  --red-soft: rgba(246, 70, 93, 0.12);

  --bg: #0a0d12;
  --bg-soft: #0e1218;
  --elev: #12171e;
  --card: #141920;
  --card-2: #191f27;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eaecef;
  --text-2: #9aa4b2;
  --text-3: #6b7482;

  --radius: 12px;
  --radius-l: 18px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --container: 1280px;
  --header-h: 64px;
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-soft: #eef1f5;
  --elev: #ffffff;
  --card: #ffffff;
  --card-2: #f2f5f8;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #10151f;
  --text-2: #5b6472;
  --text-3: #8a94a3;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

.g-container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.g-up { color: var(--green); }
.g-down { color: var(--red); }

/* ---------- 顶部条 ---------- */
.g-topbar {
  background: linear-gradient(90deg, rgba(0, 85, 255, 0.18), rgba(0, 224, 164, 0.12));
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
}
.g-topbar__inner { display: flex; align-items: center; gap: 8px; height: 34px; }
.g-topbar__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.g-topbar__sep { width: 1px; height: 12px; background: var(--border-strong); }
.g-topbar__brand { font-weight: 600; letter-spacing: .02em; color: var(--text); }

/* ---------- 页头 ---------- */
.g-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.g-header__inner { display: flex; align-items: center; gap: 22px; height: var(--header-h); }
.g-logo img { height: 26px; width: auto; }
.g-footer__brand img { height: 28px; width: auto; }
.g-logo img, .g-footer__brand img { filter: none; }
.g-logo__on-light { display: none; }
html[data-theme="light"] .g-logo__on-dark { display: none; }
html[data-theme="light"] .g-logo__on-light { display: inline-block; }
[data-theme="light"] .g-logo img,
[data-theme="light"] .g-footer__brand img { filter: none; }

.g-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.g-nav__item {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 15px; font-weight: 500;
  transition: color .18s, background .18s;
}
.g-nav__item:hover, .g-nav__item.is-open { color: var(--text); background: var(--brand-soft); }
.g-nav__item svg { transition: transform .2s; opacity: .7; }
.g-nav__item.is-open svg { transform: rotate(180deg); }

.g-header__actions { display: flex; align-items: center; gap: 8px; }
.g-icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: background .18s, color .18s;
}
.g-icon-btn:hover { background: var(--card-2); color: var(--text); }
.g-icon-sun { display: none; }
[data-theme="light"] .g-icon-sun { display: block; }
[data-theme="light"] .g-icon-moon { display: none; }

.g-btn {
  height: 36px; padding: 0 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: transform .16s, box-shadow .2s, background .2s, border-color .2s;
}
.g-btn:active { transform: translateY(1px); }
.g-btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(0, 85, 255, .28); }
.g-btn--primary:hover { background: #1f6bff; box-shadow: 0 8px 24px rgba(0, 85, 255, .4); }
.g-btn--ghost { color: var(--text); border: 1px solid var(--border-strong); }
.g-btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.g-btn--outline { border: 1px solid var(--border-strong); color: var(--text); }
.g-btn--outline:hover { border-color: var(--brand); color: var(--brand); }
.g-btn--lg { height: 44px; padding: 0 26px; font-size: 15px; border-radius: 10px; }
.g-btn--block { width: 100%; }

.g-search {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-3);
}
.g-search[hidden] { display: none; }
.g-search input { border: none; outline: none; background: none; color: var(--text); width: 220px; font-size: 13px; }
.g-search__esc { font-size: 10px; border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 4px; }

.g-burger { display: none; flex-direction: column; gap: 4px; }
.g-burger span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

/* ---------- 巨幕菜单 ---------- */
.g-mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--elev);
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: gMegaIn .18s ease;
}
@keyframes gMegaIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.g-mega__inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; padding: 26px 24px 30px; }
.g-mega__col { min-width: 0; }
.g-mega__title { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 4px; letter-spacing: .02em; }
.g-mega__group { font-size: 11px; color: var(--text-3); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: .08em; }
.g-mega__item { display: block; padding: 7px 8px; border-radius: 8px; transition: background .16s; }
.g-mega__item:hover { background: var(--card-2); }
.g-mega__name { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--text); }
.g-mega__desc { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.g-mega__tag { font-size: 10px; line-height: 16px; padding: 0 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.g-mega__tag--hot { background: var(--red-soft); color: var(--red); }
.g-mega__tag--fee { background: var(--green-soft); color: var(--green); }
.g-mega__promo {
  border-radius: var(--radius); padding: 16px; border: 1px solid var(--border);
  background: linear-gradient(150deg, rgba(0, 85, 255, .16), rgba(0, 224, 164, .08));
}
.g-mega__promo h4 { margin: 8px 0 4px; font-size: 15px; }
.g-mega__promo p { margin: 0 0 12px; font-size: 12px; color: var(--text-2); }
.g-mega__promo img { height: 24px; width: auto; }

/* ---------- Hero ---------- */
.g-hero { position: relative; overflow: hidden; padding: 76px 0 92px; }
.g-hero__bg {
  position: absolute; inset: -20% -10% auto -10%; height: 140%;
  background:
    radial-gradient(45% 45% at 18% 24%, rgba(0, 85, 255, .32), transparent 70%),
    radial-gradient(38% 38% at 78% 18%, rgba(0, 224, 164, .18), transparent 70%),
    radial-gradient(50% 50% at 60% 70%, rgba(84, 46, 255, .18), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}
.g-hero__inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.g-hero__eyebrow {
  margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .22em;
  color: transparent; background: linear-gradient(90deg, #4d8bff, #00e0a4);
  -webkit-background-clip: text; background-clip: text;
}
.g-hero__title { margin: 0 0 18px; font-size: 52px; line-height: 1.16; font-weight: 800; letter-spacing: -.02em; }
.g-hero__sub { margin: 0 0 30px; font-size: 16px; color: var(--text-2); max-width: 560px; }
.g-hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.g-hero__social { margin-top: 28px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.g-hero__or { font-size: 12.5px; color: var(--text-3); }
.g-social { display: flex; gap: 8px; }
.g-social__btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); color: var(--text-2);
  transition: transform .16s, border-color .16s, color .16s;
}
.g-social__btn:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--text); }

/* Hero 视觉 */
.g-hero__visual { position: relative; height: 420px; }
.g-hero__ring { position: absolute; border-radius: 50%; border: 1px solid var(--border-strong); }
.g-hero__ring--1 { width: 340px; height: 340px; top: 30px; right: 40px; }
.g-hero__ring--2 { width: 240px; height: 240px; top: 80px; right: 90px; border-style: dashed; }
.g-orb {
  position: absolute; width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--border); backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  animation: gFloat 6s ease-in-out infinite;
}
.g-orb img { width: 38px; height: 38px; border-radius: 50%; }
.g-orb--1 { top: 16px; right: 150px; animation-delay: .1s; }
.g-orb--2 { top: 110px; right: 44px; animation-delay: .8s; }
.g-orb--3 { top: 250px; right: 168px; animation-delay: 1.4s; }
.g-orb--4 { top: 300px; right: 62px; animation-delay: .4s; }
.g-orb--5 { top: 60px; right: 300px; animation-delay: 1.9s; }
@keyframes gFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.g-hero__card {
  position: absolute; left: 0; bottom: 18px; width: 250px;
  padding: 16px 18px; border-radius: var(--radius-l);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--border); backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.g-hero__card-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); padding: 5px 0; }
.g-hero__card-row b { color: var(--text); font-size: 14px; }

/* ---------- 统计条 ---------- */
.g-stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.g-stats__grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.g-stat { padding: 26px 18px; border-right: 1px solid var(--border); text-align: center; }
.g-stat:last-child { border-right: none; }
.g-stat__value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.g-stat__value span { font-size: 16px; font-weight: 600; margin-left: 2px; }
.g-stat__label { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }

/* ---------- 通用区块 ---------- */
.g-section { padding: 68px 0; }
.g-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.g-section__head--center { flex-direction: column; align-items: center; text-align: center; }
.g-section__title { margin: 0 0 8px; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.g-section__sub { margin: 0; color: var(--text-2); font-size: 15px; }
.g-link-more { color: var(--brand); font-weight: 600; font-size: 14px; }
.g-link-more:hover { text-decoration: underline; }

.g-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); }
.g-tab { padding: 7px 18px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-3); transition: background .18s, color .18s; }
.g-tab:hover { color: var(--text); }
.g-tab.is-active { background: var(--brand); color: #fff; }

/* ---------- 滚动进场 ---------- */
.g-reveal { opacity: 0; transform: translateY(22px); transition: opacity .55s ease, transform .55s ease; }
.g-reveal.is-in { opacity: 1; transform: none; }

/* ---------- 返回顶部 ---------- */
.g-totop {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .2s, transform .2s, border-color .2s;
}
.g-totop.is-show { opacity: 1; pointer-events: auto; transform: none; }
.g-totop:hover { border-color: var(--brand); color: var(--brand); }
