/* ============================================================
 * FBNB 开屏登录页（配色跟随当前主题变量）
 * 覆盖层 z-index 150，低于钱包选择弹层(200)、高于顶栏(50)
 * ============================================================ */

body.gate-open { overflow: hidden; }

.gate {
  position: fixed; inset: 0; z-index: 150;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  transition: opacity .35s ease, visibility .35s ease;
}
.gate.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* 背景光晕（跟随主题主色） */
.gate::before {
  content: ''; position: absolute; left: 50%; top: 46%;
  width: 120vw; height: 120vw; max-width: 1100px; max-height: 1100px;
  transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle, var(--glow) 0%, var(--glow-2) 32%, transparent 66%);
}

/* ---------- 顶部栏 ---------- */
.gate-top {
  position: relative; z-index: 2;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
}
.gate-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.gate-brand-logo { width: 120px; height: auto; filter: drop-shadow(0 0 10px var(--btn-shadow)); }
.gate-brand-name { display: none; }
.gate-top-actions { display: flex; align-items: center; gap: 10px; }
.gate-connect {
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary); border-radius: 999px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .2s, border-color .2s;
}
.gate-connect:hover { background: var(--primary-soft2); border-color: var(--primary); }
.gate-connect .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); margin-right: 7px; vertical-align: 1px;
  box-shadow: 0 0 8px var(--btn-shadow);
}
.gate-icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--text); display: grid; place-items: center; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.gate-icon-btn:hover { background: var(--card-2); border-color: var(--primary); }
.gate-icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------- 主视觉 ---------- */
.gate-main {
  position: relative; z-index: 1;
  flex: 1 1 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 24px;
  min-height: 0;
}
/* logo 两侧竖直光线 */
.gate-main::before, .gate-main::after {
  content: ''; position: absolute; top: 16%; height: 42%; width: 1px;
  background: linear-gradient(180deg, transparent, var(--primary-border), transparent);
}
.gate-main::before { left: 12%; }
.gate-main::after { right: 12%; }

.gate-logo-wrap {
  position: relative;
  width: min(82vw, 320px);
  margin-bottom: 22px;
}
.gate-logo { width: 100%; height: auto; display: block; }
.gate-floor {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  width: 92%; height: 34px; pointer-events: none;
  background: radial-gradient(ellipse at center, var(--glow) 0%, var(--glow-2) 42%, transparent 72%);
  filter: blur(5px);
}
.gate-kicker {
  font-size: clamp(24px, 6.6vw, 34px); font-weight: 800;
  letter-spacing: 2px; color: var(--text); margin-bottom: 4px;
}
.gate-title {
  font-size: clamp(46px, 15vw, 76px); line-height: 1.05; font-weight: 900;
  letter-spacing: 1px; margin-bottom: 12px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-2) 55%, var(--cyan) 140%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 26px var(--btn-shadow));
}
.gate-sub {
  font-size: 13px; line-height: 1.7; color: var(--muted); letter-spacing: .5px;
  max-width: 330px;
}

/* ---------- 底部按钮 ---------- */
.gate-bottom {
  position: relative; z-index: 2;
  flex: 0 0 auto;
  padding: 8px 24px max(28px, env(safe-area-inset-bottom));
  text-align: center;
}
.gate-login {
  display: block; width: 100%; max-width: 430px; margin: 0 auto;
  height: 56px; border: none; border-radius: 16px;
  font-size: 16px; font-weight: 800; letter-spacing: 1px; color: #fff;
  cursor: pointer;
  background: var(--grad);
  box-shadow: 0 10px 34px var(--btn-shadow), inset 0 1px 0 rgba(255,255,255,.22);
  transition: transform .15s, box-shadow .2s;
}
.gate-login:hover { transform: translateY(-2px); box-shadow: 0 14px 40px var(--btn-shadow-hover), inset 0 1px 0 rgba(255,255,255,.22); }
.gate-login:active { transform: translateY(0); }
.gate-login.busy { opacity: .7; cursor: wait; }
.gate-status {
  min-height: 20px; margin: 0 auto 6px; max-width: 430px;
  font-size: 13px; line-height: 1.5; color: var(--primary);
}
.gate-status:empty { display: none; }

/* 签名失败兜底：钱包插件不支持签名时，不让用户卡在开屏 */
.gate-fallback {
  display: flex; gap: 10px; justify-content: center;
  max-width: 430px; margin: 10px auto 0;
}
.gate-fallback[hidden] { display: none; }
.gate-fallback-btn {
  flex: 1; height: 40px; border-radius: 11px; cursor: pointer;
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  transition: background .2s, border-color .2s;
}
.gate-fallback-btn:hover { background: var(--card-2); border-color: var(--primary); }
.gate-fallback-enter {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
}
.gate-fallback-enter:hover { background: var(--primary-soft2); border-color: var(--primary); }

@media (min-width: 720px) {
  .gate-top { padding: 18px 32px; }
  .gate-logo-wrap { width: 360px; margin-bottom: 26px; }
  .gate-sub { font-size: 14px; }
}
@media (max-height: 620px) {
  .gate-logo-wrap { width: min(72vw, 280px); margin-bottom: 10px; }
  .gate-title { font-size: clamp(40px, 11vw, 56px); }
  .gate-main::before, .gate-main::after { height: 30%; }
}
