/* AIplain 登录/注册弹窗与免费算力登录门槛（独立于 style.css） */
.am-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.46);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.am-overlay.is-open { display: flex; }
.am-dialog {
  width: min(26.5rem, 100%);
  max-height: min(92vh, 42rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card-bg);
  color: var(--text-main);
  border-radius: var(--radius-large) var(--radius-large) 0 0;
  box-shadow: var(--shadow-card-hover);
  padding: 1.15rem 1.2rem 1.35rem;
  padding-bottom: max(1.35rem, env(safe-area-inset-bottom, 0px));
  position: relative;
}
.am-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: var(--btn-regular-bg);
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1;
}
.am-close:hover { background: var(--btn-regular-bg-hover); color: var(--text-main); }
.am-title {
  margin: 0 2rem 0.85rem 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.am-dialog .auth-tabs { margin-bottom: 0.95rem; }
.am-dialog .auth-form { margin-bottom: 0.2rem; }
.am-dialog .auth-alt { margin-top: 0.45rem; }

.am-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  line-height: 1.5;
}
.am-opt input[type="checkbox"] {
  margin: 0.2rem 0 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  flex: none;
}
.am-opt-note {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.am-opt-note a { color: var(--btn-content); text-decoration: underline; text-underline-offset: 0.12em; }
.am-opt-note a:hover { color: var(--link-hover); }

.am-btn-secondary {
  border: 0;
  cursor: pointer;
  background: var(--btn-regular-bg);
  color: var(--text-main);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
}
.am-btn-secondary:hover { background: var(--btn-regular-bg-hover); }

body.am-lock-scroll {
  overflow: hidden;
}

/* 免费算力登录门槛 */
.compute-gated { position: relative; }
.compute-gated.is-locked {
  max-height: 38rem;
  overflow: hidden;
  border-radius: var(--radius-large);
}
.compute-gated.is-locked .compute-gated-body {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  filter: blur(5px);
  opacity: 0.42;
}
.compute-gate-mask {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 6;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 1rem;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--page-bg) 20%, transparent) 0%,
    color-mix(in srgb, var(--page-bg) 72%, transparent) 38%,
    color-mix(in srgb, var(--page-bg) 92%, transparent) 100%
  );
}
.compute-gated.is-locked .compute-gate-mask { display: flex; }
.compute-gate-card {
  width: min(24rem, 100%);
  background: var(--card-bg);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-card-hover);
  padding: 1.25rem 1.2rem 1.3rem;
  text-align: center;
}
.compute-gate-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}
.compute-gate-card p {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--text-secondary);
}
.compute-gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}
.compute-gate-actions .btn-primary,
.compute-gate-actions .am-btn-secondary {
  min-width: 6.5rem;
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

@media (min-width: 640px) {
  .am-overlay {
    align-items: center;
    padding: 1.25rem;
  }
  .am-dialog {
    border-radius: var(--radius-large);
    max-height: min(88vh, 44rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .compute-gated.is-locked .compute-gated-body { filter: none; }
}
