/* 登录 / 邀请码注册页（只由 login.html 加载）
 *
 * 与 app.css 的分工：
 * - app.css 里有两条针对登录页的放行规则（html.auth-shell 的窄屏 min-width、
 *   body.auth-body 允许滚动），它们必须保留；本文件只负责登录页自己的外观。
 * - 工作台的样式一点都不能带进来：登录页是匿名访客能拿到的唯一页面。
 *
 * 2026-10-26 改版：双栏布局 + 官方 Lenscales logo + 浅蓝品牌色。
 */

:root {
  --auth-paper: #f2f6fd;
  --auth-paper-deep: #e3edfb;
  --auth-ink: #1b2a4a;
  --auth-ink-2: #4e607a;
  --auth-muted: #5f7089;
  --auth-line: #dce7f5;
  --auth-blue: #3a6fe8;
  --auth-blue-dark: #2c59ce;
}

/* 覆盖 app.css 的登录页外壳（只作用于登录页 body） */
body.auth-body {
  display: block;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--auth-paper);
  color: var(--auth-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.auth-body *,
body.auth-body *::before,
body.auth-body *::after {
  box-sizing: border-box;
}

/* ---------- 双栏骨架 ---------- */
.auth-layout {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
}

/* ---------- 左幅：品牌区 ---------- */
.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 42px 48px 34px;
  background:
    radial-gradient(760px 480px at 10% -4%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(720px 520px at 96% 104%, #dfeafb 0%, rgba(223, 234, 251, 0) 68%),
    linear-gradient(158deg, #f3f7fe 0%, #eaf1fc 56%, #e3edfb 100%);
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(58, 90, 150, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 90, 150, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(120% 90% at 15% 12%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 90% at 15% 12%, #000 0%, transparent 72%);
}

.auth-hero-watermark {
  position: absolute;
  right: -250px;
  top: 52%;
  z-index: 0;
  height: 520px;
  width: auto;
  transform: translateY(-50%) rotate(-4deg);
  opacity: 0.075;
  pointer-events: none;
  user-select: none;
}

.auth-hero > *:not(.auth-hero-watermark) {
  position: relative;
  z-index: 1;
}

.auth-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}

.auth-brand-mark {
  display: block;
  height: 44px;
  width: auto;
  flex-shrink: 0;
}

.auth-brand-type {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.auth-brand-word {
  display: block;
  height: 17px;
  width: auto;
}

.auth-brand-type small {
  display: block;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  color: var(--auth-muted);
}

.auth-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(58, 90, 150, 0.18);
  background: rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: #5b6c85;
  white-space: nowrap;
}

.auth-hero-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1f7a50;
}

.auth-hero-center {
  max-width: 470px;
  padding: 10px 0;
  margin: auto 0;
}

.auth-eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 2.6px;
  color: var(--auth-muted);
}

.auth-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: #a9bedc;
}

.auth-hero h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.44;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: #182840;
}

.auth-hero h1 em {
  font-style: normal;
  color: var(--auth-blue);
}

.auth-desc {
  margin: 18px 0 0;
  max-width: 420px;
  color: var(--auth-ink-2);
  font-size: 14.5px;
  line-height: 1.95;
}

.auth-account-note {
  margin: 24px 0 0;
  max-width: 460px;
  padding-left: 13px;
  border-left: 2px solid rgba(58, 111, 232, 0.45);
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--auth-muted);
}

.auth-account-note strong {
  margin-right: 8px;
  color: #22334b;
  font-weight: 650;
}

.auth-version {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(58, 90, 150, 0.14);
  font-size: 10.5px;
  letter-spacing: 0.6px;
  color: #556886;
}

/* ---------- 右幅：表单区 ---------- */
.auth-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #ffffff;
}

.auth-main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(560px 380px at 50% 0%, rgba(58, 111, 232, 0.06) 0%, rgba(58, 111, 232, 0) 70%);
}

.auth-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

.auth-card {
  width: 100%;
  margin: 0;
  padding: 26px 30px 24px;
  border: 1px solid #e2eaf7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 64px -40px rgba(23, 44, 82, 0.22), 0 2px 5px rgba(23, 44, 82, 0.05);
}

/* 两张表单叠在同一个网格格里：切换时只切透明度可见性，卡片高度固定，
   标签页、卡片外说明和左侧品牌区都不会跳动。 */
.auth-form-stack {
  display: grid;
}

.auth-form {
  grid-area: 1 / 1;
  min-width: 0;
  align-self: center;
  transition: opacity 180ms ease;
}

.auth-form:not(.is-active) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-form.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 登录 / 邀请码注册 切换 */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border-radius: 11px;
  background: #edf2fa;
}

.auth-tab {
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5b6c85;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 160ms, color 160ms, box-shadow 160ms;
}

.auth-tab:hover {
  color: #32456a;
}

.auth-tab[aria-selected="true"] {
  background: #fff;
  color: var(--auth-ink);
  box-shadow: 0 2px 6px rgba(23, 44, 82, 0.1);
}

.auth-tab:focus-visible {
  outline: 2px solid #93b4ff;
  outline-offset: 2px;
}

