/* ========================================
   统一登录 / 权限门控页（与产品演示页一致）
   ======================================== */

/* 自包含主题令牌（嵌入同事方案页等未加载主站 styles.css 时仍一致） */
.auth-gate-page,
.demo-page.auth-gate-page,
.solution-auth-gate,
#detailNeedLogin {
  --bg-primary: #0B1120;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent-cyan: #00D4FF;
  --brand-primary: #0066CC;
  --gradient-primary: linear-gradient(135deg, #0066CC, #004C99);
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 32px rgba(0, 212, 255, 0.22);
  color: var(--text-primary);
}

.auth-gate-page,
.demo-page.auth-gate-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.auth-gate-page .bg-grid,
.auth-gate-page .bg-gradient-orb,
.demo-page .bg-grid,
.demo-page .bg-gradient-orb {
  display: block !important;
}

.auth-gate-page .bg-grid,
.demo-page .bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none;
  z-index: 0;
}

.auth-gate-page .bg-gradient-orb,
.demo-page .bg-gradient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.auth-gate-page .orb-1,
.demo-page .orb-1 {
  width: 520px;
  height: 520px;
  top: -120px;
  right: -80px;
  background: rgba(0, 102, 204, 0.22);
}

.auth-gate-page .orb-2,
.demo-page .orb-2 {
  width: 420px;
  height: 420px;
  bottom: -100px;
  left: -60px;
  background: rgba(0, 212, 255, 0.12);
}

.auth-gate-screen,
.demo-gate,
.solution-auth-gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 1rem;
  min-height: calc(100vh - 60px);
  position: relative;
  z-index: 1;
}

.solution-auth-gate {
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  z-index: 9999;
  background: #0B1120 !important;
  overflow-x: hidden;
  overflow-y: auto;
}

body.solution-locked .topbar {
  display: none !important;
}

html:not(.solution-auth-cached) .topbar {
  display: none !important;
}

.solution-auth-gate .bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none;
  z-index: 0;
}

.solution-auth-gate .bg-gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.solution-auth-gate .orb-1 {
  width: 520px;
  height: 520px;
  top: -120px;
  right: -80px;
  background: rgba(0, 102, 204, 0.22);
}

.solution-auth-gate .orb-2 {
  width: 420px;
  height: 420px;
  bottom: -100px;
  left: -60px;
  background: rgba(0, 212, 255, 0.12);
}

.solution-auth-gate .auth-gate-screen,
.solution-auth-gate.auth-gate-screen {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  flex: 1;
  box-sizing: border-box;
}

.solution-auth-gate .auth-gate-footer {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  display: block !important;
  text-align: center !important;
  justify-content: center !important;
  flex-direction: unset !important;
  border-top: none !important;
  padding: 1.25rem !important;
  font-family: inherit !important;
  font-size: 0.8rem !important;
  line-height: 1.5;
  color: var(--text-muted) !important;
  background: transparent !important;
}

.solution-auth-gate .logo-name-kd,
.solution-auth-gate .logo-name-svc,
.solution-auth-gate .auth-gate-brand-page,
.solution-auth-gate h2 {
  color: var(--text-primary) !important;
}

.solution-auth-gate .auth-gate-brand > p:last-child,
.solution-auth-gate .auth-gate-desc {
  color: var(--text-secondary) !important;
}

.solution-auth-gate .auth-gate-card,
.solution-auth-gate .solution-auth-gate-inner {
  background: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
  box-shadow: var(--shadow-card), var(--shadow-glow) !important;
}
.solution-auth-gate[hidden] {
  display: none !important;
}

#detailNeedLogin .bg-grid,
#detailNeedLogin .bg-gradient-orb {
  display: block !important;
}

