/* ==========================================================================
   祝刚个人网站 (zgdgt.cn) · 登录/注册模态框与导航联动样式
   参考风格：鱼皮 AI 导航 (ai.codefather.cn)
   ========================================================================== */

/* --- 1. 桌面端导航栏登录/注册入口 --- */
.zg-nav-user-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  user-select: none;
  z-index: 9999;
}

.zg-login-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 999px;
  color: #5eead4;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
  backdrop-filter: blur(8px);
}

.zg-login-trigger:hover {
  background: rgba(45, 212, 191, 0.22);
  border-color: #5eead4;
  color: #5eead4;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.35);
  transform: translateY(-1px);
}

.zg-nav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d9488, #2563eb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.zg-nav-avatar svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.zg-nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zg-nav-username {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zg-nav-arr {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.zg-nav-user-wrap:hover .zg-nav-arr {
  transform: rotate(180deg);
}

/* --- 2. 登录态下拉菜单 --- */
.zg-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 204px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.zg-nav-user-wrap:hover .zg-user-dropdown,
.zg-nav-user-wrap:focus-within .zg-user-dropdown,
.zg-user-dropdown.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.zg-dropdown-header {
  padding: 6px 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.zg-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.zg-dropdown-badge {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
  font-weight: normal;
}

.zg-dropdown-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
}

.zg-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #cbd5e1;
  font-size: 13px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.zg-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #5eead4;
}

.zg-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.zg-dropdown-logout {
  color: #f87171 !important;
}

.zg-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

/* --- 3. 模态框整体框架 (Modal Overlay & Card) --- */
.zg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  padding: 48px 16px 16px;
  box-sizing: border-box;
}

