/**
 * auth.css — 密码保护遮罩层样式
 * 科技风格，与大屏主题完全统一
 */

/* ── 全屏遮罩 ── */
#authOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0, 80, 140, 0.45) 0%, transparent 70%),
    linear-gradient(135deg, #020b18 0%, #061428 50%, #020b18 100%);
  /* 背景网格 */
  background-image:
    radial-gradient(ellipse at 50% 40%, rgba(0, 80, 140, 0.45) 0%, transparent 70%),
    linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  animation: authFadeIn 0.4s ease;
}

#authOverlay.auth-success {
  animation: authFadeOut 0.6s ease forwards;
}

@keyframes authFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes authFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.05); }
}

/* ── 认证卡片 ── */
.auth-box {
  position: relative;
  width: 420px;
  padding: 48px 40px 40px;
  background: linear-gradient(145deg, rgba(6, 20, 40, 0.96), rgba(2, 12, 26, 0.98));
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(0, 212, 255, 0.08),
    0 0 40px rgba(0, 100, 200, 0.25),
    0 0 80px rgba(0, 50, 120, 0.15),
    inset 0 1px 0 rgba(0, 212, 255, 0.1);
  text-align: center;
}

/* 四角装饰 */
.auth-corner {
  position: absolute;
  width: 16px;
  height: 16px;
}
.auth-corner.tl { top: -1px;    left: -1px;  border-top: 2px solid var(--accent-cyan); border-left:  2px solid var(--accent-cyan); }
.auth-corner.tr { top: -1px;    right: -1px; border-top: 2px solid var(--accent-cyan); border-right: 2px solid var(--accent-cyan); }
.auth-corner.bl { bottom: -1px; left: -1px;  border-bottom: 2px solid var(--accent-cyan); border-left:  2px solid var(--accent-cyan); }
.auth-corner.br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent-cyan); border-right: 2px solid var(--accent-cyan); }

/* ── 图标 ── */
.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(0, 212, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  background: rgba(0, 212, 255, 0.07);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
  animation: authPulseRing 2.5s ease-in-out infinite;
}
.auth-logo i {
  font-size: 26px;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.8));
}

@keyframes authPulseRing {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.2), 0 0 0 0 rgba(0, 212, 255, 0.3); }
  50%       { box-shadow: 0 0 20px rgba(0, 212, 255, 0.4), 0 0 0 10px rgba(0, 212, 255, 0); }
}

/* ── 标题 ── */
.auth-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent-cyan);
  opacity: 0.7;
}
.auth-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
  margin: 20px 0;
}

/* ── 提示文字 ── */
.auth-tip {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

/* ── 输入框组 ── */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 3px;
  transition: border-color 0.25s;
}
.auth-input-wrap:focus-within {
  border-color: rgba(0, 212, 255, 0.6);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.auth-input-icon {
  padding: 0 12px;
  color: var(--accent-cyan);
  opacity: 0.6;
  font-size: 14px;
  pointer-events: none;
}

#authInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 8px;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: 4px;
  font-family: 'Courier New', monospace;
}
#authInput::placeholder {
  letter-spacing: 6px;
  font-size: 16px;
  color: rgba(180, 210, 240, 0.25);
}

/* 眼睛按钮 */
.auth-eye {
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0 14px;
  color: rgba(0, 212, 255, 0.5);
  font-size: 14px;
  transition: color 0.2s;
}
.auth-eye:hover { color: var(--accent-cyan); }

/* ── 确认按钮 ── */
.auth-btn {
  width: 100%;
  padding: 13px 0;
  background: linear-gradient(90deg, rgba(0, 150, 220, 0.7), rgba(0, 212, 255, 0.5));
  border: 1px solid rgba(0, 212, 255, 0.5);
  border-radius: 3px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.25s;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}
.auth-btn:hover:not(:disabled) {
  background: linear-gradient(90deg, rgba(0, 180, 255, 0.8), rgba(0, 240, 255, 0.65));
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  transform: translateY(-1px);
}
.auth-btn:active:not(:disabled) { transform: translateY(0); }
.auth-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── 错误信息 ── */
.auth-error {
  min-height: 22px;
  margin-top: 12px;
  font-size: 12px;
  color: #ff6b6b;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.3s;
  text-shadow: 0 0 8px rgba(255, 100, 100, 0.5);
}

/* ── 取消按钮 ── */
.auth-cancel-btn {
  width: 100%;
  padding: 10px 0;
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--border-dim);
  border-radius: 3px;
  color: var(--text-secondary);
  font-size: 13px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.25s;
}
.auth-cancel-btn:hover {
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--text-primary);
}

/* ── 底部说明 ── */
.auth-footer {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.auth-footer .pulse-dot {
  font-size: 8px;
  color: var(--accent-green);
  animation: pulseGreen 1.5s ease-in-out infinite;
}

@keyframes pulseGreen {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── 摇晃动画（密码错误时） ── */
.auth-box.shake {
  animation: shakeBox 0.4s ease;
}
@keyframes shakeBox {
  0%  { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  90% { transform: translateX(3px); }
  100%{ transform: translateX(0); }
}

/* ── 移动端适配 ── */
@media (max-width: 500px) {
  .auth-box { width: 90vw; padding: 36px 24px 30px; }
  .auth-title { font-size: 16px; }
}

/* ── Toast 提示 ── */
.auth-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(255, 100, 100, 0.9);
  color: #fff;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 10px 24px;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(255, 80, 80, 0.4);
  opacity: 0;
  transition: all 0.35s ease;
  pointer-events: none;
  z-index: 10001;
}
.auth-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