.auth-gate-nav-back,
.demo-nav-back {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.auth-gate-nav-back:hover,
.demo-nav-back:hover {
  color: var(--accent-cyan);
  border-color: var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
}

.auth-gate-brand,
.demo-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-gate-brand-logo,
.demo-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.auth-gate-brand-logo .logo-brand,
.demo-brand-logo .logo-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-gate-brand-logo-img,
.demo-brand-logo-img,
.auth-gate-brand-logo .brand-logo {
  height: 48px;
  width: auto;
  margin: 0;
  display: block;
}

.auth-gate-brand-logo .logo-name-kd,
.auth-gate-brand-logo .logo-name-svc,
.demo-brand-logo .logo-name-kd,
.demo-brand-logo .logo-name-svc {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.auth-gate-brand-page,
.demo-brand-page {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.auth-gate-brand > p:last-child,
.demo-brand > p:last-child {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-gate-card,
.demo-card,
.solution-auth-gate-inner {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.auth-gate-card::before,
.demo-card::before,
.solution-auth-gate-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.5;
}

.auth-gate-card--form {
  max-width: 420px;
  padding: 2rem;
}

.auth-gate-state,
.demo-state {
  text-align: center;
  animation: auth-gate-fade-in 0.35s ease;
}

@keyframes auth-gate-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-gate-icon,
.demo-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-gate-icon--lock,
.demo-state-icon--lock {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--accent-cyan);
}

.auth-gate-icon--deny,
.demo-state-icon--deny {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.25);
  color: #ff7b72;
}

.auth-gate-state h2,
.demo-state h2,
.auth-gate-card--form h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.auth-gate-desc,
.demo-state-desc,
.auth-gate-card--form .subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.auth-gate-hint,
.demo-state-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.auth-gate-actions,
.solution-auth-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.auth-gate-cta,
.demo-cta,
.solution-auth-gate-actions .auth-gate-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 2rem;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}

.auth-gate-cta:hover,
.demo-cta:hover {
  color: #fff;
  text-decoration: none;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.35);
  transform: translateY(-1px);
}

.auth-gate-cta:active,
.demo-cta:active {
  transform: translateY(0);
}

.auth-gate-cta--ghost,
.demo-cta--ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  box-shadow: none;
}

.auth-gate-cta--ghost:hover,
.demo-cta--ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
  transform: none;
}

.auth-gate-spinner,
.demo-spinner,
.auth-gate-state .demo-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 212, 255, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: auth-gate-spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

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

.auth-gate-footer,
.demo-footer {
  text-align: center;
  padding: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.auth-gate-footer a,
.demo-footer a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.auth-gate-footer a:hover,
.demo-footer a:hover {
  color: var(--accent-cyan);
}

/* 登录表单（login.html） */
.auth-gate-form .form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.auth-gate-form .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-gate-form .form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.auth-gate-form .form-group input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.auth-gate-error {
  display: none;
  padding: 0.65rem 0.875rem;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: var(--radius-sm);
  color: #ff7b72;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: left;
}

.auth-gate-error.visible {
  display: block;
}

.auth-gate-submit {
  width: 100%;
  padding: 0.8rem;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  font-family: inherit;
}

.auth-gate-submit:hover:not(:disabled) {
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.35);
  transform: translateY(-1px);
}

.auth-gate-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-gate-form-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-gate-form-footer a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.auth-gate-form-footer a:hover {
  text-decoration: underline;
}

.auth-gate-form-note {
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.auth-gate-submit .auth-gate-spinner-inline {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-gate-spin 0.8s linear infinite;
  margin: 0;
}

body.solution-locked {
  overflow: hidden !important;
  height: 100% !important;
  background: #0B1120 !important;
}

html:not(.solution-auth-cached) body.solution-page {
  overflow: hidden !important;
  height: 100% !important;
  background: #0B1120 !important;
}

html:not(.solution-auth-cached) body.solution-page main,
html:not(.solution-auth-cached) body.solution-page > footer {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 480px) {
  .auth-gate-nav-back,
  .demo-nav-back {
    top: 1rem;
    left: 1rem;
    font-size: 0.8rem;
  }

  .auth-gate-brand-logo .logo-name-kd,
  .auth-gate-brand-logo .logo-name-svc,
  .demo-brand-logo .logo-name-kd,
  .demo-brand-logo .logo-name-svc {
    font-size: 1.35rem;
  }

  .auth-gate-card,
  .demo-card,
  .solution-auth-gate-inner {
    padding: 2rem 1.25rem;
  }

  .auth-gate-cta,
  .demo-cta {
    width: 100%;
  }
}
