/* 登录页：车景背景 + 会员登录卡片 + 站内短信通知浮层
   参考对照站 /css/login.css，改为 px/clamp 自适应，桌面端同样可用 */

.login-scene {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #e9eef5;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #333;
}
.login-scene *,
.login-scene *::before,
.login-scene *::after { box-sizing: border-box; }
.login-scene [hidden] { display: none !important; }

/* ---------- 顶部栏 ---------- */
.login-header {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
.login-header-menu img { display: block; width: 28px; height: 28px; object-fit: contain; }
.login-header-logo { position: absolute; left: 50%; transform: translateX(-50%); }
.login-header-logo img { display: block; width: 96px; height: auto; }
.login-header-service {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #eb0a1e, #cc000e);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(235, 10, 30, .35);
  transition: transform .15s ease;
}
.login-header-service:active { transform: scale(.96); }
.login-header-service img { width: 20px; height: 20px; filter: brightness(0) invert(1); }

/* ---------- 车景背景 ---------- */
.page-login {
  position: relative;
  flex: 1 1 auto;
  min-height: calc(100vh - 60px);
  overflow: hidden;
  background: #9ec9e6;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.login-scene__background { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.login-scene__background::before {
  content: "";
  position: absolute;
  inset: -8%;
  background: url('/img/site/images/login/background-generated.webp') center bottom / cover no-repeat;
  filter: blur(30px) saturate(120%);
  opacity: .95;
}
.login-scene__background img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

/* ---------- 登录卡片 ---------- */
.member-login-card {
  position: relative;
  z-index: 2;
  width: min(90vw, 384px);
  margin: clamp(18px, 5vh, 56px) auto clamp(18px, 4vh, 40px);
  padding: 26px 0 28px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 44px rgba(8, 22, 42, .22);
}
.member-login-card h1 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  text-align: center;
  color: #1f2937;
}
.member-login-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 86%;
  height: 48px;
  margin: 14px auto 0;
  border-bottom: 1px solid #d9dde3;
  transition: border-color .2s;
}
.member-login-field > img { flex: 0 0 auto; width: 22px; height: 22px; object-fit: contain; opacity: .85; }
.member-login-field input {
  flex: 1;
  min-width: 0;
  width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: 0;
  /* 16px 是 iOS Safari 的临界值：小于它聚焦时会强制放大页面且不会自动缩回 */
  font: 16px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #333;
  box-shadow: none;
}
.member-login-field input::placeholder { color: #b8bec7; opacity: 1; }
.member-login-field:focus-within { border-bottom-color: #e70022; }
.member-login-send {
  flex: 0 0 auto;
  padding: 4px 0 4px 6px;
  border: 0;
  background: transparent;
  color: #e70022;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.member-login-send:disabled { color: #a8aeb6; cursor: default; }

.member-login-agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 86%;
  margin: 22px auto 0;
  color: #606060;
  font-size: 12px;
  line-height: 1.55;
}
.member-login-agreement input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 1px 0 0;
  padding: 0;
  border: 1.5px solid #9aa1ab;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}
.member-login-agreement input:checked {
  border-color: #e70022;
  background: #e70022 url('/img/site/images/login/checked.svg') center / 12px 12px no-repeat;
}
.member-login-agreement a { color: #e70022; text-decoration: underline; }

.member-login-reminder {
  width: 86%;
  margin: 10px auto 0;
  padding-left: 22px;
  color: #8b9199;
  font-size: 12px;
  line-height: 1.5;
}
.member-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86%;
  height: 44px;
  margin: 18px auto 0;
  border: 0;
  border-radius: 22px;
  background: #fe001b;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
}
.member-login-submit:active { transform: scale(.99); }
.member-login-submit:disabled { opacity: .6; cursor: default; }

.member-login-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1002;
  transform: translate(-50%, -50%);
  max-width: 82%;
  margin: 0;
  padding: 12px 20px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  pointer-events: none;
}

/* ---------- 站内短信通知 ---------- */
/* 顶部容器：由 JS 按 visualViewport 摆位。
   位置贴可视区顶部居中；JS 同时按 vv.scale 做 1/scale 反向缩放，
   所以双指放大时它既不会跑到屏幕外，也不会跟着变大。 */
.member-sms-layer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483647;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding-top: max(14px, env(safe-area-inset-top));
  box-sizing: border-box;
  pointer-events: none;
  transform-origin: 50% 0;
}
.member-sms-preview {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(420px, calc(100% - 32px));
  margin: 0;
  padding: 15px 16px 13px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 25px;
  background: rgba(250, 250, 252, .985);
  box-shadow: 0 12px 38px rgba(0, 0, 0, .2), 0 2px 8px rgba(0, 0, 0, .08);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  color: #161618;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  pointer-events: auto;
  cursor: pointer;
}
.member-sms-preview.on { animation: member-sms-arrive .38s cubic-bezier(.2, .8, .2, 1) both; }
.member-sms-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  margin-top: 2px;
  border-radius: 10px;
  background: linear-gradient(#62e773, #20bc42);
  color: #fff;
}
.member-sms-icon svg { width: 30px; height: 30px; }
/* 右侧留出关闭按钮的位置：× 是 absolute 定位在卡片右上角（right:8px），
   正文若铺满内宽，第一行会被 × 压住，出现「用于本×次登录」这种断字。 */
