/* ════════════════════════════════════════════════════════════
   CSI MaaS 登录 / 注册
   ≥1024px：设计稿画布 1672×941，contain 适配 + 右对齐垂直居中
           （画布完整缩入视口，卡片永不裁切、与导航条保持安全距离）
   <1024px：流式响应式（卡片自适应居中，页面可滚动）
   顶部导航：全站统一 Header（shared/components.css）
   ════════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: #E9E9EC;
  font-family: var(--f-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 背景层：月面基地（全尺寸 fixed 铺满，右锚定与画布层一致） ── */
.stage {
  position: fixed; inset: 0; z-index: 0;
  background: url("assets/bg-scene.jpg") right center / cover no-repeat;
  pointer-events: none;
}

.site-header { z-index: var(--z-header); }

/* ══════════════════════════════════════════════════════════
   画布模式（≥1280px）：旧版 1672×941 像素级复刻
   ══════════════════════════════════════════════════════════ */
@media (min-width:1024px){
  html, body { overflow: hidden; }

  /* 品牌层：1672×941 画布坐标系（JS 平移 + 缩放） */
  .hero {
    position: fixed; left: 0; top: 0; z-index: 1;
    width: 1672px; height: 941px;
    transform-origin: left top;
    pointer-events: none;
  }
  .hero-title {
    position: absolute;
    left: 94px; top: 224px;
    font-size: 44px; font-weight: 700;
    line-height: 60px;
    letter-spacing: 0;
    word-spacing: 2px;
    color: #212834;
    white-space: nowrap;
    text-shadow: 0 0 18px rgba(255,255,255,.45), 0 1px 3px rgba(255,255,255,.35);
    transform: scaleX(0.955);
    transform-origin: left top;
  }
  .hero-title .kimi {
    display: inline-block;
    position: relative;
    top: -4px;
    font-style: normal;
    font-size: 42px; font-weight: 700;
    letter-spacing: 1.3px;
    transform: scaleX(1.047);
    transform-origin: left center;
    background: linear-gradient(180deg, var(--gold-300) 0%, var(--gold-500) 55%, var(--gold-600) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  .hero-bar {
    position: absolute;
    left: 94px; top: 369px;
    width: 35px; height: 2px;
    background: var(--gold-400);
  }
  .hero-desc {
    position: absolute;
    left: 94px; top: 393px;
    font-size: 16px; font-weight: 400;
    line-height: 28px;
    letter-spacing: 0.3px;
    color: #5E626C;
    white-space: nowrap;
    text-shadow: 0 0 12px rgba(255,255,255,.5), 0 1px 2px rgba(255,255,255,.4);
  }

  /* 登录卡片（画布坐标 1019,127 555×620，JS 平移 + 缩放） */
  .card {
    position: fixed;
    left: 1019px; top: 127px; z-index: 2;
    width: 555px; height: 620px;
    transform-origin: left top;
    border-radius: 20px;
    background: rgba(252, 252, 253, 0.78);
    -webkit-backdrop-filter: blur(22px) saturate(1.05);
    backdrop-filter: blur(22px) saturate(1.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 18px 50px rgba(35, 45, 65, 0.10), 0 2px 10px rgba(35, 45, 65, 0.04);
  }
  .card-reg { height: 719px; }

  .card-title {
    position: absolute; left: 0; top: 70px; width: 100%;
    text-align: center; font-size: 33px; font-weight: 600;
    letter-spacing: 0.5px; color: #262C38; line-height: 40px;
  }
  .card-sub {
    position: absolute; left: 0; top: 130px; width: 100%;
    text-align: center; font-size: 15px; font-weight: 400;
    color: #6E7380; line-height: 22px;
  }
  .card-sub a { color: var(--gold-600); text-decoration: none; margin-left: 6px; }
  .card-sub a:hover { color: var(--gold-700); text-decoration: underline; text-underline-offset: 2px; }
  .card-bar { position: absolute; left: 264px; top: 164px; width: 27px; height: 2px; background: var(--gold-400); }

  .card-form { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }

  .field {
    position: absolute; left: 56px;
    width: 443px; height: 48px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid #E6E6EA;
    transition: border-color .2s, box-shadow .2s;
  }
  .card-form .field:nth-child(1) { top: 224px; }
  .card-form .field:nth-child(2) { top: 316px; }
  .field:focus-within {
    border-color: var(--gold-400);
    box-shadow: 0 0 0 3px rgba(166, 124, 74, 0.12);
  }
  .field input {
    width: 100%; height: 100%;
    border: none; outline: none; background: transparent;
    padding: 0 52px 0 16px;
    font-size: 14.5px; color: #262C38; font-family: inherit;
  }
  .field input::placeholder { color: #9B9DA3; }
  .f-icon { position: absolute; width: 16px; height: 16px; color: #82858F; pointer-events: none; }
  .f-icon-user { right: 21px; top: 16px; }
  .f-icon-lock { right: 65px; top: 16px; width: 14px; }
  .f-icon-eye  { right: 21px; top: 16px; pointer-events: auto; cursor: pointer; background: none; border: none; padding: 0; }
  .f-icon-eye:hover { color: #4E525C; }

  .agree { position: absolute; left: 0; top: 396px; width: 100%; height: 22px; }
  .cbx {
    position: absolute; left: 57px; top: 4px;
    width: 16px; height: 16px;
    border: 1.5px solid #CDCED2; border-radius: 4px;
    background: rgba(255,255,255,0.3);
    cursor: pointer; transition: all .15s;
  }
  .cbx.checked { background: var(--gold-500); border-color: var(--gold-500); }
  .cbx.checked::after {
    content: ""; position: absolute; left: 4.5px; top: 1.5px;
    width: 4px; height: 8px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .agree-text {
    position: absolute; left: 79px; top: 2px;
    font-size: 13px; color: #83868F; line-height: 18px;
    letter-spacing: 0.2px; white-space: nowrap;
  }
  .agree-text a { color: var(--gold-600); text-decoration: none; }
  .agree-text a:hover { color: var(--gold-700); text-decoration: underline; text-underline-offset: 2px; }
  .agree-text i { font-style: normal; color: #7A7A82; }
  .forgot {
    position: absolute; right: 58px; top: 2px;
    font-size: 13px; color: #85878F; line-height: 18px;
    text-decoration: none; white-space: nowrap;
  }
  .forgot:hover { color: var(--gold-600); }

  .btn-login {
    position: absolute; left: 56px; top: 446px;
    width: 443px; height: 56px;
    border: none; border-radius: 8px;
    background: linear-gradient(180deg, #242B34 0%, #151B23 100%);
    color: #FFFFFF; font-size: 18px; font-weight: 500;
    letter-spacing: 1px; font-family: inherit;
    cursor: pointer; transition: filter .2s;
    overflow: visible;
  }
  .btn-login:hover { filter: brightness(1.12); }
  .btn-login::after {
    content: ""; position: absolute; right: 10px; bottom: -2px;
    width: 120px; height: 16px;
    background: radial-gradient(ellipse at center, rgba(216,178,115,0.45) 0%, rgba(216,178,115,0) 70%);
    filter: blur(6px); pointer-events: none;
  }

  .reg-hint {
    position: absolute; left: 0; top: 534px; width: 100%;
    text-align: center; font-size: 14px; color: #83868F; line-height: 26px;
  }
  .reg-hint .btn-reg {
    display: inline-block; margin-left: 12px; padding: 0 15px; height: 26px;
    line-height: 24px;
    border: 1px solid var(--gold-300); border-radius: 13px;
    color: var(--gold-600); font-size: 13px; text-decoration: none;
    vertical-align: middle;
    transition: background .2s, color .2s;
  }
  .reg-hint .btn-reg:hover { background: var(--gold-500); border-color: var(--gold-500); color: #FFFFFF; }

  /* 注册页标题区 */
  .reg-title {
    position: absolute; left: 0; top: 34px; width: 100%;
    text-align: center; font-size: 30px; font-weight: 600;
    letter-spacing: 0.5px; color: #262C38; line-height: 38px;
  }
  .reg-sub {
    position: absolute; left: 0; top: 86px; width: 100%;
    text-align: center; font-size: 14px; color: #6E7380; line-height: 22px;
  }
  .reg-sub a { color: var(--gold-600); text-decoration: none; margin-left: 6px; }
  .reg-sub a:hover { text-decoration: underline; text-underline-offset: 2px; }
  .reg-bar { position: absolute; left: 264px; top: 121px; width: 27px; height: 2px; background: var(--gold-400); }

  /* 注册页字段（绝对坐标） */
  .reg-field { position: absolute; left: 56px; width: 443px; }
  .rf-1 { top: 146px; }
  .rf-2 { top: 230px; }
  .rf-3 { top: 314px; }
  .rf-4 { top: 398px; }
  .rf-5 { top: 482px; }
  .rf-label {
    display: block; font-size: 13px; font-weight: 500;
    color: #4E525C; line-height: 20px; margin-bottom: 6px;
  }
  .rf-note { color: #9E9FA4; font-weight: 400; }
  .rf-box {
    position: relative; width: 443px; height: 44px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid #E6E6EA;
    transition: border-color .2s, box-shadow .2s;
  }
  .rf-box:focus-within {
    border-color: var(--gold-400);
    box-shadow: 0 0 0 3px rgba(166, 124, 74, 0.12);
  }
  .rf-box input {
    width: 100%; height: 100%;
    border: none; outline: none; background: transparent;
    padding: 0 46px 0 16px;
    font-size: 14.5px; color: #262C38; font-family: inherit;
  }
  .rf-box input::placeholder { color: #9B9DA3; }
  .rf-icon {
    position: absolute; right: 16px; top: 14px;
    width: 16px; height: 16px; color: #82858F; pointer-events: none;
  }
  .rf-eye {
    position: absolute; right: 12px; top: 10px;
    width: 24px; height: 24px; padding: 4px;
    border: none; background: none; color: #82858F;
    cursor: pointer; box-sizing: border-box;
  }
  .rf-eye:hover { color: #4E525C; }
  .rf-err {
    position: absolute; left: 2px; top: 72px;
    font-size: 11px; color: #D0564B; line-height: 14px;
    display: none;
  }
  .reg-field.invalid .rf-err { display: block; }
  .reg-field.invalid .rf-box { border-color: #D98A80; }
  .code-row { position: relative; height: 44px; }
  .code-row .rf-box { position: absolute; left: 0; top: 0; width: 268px; }
  .btn-code {
    position: absolute; right: 0; top: 0;
    width: 161px; height: 44px;
    border-radius: 7px; border: 1px solid #D8D8DC;
    background: rgba(255, 255, 255, 0.45);
    color: #4E525C; font-size: 14px; font-family: inherit;
    cursor: pointer; transition: background .2s, color .2s;
    white-space: nowrap;
  }
  .btn-code:hover:not(:disabled) { background: rgba(255, 255, 255, 0.75); }
  .btn-code:disabled { color: #A8AAB0; background: rgba(255, 255, 255, 0.3); cursor: not-allowed; }
  .card-reg .agree { top: 568px; }
  .card-reg .btn-login { top: 610px; }

  /* 画布页脚（底部磨砂） */
  .footer {
    position: fixed; left: 0; bottom: 0; z-index: 40;
    width: 100%;
    display: flex; justify-content: center;
    pointer-events: none;
  }
  .footer a { pointer-events: auto; }
  .footer-scale {
    position: relative;
    width: 1672px; height: 73px;
    transform-origin: bottom center;
  }
  .footer-copy {
    position: absolute; left: 50%; top: 7px;
    transform: translateX(-50%);
    text-align: center; white-space: nowrap;
  }
  .footer-frost {
    position: absolute; left: 50%; top: 24px;
    width: 560px; height: 78px;
    transform: translate(-50%, -50%);
    background: rgba(252, 252, 253, 0.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.03);
    backdrop-filter: blur(16px) saturate(1.03);
    -webkit-mask-image: radial-gradient(farthest-side, #000 48%, transparent 78%);
    mask-image: radial-gradient(farthest-side, #000 48%, transparent 78%);
  }
  .footer-copy .ft-l1 { position: relative; font-size: 13px; line-height: 24px; letter-spacing: 0.4px; color: #6E7180; }
  .footer-copy .ft-l2 { position: relative; font-size: 12px; line-height: 24px; letter-spacing: 0.4px; color: #787982; }
  .footer-copy a { color: inherit; text-decoration: none; }
  .footer-copy a:hover { color: var(--gold-600); }

  .flow-footer { display: none; }
}

/* ══════════════════════════════════════════════════════════
   流式模式（<1280px）：品牌区隐藏，卡片自适应居中，页面可滚动
   ══════════════════════════════════════════════════════════ */
@media (max-width:1023px){
  /* 移动端：竖版月面 hero（login1.png）铺满底层 */
  .stage{ background:url("login1.png") center top / cover no-repeat; }
  main {
    position: relative; z-index: 1;
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center;
    padding: calc(var(--header-h) + 32px) 20px 32px;
  }
  .hero { display: none; }
  .card {
    position: relative;
    width: 100%; max-width: 480px; height: auto;
    padding: 36px 28px 32px;
    border-radius: 20px;
    background: rgba(252, 252, 253, 0.82);
    -webkit-backdrop-filter: blur(22px) saturate(1.05);
    backdrop-filter: blur(22px) saturate(1.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 18px 50px rgba(35, 45, 65, 0.10), 0 2px 10px rgba(35, 45, 65, 0.04);
  }
  .card-reg { height: auto; }
  .card-title, .reg-title { font-size: 26px; font-weight: 600; text-align: center; color: #262C38; line-height: 1.35; letter-spacing: 0.5px; }
  .card-sub, .reg-sub { margin-top: 8px; text-align: center; font-size: 14px; color: #6E7380; }
  .card-sub a, .reg-sub a { color: var(--gold-600); text-decoration: none; margin-left: 6px; }
  .card-bar, .reg-bar { width: 27px; height: 2px; margin: 16px auto 0; background: var(--gold-400); }
  .card-form { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
  .field, .rf-box {
    position: relative;
    width: 100%; height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid #E6E6EA;
    transition: border-color .2s, box-shadow .2s;
  }
  .field:focus-within, .rf-box:focus-within {
    border-color: var(--gold-400);
    box-shadow: 0 0 0 3px rgba(166, 124, 74, 0.12);
  }
  .field input, .rf-box input {
    width: 100%; height: 100%;
    border: none; outline: none; background: transparent;
    padding: 0 48px 0 16px;
    font-size: 16px; color: #262C38; font-family: inherit;
  }
  .field input::placeholder, .rf-box input::placeholder { color: #9B9DA3; }
  .f-icon, .rf-icon {
    position: absolute; right: 16px; top: 50%; margin-top: -8px;
    width: 16px; height: 16px; color: #82858F; pointer-events: none;
  }
  .f-icon-lock { right: 52px; }
  .f-icon-eye, .rf-eye {
    position: absolute; right: 10px; top: 50%; margin-top: -14px;
    width: 28px; height: 28px; padding: 6px;
    border: none; background: none; color: #82858F;
    cursor: pointer; box-sizing: border-box;
    /* 必须显式恢复可点击：上方媒体查询内的 .f-icon 与桌面段 .f-icon-eye
       特异性相同且位置更靠后，会把眼睛按钮的 pointer-events 压成 none，
       导致移动端点按穿透到输入框、切换失效。 */
    pointer-events: auto;
  }
  .f-icon-eye:hover, .rf-eye:hover { color: #4E525C; }
  .reg-field { position: relative; }
  .rf-label {
    display: block; font-size: 13px; font-weight: 500;
    color: #4E525C; line-height: 20px; margin-bottom: 6px;
  }
  .rf-note { color: #9E9FA4; font-weight: 400; }
  .rf-err { display: none; margin-top: 6px; font-size: 11px; color: #D0564B; line-height: 14px; }
  .reg-field.invalid .rf-err { display: block; }
  .reg-field.invalid .rf-box { border-color: #D98A80; }
  .code-row { display: flex; gap: 12px; }
  .code-row .rf-box { flex: 1; }
  .btn-code {
    flex: none; width: 116px; height: 48px;
    border-radius: 8px; border: 1px solid #D8D8DC;
    background: rgba(255, 255, 255, 0.45);
    color: #4E525C; font-size: 14px; font-family: inherit;
    cursor: pointer; white-space: nowrap;
  }
  .btn-code:disabled { color: #A8AAB0; background: rgba(255, 255, 255, 0.3); cursor: not-allowed; }
  .agree { display: flex; align-items: center; font-size: 13px; color: #83868F; line-height: 18px; }
  .cbx {
    flex: none;
    width: 16px; height: 16px;
    border: 1.5px solid #CDCED2; border-radius: 4px;
    background: rgba(255,255,255,0.3);
    cursor: pointer; transition: all .15s;
    position: relative;
  }
  .cbx.checked { background: var(--gold-500); border-color: var(--gold-500); }
  .cbx.checked::after {
    content: ""; position: absolute; left: 4.5px; top: 1.5px;
    width: 4px; height: 8px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .agree-text { margin-left: 10px; }
  .agree-text a { color: var(--gold-600); text-decoration: none; }
  .agree-text i { font-style: normal; color: #7A7A82; }
  .forgot { margin-left: auto; color: #85878F; text-decoration: none; }
  .forgot:hover { color: var(--gold-600); }
  .btn-login {
    position: relative;
    width: 100%; height: 52px;
    border: none; border-radius: 8px;
    background: linear-gradient(180deg, #242B34 0%, #151B23 100%);
    color: #FFFFFF; font-size: 16px; font-weight: 500;
    letter-spacing: 1px; font-family: inherit;
    cursor: pointer; transition: filter .2s;
    overflow: visible;
  }
  .btn-login:hover { filter: brightness(1.12); }
  .btn-login::after {
    content: ""; position: absolute; right: 10px; bottom: -2px;
    width: 120px; height: 16px;
    background: radial-gradient(ellipse at center, rgba(216,178,115,0.45) 0%, rgba(216,178,115,0) 70%);
    filter: blur(6px); pointer-events: none;
  }
  .reg-hint { text-align: center; font-size: 14px; color: #83868F; }
  .reg-hint .btn-reg {
    display: inline-block; margin-left: 12px; padding: 0 15px; height: 26px;
    line-height: 24px;
    border: 1px solid var(--gold-300); border-radius: 13px;
    color: var(--gold-600); font-size: 13px; text-decoration: none;
    vertical-align: middle;
  }
  .footer { display: none; }
  .flow-footer {
    display: block;
    position: relative; z-index: 1;
    margin-top: auto; padding: 24px 0 max(8px, env(safe-area-inset-bottom));
    text-align: center;
    font-size: 12px; line-height: 1.9; color: #787982;
  }
  .flow-footer a { color: inherit; text-decoration: none; }
}
@media (min-width:1024px){ .flow-footer { display: none; } }

/* 提交按钮加载态（两种模式共用） */
.btn-login.is-loading { pointer-events: none; }
.btn-login.is-loading::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold-300), var(--gold-500));
  transform-origin: left;
  animation: loginload 1.2s cubic-bezier(.2,.6,.2,1) infinite;
}
@keyframes loginload {
  0% { transform: scaleX(0); transform-origin: left; }
  49% { transform: scaleX(1); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* 轻提示 Toast（两种模式共用） */
.toast {
  position: fixed; left: 50%; top: 24px; z-index: var(--z-toast);
  transform: translate(-50%, -8px);
  background: rgba(30, 36, 46, 0.92);
  color: #FFFFFF; font-size: 13px; line-height: 20px;
  padding: 9px 18px; border-radius: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
