/* ============================================================
   Excel 工具箱 · 访问门禁（锁屏）样式
   tools/shared/site-gate.js 注入的 DOM 用这套皮肤。
   主题变量缺失时（工具页统一走各自主题变量）用兜底值。
   ============================================================ */

html.gate-locked,
html.gate-locked body { overflow: hidden; }

.site-gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--bg, #f7f7fb);
  animation: gate-fade 240ms cubic-bezier(.22,1,.36,1);
}
.site-gate.is-leaving { animation: gate-fade-out 180ms ease forwards; }

.gate-card {
  width: 100%; max-width: 340px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px;
  padding: 32px 26px 26px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #ececf1);
  border-radius: var(--r-card, 16px);
  box-shadow: var(--sh-card, 0 4px 16px rgba(0,0,0,.08));
}
.site-gate.is-shake .gate-card { animation: gate-shake 400ms cubic-bezier(.36,.07,.19,.97); }

.gate-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 4px;
  border-radius: 14px;
  background: var(--primary-soft, #eef2ff);
  color: var(--primary, #4f46e5);
}
.gate-icon svg { width: 26px; height: 26px; }

.gate-title { margin: 0; font-size: 19px; font-weight: 650; color: var(--text, #18181b); }
.gate-sub   { margin: 0 0 6px; font-size: 13px; color: var(--text-2, #71717a); }

.gate-field { display: flex; gap: 8px; width: 100%; }

.gate-input {
  flex: 1 1 auto; min-width: 0;
  padding: 10px 12px; font-size: 15px;
  color: var(--text, #18181b);
  background: var(--bg, #f7f7fb);
  border: 1px solid var(--border-2, #e4e4e7);
  border-radius: 10px; outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}
.gate-input::placeholder { color: var(--text-3, #a1a1aa); }
.gate-input:focus {
  border-color: var(--primary, #4f46e5);
  box-shadow: 0 0 0 3px var(--focus-ring, rgba(79,70,229,.25));
}

.gate-submit {
  flex: 0 0 auto;
  padding: 10px 18px; font-size: 15px; font-weight: 600;
  color: #fff; background: var(--primary, #4f46e5);
  border: none; border-radius: 10px; cursor: pointer;
  transition: background 160ms;
}
.gate-submit:hover { background: var(--primary-hover, #4338ca); }

.gate-msg { margin: 0; min-height: 18px; font-size: 13px; color: #ef4444; }

/* 顶栏「退出」按钮（由 index.html / 工具页注入） */
.lock-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 12px;
  font-size: 13px; color: var(--text-2, #71717a);
  background: var(--card, #fff);
  border: 1px solid var(--border-2, #e4e4e7);
  border-radius: var(--r-btn, 12px); cursor: pointer;
  transition: color 160ms, border-color 160ms, background 160ms;
}
.lock-btn svg { width: 15px; height: 15px; }
.lock-btn:hover { color: var(--primary, #4f46e5); border-color: var(--primary, #4f46e5); }

@keyframes gate-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gate-fade-out { to { opacity: 0; } }
@keyframes gate-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
