/* ============================================================
   login.css · 登录页（PC 两栏 / 手机单列）
   - 依赖 src/css/style.css 的设计变量与背景层、online.css 的通用组件
   - 只写登录页专属布局与装饰，不改动 style.css 既有规则
   - 视觉语言：深海蓝 + 四时天空 + 61 号楼 + 液态玻璃 + 折角装饰
   ============================================================ */

/* ---------- 页面骨架：视口满高、纵向不溢出 ---------- */
body.auth-page {
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--paper);
}
@supports not (height: 100dvh) {
  body.auth-page { min-height: 100vh; }
}

.auth-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---------- 顶部 hero：时段问候语 + 天气 / 玻璃切换 ---------- */
.auth-page .hero.auth-hero {
  flex: none;
  padding-top: 26px;
  padding-bottom: 4px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  overflow: hidden;
  border-radius: 0;
}
.auth-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1020px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 24px;
  flex-wrap: wrap;
}
.auth-hero-text { min-width: 0; }
.auth-switches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 16px;
}
.auth-switches .wx-switch {
  margin-top: 0;
  flex-wrap: wrap;
}
.auth-switches .wx-label { letter-spacing: 0.05em; }

/* ---------- 主体：卡片垂直居中 ---------- */
main.auth-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: 10px;
  padding-bottom: 20px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-grid {
  width: 100%;
  max-width: 1020px;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/* ============================================================
   左栏：品牌叙事（桌面两栏时显示）
   - 外层为轻量液态玻璃叙事板：副文案与提示行压在楼图/飞檐高对比
     纹理上时仍保持可读，视觉与右侧登录卡同一套玻璃语言
   ============================================================ */
.auth-brand {
  display: none;
  position: relative;
  min-width: 0;
  padding: 26px 28px 24px;
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(252, 249, 243, 0.76), rgba(246, 240, 229, 0.62));
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(232, 180, 119, 0.28);
  box-shadow: 0 12px 30px rgba(26, 18, 6, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 180, 119, 0.42);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(26, 18, 6, 0.1);
}
.auth-badge .brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sky), var(--leaf));
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  flex: none;
}
.auth-title {
  margin-top: 20px;
  font-size: clamp(30px, 3.1vw, 42px);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: 0.01em;
  color: #0f2438;
}
.auth-lede {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.9;
  color: rgba(16, 28, 46, 0.72);
}
.auth-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.auth-metric {
  flex: 1 1 96px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(232, 180, 119, 0.32);
  box-shadow: 0 4px 12px rgba(26, 18, 6, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.auth-metric b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  color: #101c2e;
  font-variant-numeric: tabular-nums;
}
.auth-metric span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(16, 28, 46, 0.6);
}
.auth-brand-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(16, 28, 46, 0.72);
}
.auth-brand-note .online-dot {
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.18);
}

/* ============================================================
   右栏：登录卡片（液态玻璃 + 折角）
   ============================================================ */
.auth-card {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  min-width: 0;
  margin-inline: auto;
  padding: 26px 24px 20px;
  border-radius: var(--radius);
  isolation: isolate;
}

/* 折角装饰：右上角折起的琥珀色纸角 */
.auth-fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 1;
}
.auth-fold::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 52px solid rgba(244, 168, 61, 0.92);
  border-left: 52px solid transparent;
  filter: drop-shadow(-2px 2px 4px rgba(26, 18, 6, 0.18));
}
.auth-fold::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 52px solid rgba(255, 255, 255, 0.16);
  border-left: 52px solid transparent;
}