/* 表单 */
.auth-form-head {
  margin-bottom: 20px;
}

.auth-form-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: var(--auth-ink);
}

.auth-form-head p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--auth-ink-2);
}

.auth-field {
  display: block;
  margin-top: 15px;
}

.auth-field:first-of-type {
  margin-top: 0;
}

.auth-field > span:first-child {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #34496b;
}

.auth-input {
  width: 100%;
  height: 46px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid #d6e1f0;
  border-radius: 9px;
  background: #fbfcfe;
  color: var(--auth-ink);
  font: inherit;
  font-size: 14px;
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
}

.auth-input::placeholder {
  color: #8c99ac;
}

.auth-input:hover {
  border-color: #c3d1e6;
}

.auth-input:focus {
  outline: none;
  border-color: var(--auth-blue);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(58, 111, 232, 0.15);
}

.auth-input-wrap {
  position: relative;
  display: block;
  margin-bottom: 0;
  font-weight: 400;
}

.auth-input-wrap .auth-input {
  padding-right: 46px;
}

.auth-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #8291a6;
  cursor: pointer;
}

.auth-toggle:hover {
  background: #eff4fb;
  color: #40557a;
}

.auth-toggle:focus-visible {
  outline: 2px solid #93b4ff;
  outline-offset: 1px;
}

.auth-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--auth-muted);
}

.auth-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid #eac4c0;
  border-radius: 8px;
  background: #fff5f4;
  color: #9b2e28;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.auth-error[hidden] {
  display: none;
}

.auth-submit {
  width: 100%;
  height: 46px;
  margin-top: 20px;
  border: 0;
  border-radius: 9px;
  background: var(--auth-blue);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 12px 24px -14px rgba(58, 111, 232, 0.95);
  transition: background 160ms, box-shadow 160ms, transform 60ms;
}

.auth-submit:hover {
  background: var(--auth-blue-dark);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-submit:focus-visible {
  outline: 3px solid #93b4ff;
  outline-offset: 2px;
}

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

.auth-submit .auth-arrow {
  transition: transform 160ms;
}

.auth-submit:hover .auth-arrow {
  transform: translateX(2px);
}

.auth-switch {
  margin: 16px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--auth-muted);
}

.auth-link {
  color: var(--auth-blue);
  font-weight: 500;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-card-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid #eaf0f9;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--auth-muted);
}

.auth-card-note strong {
  color: var(--auth-ink-2);
  font-weight: 600;
}

/* 卡片外：信任点与页脚 */
.auth-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-top: 18px;
}

.auth-trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  letter-spacing: 0.2px;
  color: var(--auth-muted);
}

.auth-trust svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  stroke: #74869f;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-icp {
  margin: 20px 0 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.9;
  color: var(--auth-muted);
}

.auth-icp a {
  color: #5b6c85;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-icp .auth-sep {
  margin: 0 8px;
  color: #c4d0e2;
}

/* ---------- 移动端 ---------- */
@media (max-width: 1024px) {
  .auth-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .auth-hero {
    flex-shrink: 0;
    padding: 24px 24px 74px;
  }

  .auth-hero-center {
    margin: 26px 0 0;
    padding: 0;
  }

  .auth-hero h1 {
    font-size: 28px;
    line-height: 1.5;
    letter-spacing: 0.8px;
  }

  .auth-desc {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.85;
  }

  .auth-eyebrow,
  .auth-account-note,
  .auth-hero-chip,
  .auth-version {
    display: none;
  }

  .auth-hero-watermark {
    height: 400px;
    right: -170px;
    top: 46%;
    opacity: 0.09;
  }

  .auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    padding: 0 18px 20px;
    background: #fff;
  }

  .auth-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: 440px;
    margin: 0 auto;
  }

  .auth-card {
    margin-top: -42px;
    padding: 24px 22px 22px;
  }

  .auth-icp {
    margin-top: auto;
    padding-top: 20px;
  }
}

@media (max-width: 420px) {
  .auth-card {
    padding: 22px 18px 20px;
  }

  .auth-form-head h2 {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-body *,
  body.auth-body *::before,
  body.auth-body *::after {
    animation: none !important;
    transition: none !important;
  }
}


/* 覆盖 app.css 里旧的登录页样式（app.css 在 auth.css 之前加载） */
.auth-card label.auth-field {
  display: grid;
  gap: 7px;
  margin: 0;
  font-size: inherit;
  color: inherit;
}

.auth-card input.auth-input {
  margin-bottom: 0;
}

.auth-card button.auth-submit {
  width: 100%;
  margin-top: 20px;
  padding: 0;
  font-size: 15px;
}

.auth-switch a {
  color: var(--auth-blue);
}

/* 页脚：app.css 的 .auth-footer 是 position:fixed，这里用独立类名，定位按普通文档流 */
.auth-icp {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  text-align: center;
}

.auth-noscript {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--auth-line);
  background: #fff8eb;
  color: #8a4e0c;
  font-size: 12.5px;
  text-align: center;
}


