/* 全站密码门 · 与魔法阵风格一致 -------------------- */

.gate-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* 当页面内容超过一屏时，用这个类启用纵向滚动并顶部对齐 */
.gate-page.gate-page-scroll {
  align-items: flex-start;
  overflow-y: auto;
}

.gate-wrap {
  width: 100%;
  max-width: 520px;
}

.gate-card,
.login-card,
.invite-card {
  padding: 40px 34px 44px;
  border-radius: 22px;
  background: rgba(20, 18, 28, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 100, 0.5);
  box-shadow:
    inset 2px -2px 1px -1px rgba(255, 255, 255, 0.15),
    inset -2px 2px 1px -1px rgba(255, 255, 255, 0.15),
    inset 6px -6px 1px -6px rgba(255, 255, 255, 0.1),
    inset -6px 6px 1px -6px rgba(255, 255, 255, 0.1),
    inset 0 0 2px rgba(0, 0, 0, 0.6),
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(180, 140, 80, 0.12);
  position: relative;
  overflow: hidden;
}

/* 门页卡片液态玻璃边缘高光 */
.gate-card::before,
.login-card::before,
.invite-card::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-radius: inherit;
  border: 1px solid rgba(0, 0, 0, 0.4);
  filter: blur(10px);
  pointer-events: none;
}

/* 门页卡片液态玻璃表面反光 */
.gate-card::after,
.login-card::after,
.invite-card::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  filter: blur(4px);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.4) 0%,
    transparent 30%,
    transparent 70%,
    rgba(255, 255, 255, 0.15) 100%
  );
  pointer-events: none;
}

.gate-card > *,
.login-card > *,
.invite-card > * {
  position: relative;
  z-index: 3;
}

/* 不支持 backdrop-filter 的降级 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gate-card,
  .login-card,
  .invite-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: linear-gradient(160deg, rgba(20, 18, 28, 0.95), rgba(35, 28, 48, 0.9));
  }
}

.gate-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.gate-header .logo-orb {
  margin-bottom: 12px;
}

.gate-header h1 {
  margin: 0 0 10px;
  font-size: 1.55rem;
  letter-spacing: 0.1em;
  color: #f5e6c8;
  text-shadow: 0 0 18px rgba(212, 175, 100, 0.45);
}

.gate-subtitle {
  margin: 0;
  font-size: 1rem;
  color: rgba(245, 230, 200, 0.88);
}

.gate-mode-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

/* 访客模式关闭时：站长登录占满第一行，拉长方框更美观 */
.gate-mode-select.gate-guest-hidden .gate-mode-admin {
  grid-column: 1 / -1;
}

.gate-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 18px;
  border-radius: 14px;
  border: 1.5px solid rgba(212, 175, 100, 0.4);
  background: rgba(22, 18, 14, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f0e6c8;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  font-family: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.gate-mode-btn::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  border-radius: inherit;
  border: 1px solid rgba(0, 0, 0, 0.3);
  filter: blur(6px);
  pointer-events: none;
}

.gate-mode-btn::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  filter: blur(2px);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 30%,
    transparent 70%,
    rgba(255, 255, 255, 0.1) 100%
  );
  pointer-events: none;
}

.gate-mode-btn > * {
  position: relative;
  z-index: 3;
}

.gate-mode-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 100, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 175, 100, 0.2);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gate-mode-btn {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: linear-gradient(150deg, rgba(22, 18, 14, 0.95), rgba(40, 32, 24, 0.95));
  }
}

.gate-mode-icon {
  font-size: 2.25rem;
  line-height: 1;
}

.gate-mode-btn h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.gate-mode-btn p {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.85;
  text-align: center;
}

.gate-mode-admin {
  border-color: rgba(212, 175, 100, 0.6);
}

.gate-mode-admin:hover {
  border-color: rgba(212, 175, 100, 0.85);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 24px rgba(212, 175, 100, 0.3);
}

a.gate-mode-btn {
  text-decoration: none;
  color: inherit;
}

a.gate-mode-btn:hover {
  color: #f0e6c8;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-form-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.gate-cancel-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 100, 0.4);
  background: rgba(28, 22, 18, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #d8d0c0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.gate-cancel-btn:hover {
  background: rgba(212, 175, 100, 0.2);
  color: #f0e6c8;
  box-shadow: 0 0 12px rgba(212, 175, 100, 0.15);
}

.gate-label {
  font-size: 0.88rem;
  color: #e0d8c0;
  letter-spacing: 0.04em;
}

.gate-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1.5px solid rgba(212, 175, 100, 0.5);
  background: rgba(15, 12, 18, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #f0e6d8;
  font-size: 1rem;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gate-input::placeholder {
  color: rgba(200, 190, 170, 0.6);
}

.gate-input:focus {
  outline: none;
  border-color: rgba(212, 175, 100, 0.8);
  box-shadow: 0 0 16px rgba(212, 175, 100, 0.2), inset 0 0 8px rgba(212, 175, 100, 0.08);
}

.gate-error {
  margin: 0;
  font-size: 0.88rem;
  color: #e88;
  min-height: 1.4em;
}

.gate-btn {
  margin-top: 10px;
  align-self: center;
  transform: scale(1.05);
}

.gate-btn:disabled {
  opacity: 0.8;
  cursor: wait;
}

@media (max-width: 420px) {
  .gate-wrap {
    max-width: 420px;
  }

  .gate-card,
  .login-card,
  .invite-card {
    padding: 30px 20px 34px;
  }

  .gate-mode-select {
    grid-template-columns: 1fr;
  }
}