.auth-card-head { text-align: center; }
.auth-logo {
  width: 48px;
  height: 48px;
  margin: 2px auto 12px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--sky) 0%, var(--leaf) 100%);
  box-shadow: 0 8px 20px rgba(42, 157, 143, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.auth-card-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.auth-card-sub {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

/* ---------- 表单 ---------- */
#loginForm { margin-top: 18px; }
.auth-card .ov-field { margin-top: 14px; }
.auth-card .ov-field:first-of-type { margin-top: 0; }
.auth-card .ov-input { min-height: 46px; }
.auth-card .ov-input[aria-invalid="true"] {
  border-color: var(--vermilion);
  box-shadow: 0 0 0 3px rgba(231, 111, 81, 0.13);
}

.auth-pw-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}
.auth-pw-toggle:hover { color: var(--ink-2); background: rgba(90, 169, 230, 0.1); }
.auth-pw-toggle:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
.auth-pw-toggle .eye-off { display: none; }
.auth-pw-toggle.on .eye { display: none; }
.auth-pw-toggle.on .eye-off { display: block; }
.auth-pw-toggle.on { color: var(--sky); }

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.auth-remember input {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--leaf);
  cursor: pointer;
}
.auth-remember em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
}
.auth-hint {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* 错误提示区：默认不占位，显示时展开（role=alert / aria-live=polite） */
.auth-card .auth-error {
  display: none;
  min-height: 0;
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(231, 111, 81, 0.1);
  border: 1px solid rgba(231, 111, 81, 0.32);
  color: #b5502f;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.auth-card .auth-error.show { display: block; }

/* 登录按钮：主操作，含加载态 */
.auth-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #2aa794 0%, #1f7a6e 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(42, 157, 143, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, filter 0.22s ease;
}
.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(42, 157, 143, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.auth-submit:active:not(:disabled) { transform: translateY(0) scale(0.995); }
.auth-submit:focus-visible { outline: 2px solid var(--ginkgo); outline-offset: 2px; }
.auth-submit:disabled {
  cursor: progress;
  filter: saturate(0.7) brightness(0.96);
}
.auth-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: auth-spin 0.7s linear infinite;
  flex: none;
}
.auth-submit.loading .auth-spinner { display: inline-block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ---------- 演示账号提示 ---------- */
.auth-demo {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(30, 58, 82, 0.16);
}
.auth-demo-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}
.auth-demo-title .online-dot { width: 6px; height: 6px; }
.auth-demo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.auth-demo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid rgba(232, 180, 119, 0.34);
  background: rgba(255, 255, 255, 0.32);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.auth-demo-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(232, 180, 119, 0.6);
}
.auth-demo-item:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
.auth-demo-role {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(47, 122, 92, 0.14);
  color: var(--leaf-deep);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.auth-demo-item b {
  color: var(--ink);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.auth-demo-pass {
  color: var(--ink-3);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-demo-fill {
  flex: none;
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(244, 168, 61, 0.45);
  color: var(--ginkgo-deep);
  font-size: 10px;
  font-weight: 800;
}
.auth-card-foot {
  margin-top: 14px;
  padding-inline: 2px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  opacity: 0.82;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- 页脚（页面级） ---------- */
.auth-footer {
  position: relative;
  z-index: 2;
  flex: none;
  padding-top: 8px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  text-align: center;
  font-size: 11px;
  line-height: 1.9;
  /* 页脚区域始终叠在底部楼图上：白色 + 深色投影，浅色/深色玻璃下都可读 */
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(10, 18, 30, 0.55), 0 1px 14px rgba(10, 18, 30, 0.35);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.auth-footer p { max-width: 100%; }
.auth-footer-dim { font-size: 10.5px; color: rgba(255, 255, 255, 0.72); }

/* ============================================================
   夜间液态玻璃：与 style.css 的 body.night .card 变量组保持一致
   ============================================================ */
body.night .auth-card {
  --ink: #f2efe9;
  --ink-2: rgba(242, 239, 233, 0.64);
  --ink-3: rgba(242, 239, 233, 0.44);
  --paper: rgba(255, 255, 255, 0.07);
  --leaf-deep: #8fd0b3;
  --ginkgo-deep: #e8b477;
  --sky: #9fd8f2;
  --vermilion: #e8907a;
  color: var(--ink);
}
body.night .auth-badge {
  background: rgba(8, 13, 22, 0.5);
  border-color: rgba(236, 246, 255, 0.14);
  color: #fdf6e9;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
body.night .auth-brand {
  background: linear-gradient(165deg, rgba(8, 13, 22, 0.68), rgba(4, 7, 13, 0.6));
  border-color: rgba(236, 246, 255, 0.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
body.night .auth-title { color: #fdf6e9; }
body.night .auth-lede { color: rgba(253, 246, 233, 0.74); }
body.night .auth-brand-note { color: rgba(253, 246, 233, 0.66); }
body.night .auth-metric {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(236, 246, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body.night .auth-metric b { color: #f2efe9; }
body.night .auth-metric span { color: rgba(242, 239, 233, 0.6); }
body.night .auth-demo { border-top-color: rgba(236, 246, 255, 0.14); }
body.night .auth-demo-item {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(236, 246, 255, 0.14);
  color: rgba(242, 239, 233, 0.7);
}
body.night .auth-demo-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(232, 180, 119, 0.4);
}
body.night .auth-demo-item b { color: #f2efe9; }
body.night .auth-demo-pass { color: rgba(242, 239, 233, 0.46); }
body.night .auth-demo-role {
  background: rgba(143, 208, 179, 0.16);
  color: #8fd0b3;
}
body.night .auth-demo-fill { color: #e8b477; border-color: rgba(232, 180, 119, 0.4); }
body.night .auth-card .auth-error {
  background: rgba(231, 111, 81, 0.16);
  border-color: rgba(231, 111, 81, 0.3);
  color: #f3b7a5;
}
body.night .auth-footer { color: rgba(253, 246, 233, 0.88); }
body.night .auth-footer-dim { color: rgba(253, 246, 233, 0.66); }

/* ============================================================
   响应式：720–1024 单列加宽；≥1024 两栏；<720 手机单列
   ============================================================ */
@media (min-width: 720px) {
  .auth-page .hero.auth-hero {
    padding-top: 30px;
    padding-bottom: 4px;
    padding-left: max(24px, env(safe-area-inset-left, 0px));
    padding-right: max(24px, env(safe-area-inset-right, 0px));
  }
  main.auth-main {
    padding-top: 16px;
    padding-bottom: 24px;
    padding-left: max(24px, env(safe-area-inset-left, 0px));
    padding-right: max(24px, env(safe-area-inset-right, 0px));
  }
  .auth-card { max-width: 420px; }
}

@media (min-width: 1024px) {
  .auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 56px;
    align-items: center;
  }
  .auth-brand { display: block; }
  .auth-card { max-width: none; padding: 30px 30px 24px; }
  main.auth-main { padding-top: 12px; padding-bottom: 24px; }
}

/* ---------- 手机单列 ---------- */
@media (max-width: 719px) {
  .auth-page .hero.auth-hero {
    padding-top: 18px;
    padding-bottom: 2px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .auth-hero-inner { gap: 4px; }
  .auth-hero-text { width: 100%; }
  .greeting { font-size: 21px; }
  .greeting small { font-size: 11.5px; margin-top: 2px; }
  .auth-switches {
    width: 100%;
    justify-content: flex-start;
    gap: 0;
  }
  .auth-switches .wx-switch {
    margin-top: 6px;
    gap: 5px;
  }
  .auth-switches .wx-switch button {
    min-height: 44px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .auth-switches .wx-label { font-size: 10px; }

  main.auth-main {
    padding-top: 12px;
    padding-bottom: 14px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    justify-content: flex-start;
  }
  .auth-grid { gap: 18px; }
  .auth-card { width: 100%; max-width: 100%; padding: 20px; }
  #loginForm { margin-top: 16px; }
  .auth-card .ov-input {
    font-size: 16px;
    min-height: 48px;
    padding: 12px 14px;
  }
  .auth-card .ov-input.has-toggle { padding-right: 52px; }
  .auth-card .auth-pw-toggle { width: 44px; height: 44px; right: 2px; }
  .auth-remember { min-height: 44px; }
  .auth-demo-item { min-height: 44px; }
  .auth-card-foot { margin-top: 12px; font-size: 10px; }
  .auth-footer {
    padding-top: 6px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    font-size: 10.5px;
  }
  .auth-footer-dim { font-size: 10px; }
}

/* 超窄屏：演示账号行允许换行，避免密码被挤压 */
@media (max-width: 380px) {
  .auth-demo-item { flex-wrap: wrap; row-gap: 2px; }
  .auth-demo-fill { margin-left: 0; }
}

/* ---------- 动效弱化 ---------- */
@media (prefers-reduced-motion: reduce) {
  .auth-spinner { animation: none; }
  .auth-submit,
  .auth-demo-item,
  .auth-pw-toggle { transition: none; }
}
