/* =========================================================
   gate.css —— S151 进站门禁
   ---------------------------------------------------------
   显隐完全由 <html> 上的 gate 类驱动：
     head 内联脚本在「非本机 + 没解锁过」时给 html 挂 gate 类（渲染前生效，不闪数据）；
     js/guard.js 校验通过后摘类。快照页没有这段内联、DOM 也被导出器剥掉，天然免疫。
   变量全部走 --v2-*（跟站内主题同一批），明暗与四套主题包自动适配。
   层级：desktopRoot=40 / #modal=100 / .toast=320 —— 门禁 330 压住一切。
   ========================================================= */

#siteGate{display:none}

html.gate #siteGate{
  display:flex;
  position:fixed; inset:0; z-index:330;
  align-items:center; justify-content:center;
  padding:26px;
  background:var(--v2-bg);
  /* 极淡的经纬网格：跟「世界旅行地图」一个意象，不抢戏 */
  background-image:
    linear-gradient(rgba(var(--w), .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--w), .045) 1px, transparent 1px);
  background-size:44px 44px, 44px 44px;
  -webkit-font-smoothing:antialiased;
}

/* 中央卡片 */
#siteGate .sg-card{
  width:min(360px, 100%);
  text-align:center;
  padding:34px 28px 26px;
  border-radius:22px;
  border:1px solid var(--v2-line);
  background:linear-gradient(165deg, var(--v2-card2), var(--v2-card));
  box-shadow:0 22px 60px -24px rgba(0,0,0,.5);
}

/* 顶部圆徽：经纬球 */
#siteGate .sg-globe{
  width:64px; height:64px; margin:0 auto 14px;
  border-radius:50%;
  display:grid; place-items:center;
  background:var(--v2-card3);
  border:1px solid var(--v2-line2);
  color:var(--v2-blue);
  font-size:30px; line-height:1;
}

#siteGate .sg-title{
  margin:0 0 6px;
  font-size:19px; font-weight:700; letter-spacing:.02em;
  color:var(--v2-txt);
}
#siteGate .sg-sub{
  margin:0 0 22px;
  font-size:12.5px; line-height:1.65;
  color:var(--v2-txt2);
}

/* 密码输入：居中大字 */
#siteGate .sg-input{
  width:100%; box-sizing:border-box;
  padding:13px 14px;
  border-radius:13px;
  border:1.5px solid var(--v2-line2);
  background:var(--v2-card3);
  color:var(--v2-txt);
  font-size:17px; letter-spacing:.42em; text-indent:.42em;
  text-align:center;
  outline:none;
  transition:border-color .18s;
}
#siteGate .sg-input:focus{ border-color:var(--v2-blue) }
#siteGate .sg-input::placeholder{ color:var(--v2-txt3); letter-spacing:.1em; text-indent:.1em; font-size:13.5px }

/* 进入按钮 */
#siteGate .sg-go{
  width:100%; margin-top:12px;
  padding:13px 0;
  border:0; border-radius:13px;
  background:var(--v2-blue);
  color:var(--v2-bg);
  font-size:15px; font-weight:700; letter-spacing:.14em;
  cursor:pointer;
}
#siteGate .sg-go:active{ transform:translateY(1px) }
/* S151b：核对中（4 万次哈希要跑几百毫秒）—— 不给禁用态的话
   按钮看起来像没反应，用户会以为卡死然后狂点 */
#siteGate .sg-go:disabled{
  opacity:.72; cursor:progress;
  transform:none;
}
#siteGate .sg-go:disabled:active{ transform:none }

/* 错误提示 + 抖动 */
#siteGate .sg-err{
  min-height:18px; margin-top:12px;
  font-size:12px; color:var(--v2-red-tx);
}
#siteGate.sg-shake .sg-card{ animation:sgShake .38s }
@keyframes sgShake{
  20%{ transform:translateX(-9px) } 40%{ transform:translateX(8px) }
  60%{ transform:translateX(-5px) } 80%{ transform:translateX(3px) }
}

/* 底部小字 */
#siteGate .sg-foot{
  margin-top:16px;
  font-size:11px; color:var(--v2-txt3); letter-spacing:.04em;
}

/* 窄屏略收 */
@media (max-width:400px){
  html.gate #siteGate{ padding:18px }
  #siteGate .sg-card{ padding:28px 20px 20px }
}