.member-sms-content { flex: 1; min-width: 0; padding-right: 22px; }
.member-sms-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  line-height: 18px;
  color: #65656b;
}
.member-sms-preview-heading strong { font-weight: 500; }
.member-sms-preview-heading > span { font-size: 11px; color: #85858b; }
.member-sms-preview p { margin: 4px 0 0; font-size: 14px; line-height: 21px; overflow-wrap: anywhere; }
.member-sms-preview p strong { font-weight: 600; letter-spacing: 1px; }
.member-sms-autofill {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(0, 0, 0, .05);
  font-size: 12px;
  line-height: 18px;
  color: #68686e;
}
.member-sms-autofill strong { margin-left: auto; color: #303038; font-size: 14px; letter-spacing: 2px; font-weight: 600; }
#smsClose {
  position: absolute;
  right: 8px;
  top: 34px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: #666;
  font-size: 20px;
  line-height: 24px;
  cursor: pointer;
}

/* ---------- 协议弹窗 ---------- */
.login-policy {
  width: min(92vw, 380px);
  padding: 24px;
  border: 0;
  border-radius: 14px;
  color: #333;
}
.login-policy::backdrop { background: rgba(0, 0, 0, .45); }
.login-policy h2 { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.login-policy p { margin: 0 0 18px; font-size: 13px; line-height: 1.8; color: #555; }
.login-policy button {
  padding: 8px 18px;
  border: 0;
  border-radius: 6px;
  background: #e70022;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

/* 从顶部滑下（原来是自下而上，浮层贴顶后改成从上往下落） */
@keyframes member-sms-arrive {
  from { opacity: 0; transform: translateY(-16px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 移动端 ---------- */
@media (max-width: 769px) {
  .login-header { height: 56px; padding: 0 12px; }
  .login-header-service { height: 32px; padding: 0 12px 0 8px; gap: 4px; font-size: 12px; }
  .login-header-service img { width: 18px; height: 18px; }
  .login-header-logo img { width: 84px; }
  .page-login { min-height: calc(100vh - 56px); }
  .login-scene__background img { object-fit: cover; object-position: center 82%; }
  .member-login-card {
    width: 88vw;
    margin-top: clamp(16px, 4vh, 40px);
    padding: 22px 0 24px;
    border-radius: 14px;
  }
  .member-login-card h1 { font-size: 18px; }
  .member-login-field { height: 46px; margin-top: 12px; }
  .member-login-submit { height: 42px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .member-sms-preview.on { animation: none; }
}

/* ---------- 滑块拼图验证 ---------- */
/* 尺寸全部用相对单位：卡片宽度自适应，图片容器固定 2:1（对应 320×160），
   拼图块 22.5% × 45%（对应 72×72），任何屏幕宽度下比例都不变。 */
.car-captcha-modal {
  max-width: calc(100vw - 20px);
  padding: 0;
  border: 0;
  background: transparent;
  color: #161618;
}
.car-captcha-modal::backdrop {
  background: rgba(16, 16, 20, .48);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.car-captcha {
  box-sizing: border-box;
  width: min(344px, calc(100vw - 20px));
  padding: 18px 12px 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.car-captcha h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: #161618;
}
.car-captcha-tip {
  margin: 6px 0 12px;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  color: #7c7c82;
}
.car-captcha-image {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #eef1f5;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.car-captcha-bg { display: block; width: 100%; height: 100%; }
.car-captcha-piece {
  position: absolute;
  left: 0;
  top: 0;
  width: 22.5%;   /* 72 / 320 */
  height: 45%;    /* 72 / 160 */
  opacity: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
  transition: opacity .18s ease;
  will-change: left;
  pointer-events: none;
}
.car-captcha-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 42px;
  margin: 12px 0 0;
  background: transparent;
  cursor: pointer;
}
.car-captcha-slider:disabled { cursor: default; opacity: .6; }
.car-captcha-slider::-webkit-slider-runnable-track {
  height: 42px;
  border: 1px solid #e2e4ea;
  border-radius: 21px;
  background: #f3f4f7;
}
.car-captcha-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 52px;
  height: 42px;
  margin-top: -1px;
  border: 1px solid #d9dce3;
  border-radius: 21px;
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236e6e76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}
.car-captcha-slider::-moz-range-track {
  height: 42px;
  border: 1px solid #e2e4ea;
  border-radius: 21px;
  background: #f3f4f7;
}
.car-captcha-slider::-moz-range-thumb {
  width: 52px;
  height: 42px;
  border: 1px solid #d9dce3;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}
.car-captcha-hint {
  margin: 8px 0 0;
  min-height: 17px;
  font-size: 12px;
  line-height: 17px;
  text-align: center;
  color: #d4380d;
}
.car-captcha-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.car-captcha-actions button {
  flex: 1;
  height: 36px;
  border: 1px solid #e2e4ea;
  border-radius: 10px;
  background: #fff;
  color: #4b4b52;
  font-size: 13px;
  cursor: pointer;
}
.car-captcha-actions button:hover { border-color: #c9ccd6; color: #161618; }
.car-captcha-actions button:disabled { opacity: .55; cursor: default; }