/* ===== 视口高度自适应：整页锁定一屏，不出现纵向滚动 ===== */
@media (min-width: 1025px) {
  .auth-layout { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .auth-hero { height: 100vh; height: 100dvh; min-height: 0; }
  .auth-main { height: 100vh; height: 100dvh; overflow: hidden; }
}

@media (min-width: 1025px) and (max-height: 820px) {
  .auth-hero { padding: 30px 48px 24px; }
  .auth-hero h1 { font-size: 38px; line-height: 1.4; }
  .auth-desc { margin-top: 14px; font-size: 14px; line-height: 1.85; }
  .auth-account-note { margin-top: 16px; }
  .auth-main { padding: 24px 40px; }
  .auth-card { padding: 22px 28px 20px; }
  .auth-tabs { margin-bottom: 16px; }
  .auth-form-head { margin-bottom: 14px; }
  .auth-field { margin-top: 11px; }
  .auth-input { height: 44px; }
  .auth-submit { height: 44px; margin-top: 16px; }
  .auth-card-note { margin-top: 12px; padding-top: 12px; }
  .auth-trust { margin-top: 14px; }
  .auth-icp { margin-top: 12px; }
}

@media (min-width: 1025px) and (max-height: 740px) {
  .auth-hero { padding: 20px 44px 18px; }
  .auth-hero h1 { font-size: 32px; line-height: 1.36; }
  .auth-desc { margin-top: 10px; font-size: 13px; }
  .auth-account-note { margin-top: 12px; font-size: 11px; }
  .auth-version { padding-top: 10px; }
  .auth-main { padding: 16px 32px; }
  .auth-card { padding: 18px 26px 16px; }
  .auth-tabs { margin-bottom: 12px; }
  .auth-form-head h2 { font-size: 20px; }
  .auth-form-head { margin-bottom: 10px; }
  .auth-field { margin-top: 9px; }
  .auth-input { height: 42px; }
  .auth-submit { height: 42px; margin-top: 12px; font-size: 14px; }
  .auth-card-note { margin-top: 10px; padding-top: 10px; font-size: 11px; }
  .auth-trust { display: none; }
  .auth-icp { margin-top: 10px; font-size: 10.5px; }
}

@media (max-width: 1024px) and (max-height: 900px) {
  .auth-hero { padding: 20px 22px 38px; }
  .auth-hero-center { margin: 16px 0 0; }
  .auth-hero h1 { font-size: 26px; line-height: 1.42; }
  .auth-desc { margin-top: 8px; font-size: 12.5px; line-height: 1.75; }
  .auth-card { margin-top: -34px; padding: 18px 18px 16px; }
  .auth-tabs { margin-bottom: 16px; }
  .auth-form-head { margin-bottom: 14px; }
  .auth-field { margin-top: 12px; }
  .auth-submit { margin-top: 16px; }
  .auth-card-note { margin-top: 12px; padding-top: 12px; }
  .auth-trust { margin-top: 14px; }
  .auth-icp { padding-top: 14px; }
}

@media (max-width: 1024px) and (max-height: 750px) {
  .auth-hero { padding-bottom: 28px; }
  .auth-hero h1 { font-size: 23px; }
  .auth-desc { display: none; }
  .auth-card { margin-top: -24px; padding: 14px 16px 14px; }
  .auth-card-note { display: none; }
  .auth-trust { display: none; }
  .auth-icp { padding-top: 10px; margin-top: 10px; }
}

@media (max-width: 1024px) and (max-height: 680px) {
  .auth-hero { padding: 14px 18px 18px; }
  .auth-hero h1 { font-size: 20px; line-height: 1.35; }
  .auth-brand-mark { height: 34px; }
  .auth-brand-word { height: 14px; }
  .auth-card { margin-top: -14px; padding: 12px 14px; }
  .auth-tabs { margin-bottom: 10px; }
  .auth-tabs { height: 38px; }
  .auth-form-head { margin-bottom: 8px; }
  .auth-form-head h2 { font-size: 19px; }
  .auth-form-head p { font-size: 11.5px; }
  .auth-field { margin-top: 8px; }
  .auth-input { height: 40px; }
  .auth-submit { height: 40px; margin-top: 10px; }
  .auth-switch { margin-top: 10px; }
}


/* 极矮手机（如 320×568）：只保留登录必需内容，仍锁一屏 */
@media (max-width: 1024px) and (max-height: 600px) {
  .auth-hero { padding: 8px 14px 10px; }
  .auth-hero-center { margin: 8px 0 0; }
  .auth-hero h1 { font-size: 18px; line-height: 1.3; }
  .auth-brand-mark { height: 30px; }
  .auth-brand-word { height: 13px; }
  .auth-brand-type small { font-size: 9.5px; }
  .auth-card { margin-top: -8px; padding: 10px 12px; }
  .auth-tabs { margin-bottom: 8px; }
  .auth-form-head { margin-bottom: 8px; }
  .auth-form-head h2 { font-size: 18px; }
  .auth-form-head p { display: none; }
  .auth-field { margin-top: 7px; }
  .auth-input { height: 38px; }
  .auth-submit { height: 38px; margin-top: 8px; }
  .auth-switch { display: none; }
  .auth-icp { display: none; }
}
