/* 入口校验层：验证完成前隐藏测试正文，避免未授权用户直接看到题目。 */
html.entry-locked {
  overflow: hidden;
}

html.entry-locked:not(.entry-gate-deferred) body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background:
    radial-gradient(120% 90% at 50% 0%, #eef3ff 0%, #f6f7fb 55%, #eef1f8 100%);
}

html.entry-locked:not(.entry-gate-deferred) body > *:not(.entry-gate-layer) {
  display: none !important;
}

.entry-gate-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(120% 90% at 50% 0%, #eef3ff 0%, #f6f7fb 55%, #eef1f8 100%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1d2638;
  -webkit-font-smoothing: antialiased;
}

/* 延迟校验的授权码以弹窗形式覆盖在欢迎页上。 */
.entry-gate-layer.entry-gate-layer--modal {
  background: rgba(12, 18, 32, 0.52);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: entry-gate-fade-in 0.18s ease-out both;
}

.entry-gate-layer--modal .entry-gate-card {
  animation: entry-gate-pop-in 0.24s cubic-bezier(0.2, 0.85, 0.35, 1.15) both;
}

@keyframes entry-gate-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes entry-gate-pop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.entry-gate-card {
  width: min(420px, 100%);
  padding: 34px 32px 28px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(29, 56, 117, 0.16), 0 2px 6px rgba(29, 56, 117, 0.06);
  text-align: center;
}

.entry-gate-badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #eef3ff, #dfe9ff);
  color: #4f7cff;
}

.entry-gate-badge svg {
  width: 26px;
  height: 26px;
}

.entry-gate-eyebrow {
  margin: 0 0 6px;
  color: #8b95a7;
  font-size: 12px;
  letter-spacing: 0.16em;
}

.entry-gate-title {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
}

.entry-gate-subtitle {
  margin: 0 0 22px;
  color: #78818f;
  font-size: 13px;
  line-height: 1.7;
}

.entry-gate-form {
  text-align: left;
}

.entry-gate-label {
  display: block;
  margin: 0 0 8px;
  color: #5b6475;
  font-size: 12px;
  font-weight: 500;
}

.entry-gate-input {
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid #dde3ee;
  border-radius: 12px;
  outline: none;
  background: #fbfcfe;
  color: #1d2638;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-align: center;
  text-transform: uppercase;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.entry-gate-input::placeholder {
  color: #aab2c0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.entry-gate-input:focus {
  border-color: #4f7cff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.12);
}

.entry-gate-submit {
  width: 100%;
  height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #5b86ff, #3f68f0);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 12px 26px rgba(79, 124, 255, 0.3);
}

.entry-gate-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(79, 124, 255, 0.36);
}

.entry-gate-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.entry-gate-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: #e05252;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: left;
}

.entry-gate-error:empty {
  margin-top: 0;
}

.entry-gate-note {
  margin: 14px 0 0;
  padding-top: 16px;
  border-top: 1px solid #eef1f7;
  color: #98a1b1;
  font-size: 11.5px;
  line-height: 1.7;
}

.entry-gate-busy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 0 10px;
  color: #6b7688;
  font-size: 13px;
}

.entry-gate-busy[hidden] {
  display: none;
}

.entry-gate-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(79, 124, 255, 0.2);
  border-top-color: #4f7cff;
  border-radius: 50%;
  animation: entry-gate-spin 0.8s linear infinite;
}

@keyframes entry-gate-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .entry-gate-card {
    padding: 28px 22px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-gate-spinner {
    animation-duration: 2s;
  }
}