.zg-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.zg-modal-card {
  width: 744px;
  max-width: 95vw;
  min-height: 480px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  position: relative;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.zg-modal-overlay.is-active .zg-modal-card {
  transform: scale(1) translateY(0);
}

/* 关闭按钮 - 置于卡片右上角外部，清晰独立且不阻挡角落折角切换按钮 */
.zg-modal-close {
  position: absolute;
  top: -42px;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.zg-modal-close:hover {
  background: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  transform: rotate(90deg);
}

.zg-modal-close svg {
  width: 15px;
  height: 15px;
}

/* --- 4. 模态框左侧海报展示区 (Blue Hero Banner) --- */
.zg-modal-left {
  flex: 0 0 295px;
  background: linear-gradient(150deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  color: #ffffff;
  padding: 38px 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
}

/* 背景科技纹理与微光 */
.zg-modal-left::before {
  content: "";
  position: absolute;
  top: -80px;
  left: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.zg-modal-left::after {
  content: "</>";
  position: absolute;
  right: -20px;
  bottom: -30px;
  font-size: 130px;
  font-family: monospace;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.05);
  pointer-events: none;
  letter-spacing: -6px;
}

.zg-left-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.zg-left-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  backdrop-filter: blur(4px);
}

.zg-left-brand-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.zg-left-slogan {
  margin-bottom: 28px;
}

.zg-left-slogan h3 {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 8px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.zg-left-slogan p {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
  line-height: 1.5;
}

.zg-feature-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.zg-feature-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

.zg-feature-icon {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.zg-feature-icon svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zg-left-footer {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 24px;
}

/* --- 5. 模态框右侧交互核心区 --- */
.zg-modal-right {
  flex: 1;
  padding: 40px 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #ffffff;
  box-sizing: border-box;
  border-top-right-radius: 18px;
  border-bottom-right-radius: 18px;
  overflow: hidden;
}

/* 右上角折角切换徽章 (Corner Ribbon Switcher) */
.zg-switch-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 64px;
  height: 64px;
  cursor: pointer;
  z-index: 25;
  transition: transform 0.2s ease;
}

.zg-switch-ribbon:hover {
  transform: scale(1.06);
}

.zg-switch-ribbon svg.ribbon-bg {
  width: 64px;
  height: 64px;
  display: block;
}

.zg-switch-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.zg-switch-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* 标题与说明 */
.zg-auth-header {
  text-align: center;
  margin-bottom: 22px;
}

.zg-auth-title {
  font-size: 23px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px;
}

.zg-auth-title .blue-keyword {
  color: #2563eb;
}

.zg-auth-subtitle {
  font-size: 12.5px;
  color: #64748b;
  margin: 0;
}

/* --- 6. 模式一：微信扫码登录界面 --- */
.zg-wechat-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.zg-qr-box {
  width: 184px;
  height: 184px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.zg-qr-box:hover {
  border-color: #2563eb;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.16);
  transform: translateY(-2px);
}

.zg-qr-image {
  width: 162px;
  height: 162px;
  display: block;
  object-fit: contain;
}

.zg-real-qr-container {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.zg-real-qr-container canvas,
.zg-real-qr-container img {
  width: 160px !important;
  height: 160px !important;
  display: block;
}

.zg-qr-status-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 10px;
  text-align: center;
  min-height: 18px;
  transition: all 0.2s ease;
}

.zg-qr-sim-hint {
  position: absolute;
  inset: auto 6px 6px 6px;
  background: rgba(30, 41, 59, 0.88);
  color: #5eead4;
  font-size: 11px;
  text-align: center;
  padding: 4px 6px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.zg-qr-box:hover .zg-qr-sim-hint {
  opacity: 1;
}

.zg-wechat-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 6px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #16a34a;
  font-size: 13px;
  font-weight: 500;
}

.zg-wechat-tag svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --- 7. 模式二：手机号快捷验证码登录界面 --- */
.zg-phone-panel {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.zg-input-group {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.zg-input-group:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.zg-input-prefix {
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  height: 38px;
  display: flex;
  align-items: center;
  user-select: none;
}

.zg-input-field {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: none;
  outline: none;
  font-size: 13.5px;
  color: #1e293b;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}

.zg-input-field::placeholder {
  color: #94a3b8;
  font-size: 13px;
}

/* 图形算术验证码小构件 */
.zg-captcha-box {
  padding: 2px 8px;
  height: 38px;
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-left: 1px solid #e2e8f0;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 1px;
}

.zg-captcha-canvas {
  width: 86px;
  height: 32px;
  cursor: pointer;
  display: block;
}

/* 获取短信验证码按钮 */
.zg-sms-btn {
  height: 38px;
  padding: 0 12px;
  background: #f8fafc;
  border: none;
  border-left: 1px solid #e2e8f0;
  color: #2563eb;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  outline: none;
}

.zg-sms-btn:hover:not(:disabled) {
  background: #eff6ff;
  color: #1d4ed8;
}

.zg-sms-btn:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  background: #f8fafc;
}

/* 快捷角色代填体验条 */
.zg-roles-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #64748b;
  margin: -2px 0 2px;
}

.zg-role-btn {
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zg-role-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}

/* 主提交按钮 */
.zg-submit-btn {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  outline: none;
  margin-top: 4px;
}

.zg-submit-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.zg-submit-btn:active {
  transform: translateY(0);
}

/* --- 8. 右下角吉祥物勋章 (Corner Mascot) --- */
.zg-corner-mascot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 96px;
  height: 84px;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.zg-corner-mascot svg {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 90px;
  height: 80px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

/* --- 9. 模态框底部协议声明 --- */
.zg-modal-agreement {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 18px;
  text-align: center;
  position: relative;
  z-index: 15;
}

.zg-modal-agreement a {
  color: #2563eb;
  text-decoration: none;
  margin: 0 2px;
  transition: color 0.15s ease;
}

.zg-modal-agreement a:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

/* --- 10. 浮层轻提示 (Toast Notification) --- */
.zg-toast-box {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.zg-toast-box.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.zg-toast-box.is-success {
  border-color: rgba(34, 197, 94, 0.4);
}

.zg-toast-box.is-success svg {
  color: #4ade80;
}

.zg-toast-box.is-info svg {
  color: #38bdf8;
}

.zg-toast-box.is-warn svg {
  color: #facc15;
}

/* --- 11. 移动端自适应 (Responsive) --- */
@media (max-width: 768px) {
  .zg-modal-card {
    flex-direction: column;
    width: 92vw;
    min-height: auto;
    border-radius: 16px;
  }

  /* 移动端海报缩略为顶部紧凑横幅 */
  .zg-modal-left {
    flex: none;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom-left-radius: 0;
  }

  .zg-modal-right {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    border-top-right-radius: 0;
  }

  .zg-modal-close {
    top: -40px;
    right: 4px;
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
  }

  .zg-left-brand {
    margin-bottom: 8px;
  }

  .zg-left-slogan h3 {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .zg-left-slogan p {
    font-size: 11.5px;
  }

  .zg-feature-list,
  .zg-left-footer {
    display: none; /* 移动端隐藏较长特性列表以保留视口高度 */
  }

  .zg-modal-right {
    padding: 28px 20px 20px;
  }

  .zg-auth-title {
    font-size: 19px;
  }

  .zg-qr-box {
    width: 160px;
    height: 160px;
  }

  .zg-qr-image {
    width: 140px;
    height: 140px;
  }

  .zg-corner-mascot {
    display: none; /* 移动端空间有限，隐藏角落装饰 */
  }

  /* 移动端菜单登录按钮高亮 */
  .zg-mnav-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin: 4px 0;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.25);
    color: #38bdf8 !important;
    font-weight: 700;
  }
}

/* --- 10. 页面层级与成长通知避让增强 --- */
header.nav {
  z-index: 1000 !important;
}

.zgq-toasts {
  top: 76px !important;
  z-index: 999 !important;
}

