/* ===== 情侣小窝 · 登录页样式（移动端优先） ===== */

:root {
  --pink-50: #fff5f8;
  --pink-100: #ffe9f1;
  --pink-200: #ffd6e3;
  --pink-300: #ffb3cb;
  --pink-400: #ff8fab;
  --pink-500: #f43f6e;
  --pink-600: #d92b58;
  --ink: #4a2b38;
  --ink-soft: #8b6b78;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --ring: rgba(244, 63, 110, 0.22);
  --radius-lg: 26px;
  --radius-md: 16px;
  --shadow-card: 0 18px 48px -18px rgba(214, 51, 92, 0.45), 0 2px 8px rgba(214, 51, 92, 0.06);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(170deg, #fff7fa 0%, #ffeaf2 45%, #ffe0ec 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

/* ===== 背景装饰 ===== */
.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.75;
  animation: floatBlob 14s var(--ease) infinite alternate;
}

.blob-1 {
  width: 260px;
  height: 260px;
  top: -80px;
  left: -70px;
  background: radial-gradient(circle at 30% 30%, #ffc2d6, #ff9ebb);
}

.blob-2 {
  width: 300px;
  height: 300px;
  right: -110px;
  bottom: -90px;
  background: radial-gradient(circle at 60% 40%, #ffd9b8, #ffa8c4);
  animation-delay: -5s;
}

@keyframes floatBlob {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(18px, -26px, 0) scale(1.08);
  }
}

.hearts {
  position: absolute;
  inset: 0;
}

.hearts i {
  position: absolute;
  bottom: -40px;
  font-size: 14px;
  color: rgba(244, 63, 110, 0.28);
  animation: rise linear infinite;
  will-change: transform, opacity;
}

@keyframes rise {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 0.9;
  }
  100% {
    transform: translate3d(var(--drift, 20px), -108vh, 0) rotate(var(--spin, 24deg)) scale(1.05);
    opacity: 0;
  }
}

/* ===== 主体布局 ===== */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: calc(env(safe-area-inset-top) + 36px) 22px calc(env(safe-area-inset-bottom) + 28px);
  max-width: 480px;
  margin: 0 auto;
}

.brand {
  text-align: center;
  animation: fadeUp 0.7s var(--ease) both;
}

.logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 12px 28px -12px rgba(244, 63, 110, 0.55);
  animation: beat 2.6s ease-in-out infinite;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@keyframes beat {
  0%,
  100% {
    transform: scale(1);
  }
  12% {
    transform: scale(1.08);
  }
  24% {
    transform: scale(1);
  }
  36% {
    transform: scale(1.05);
  }
  48% {
    transform: scale(1);
  }
}

.brand h1 {
  margin: 0;
  font-size: 27px;
  letter-spacing: 3px;
  font-weight: 700;
  background: linear-gradient(120deg, #f43f6e, #ff8fab 60%, #ff6f91);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.slogan {
  margin: 8px 0 0;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--ink-soft);
}

/* ===== 卡片 ===== */
.card {
  position: relative;
  padding: 24px 20px 20px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  animation: fadeUp 0.7s 0.1s var(--ease) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.card-title {
  margin: 0 0 18px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.5px;
}

/* 身份选择 */
.who {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
  transition: transform 0.4s var(--ease);
}

.who.is-error {
  animation: shake 0.5s var(--ease);
}

.who-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px 13px;
  border: 2px solid var(--pink-200);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.28s var(--ease);
}

.who-btn .avatar {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  font-size: 28px;
  line-height: 1;
  background: var(--pink-100);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 16px -6px rgba(244, 63, 110, 0.55);
  transition: border-color 0.28s var(--ease), transform 0.28s var(--ease),
    box-shadow 0.28s var(--ease);
}

.who-btn .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.who-btn .name {
  letter-spacing: 1px;
}

.who-btn:active {
  transform: scale(0.97);
}

.who-btn.is-active {
  border-color: var(--pink-400);
  background: linear-gradient(160deg, #fff, #ffeef4);
  color: var(--pink-600);
  box-shadow: 0 12px 26px -14px rgba(244, 63, 110, 0.85);
}

.who-btn.is-active .avatar {
  border-color: var(--pink-300);
  transform: scale(1.06);
  box-shadow: 0 8px 20px -6px rgba(244, 63, 110, 0.75);
}

.who-btn.is-active .name {
  font-weight: 600;
}

/* 选中后的角标 */
.who-btn.is-active::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  color: var(--white);
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 3px 8px -3px rgba(224, 42, 92, 0.9);
  animation: popBadge 0.32s var(--ease);
}

@keyframes popBadge {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* 选中提示行 */
.picked {
  margin: 12px 0 16px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  color: #b0929f;
  transition: color 0.25s var(--ease);
}

.picked.is-on {
  color: var(--pink-600);
  font-weight: 500;
}

/* ===== 输入框 ===== */
.field {
  margin-bottom: 14px;
}

.label {
  display: block;
  margin: 0 0 7px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

.control {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid var(--pink-200);
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.control:focus-within {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 4px var(--ring);
}

.control.is-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16);
  animation: shake 0.36s var(--ease);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-3px);
  }
}

.control input {
  flex: 1 1 auto;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  letter-spacing: 0.5px;
  border-radius: var(--radius-md);
}

.control input::placeholder {
  color: #cdaab8;
  font-size: 14px;
  letter-spacing: 0.5px;
}

/* 未选身份时密码框不可用 */
.control:has(input:disabled),
.control.is-locked {
  background: rgba(255, 255, 255, 0.55);
  border-color: #f3dde5;
  border-style: dashed;
}

.control input:disabled {
  color: #c3a8b4;
  cursor: not-allowed;
}

.control input:disabled::placeholder {
  color: #d9c2cc;
}

.eye:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.eye {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-right: 3px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #b98c9e;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.eye:active {
  background: var(--pink-100);
}

.eye svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.eye .eye-off {
  display: none;
}

.eye[aria-pressed="true"] .eye-open {
  display: none;
}

.eye[aria-pressed="true"] .eye-off {
  display: block;
}

/* ===== 记住我 / 忘记密码 ===== */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 2px 0;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.check .box {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1.5px solid var(--pink-300);
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.2s var(--ease);
}

.check .box svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--white);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: scale(0);
  transition: transform 0.2s var(--ease);
}

.check input:checked + .box {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  border-color: transparent;
}

.check input:checked + .box svg {
  transform: scale(1);
}

.check input:focus-visible + .box {
  box-shadow: 0 0 0 4px var(--ring);
}

.link {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--pink-500);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.link:active {
  opacity: 0.65;
}

/* ===== 提示文案 ===== */
.hint {
  margin: 12px 2px 0;
  min-height: 17px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #e11d48;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.hint.show {
  opacity: 1;
  transform: translateY(0);
}

.hint.ok {
  color: #0f9d58;
}

/* ===== 提交按钮 ===== */
.submit {
  position: relative;
  width: 100%;
  height: 52px;
  margin-top: 16px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ff7ba1 0%, #f43f6e 55%, #e02a5c 100%);
  color: var(--white);
  font-size: 16.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 4px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 14px 26px -14px rgba(224, 42, 92, 0.95);
  transition: transform 0.18s var(--ease), box-shadow 0.24s var(--ease), filter 0.24s var(--ease);
}

.submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.5) 50%, transparent 75%);
  transform: translateX(-130%);
}

.submit:not(:disabled)::after {
  animation: sheen 3.4s var(--ease) infinite;
}

@keyframes sheen {
  0% {
    transform: translateX(-130%);
  }
  45%,
  100% {
    transform: translateX(130%);
  }
}

.submit:active {
  transform: scale(0.975);
  box-shadow: 0 8px 18px -12px rgba(224, 42, 92, 0.9);
}

.submit:disabled {
  cursor: not-allowed;
  filter: saturate(0.75) brightness(1.03);
}

.submit .spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.4px solid rgba(255, 255, 255, 0.45);
  border-top-color: var(--white);
  opacity: 0;
  animation: spin 0.7s linear infinite;
}

.submit.is-loading .submit-text {
  opacity: 0;
}

.submit.is-loading .spinner {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.foot {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.6px;
  color: #b0929f;
}

/* ===== 版权 / 授权信息 ===== */
.credit {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 179, 203, 0.75);
  text-align: center;
}

.credit-line {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.75;
  letter-spacing: 0.4px;
  color: #ab8c99;
}

.credit-name {
  color: var(--pink-600);
  font-weight: 600;
}

.credit-id {
  color: #7a5b67;
  font-weight: 600;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  user-select: all;
}

/* ===== 忘记密码小彩蛋 ===== */
.egg {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(74, 43, 56, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s var(--ease);
}

.egg.show {
  opacity: 1;
  visibility: visible;
}

.egg-card {
  width: 100%;
  max-width: 300px;
  padding: 26px 22px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffdfd, #fff4f8);
  text-align: center;
  box-shadow: 0 24px 60px -24px rgba(74, 43, 56, 0.6);
  transform: scale(0.9) translateY(10px);
  transition: transform 0.32s var(--ease);
}

.egg.show .egg-card {
  transform: scale(1) translateY(0);
}

.egg-emoji {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 12px;
}

.egg-text {
  margin: 0 0 20px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
}

.egg-text span {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.egg-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff7ba1, #f43f6e);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 12px 22px -14px rgba(224, 42, 92, 0.9);
}

.egg-btn:active {
  transform: scale(0.98);
}

/* ===== 登录成功后的过渡页 ===== */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 32px;
  text-align: center;
  background: linear-gradient(165deg, #fff6fa, #ffe1ec 60%, #ffd3e2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}

.welcome.show {
  opacity: 1;
  visibility: visible;
}

.welcome .big-avatar {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  font-size: 46px;
  line-height: 1;
  background: var(--white);
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 40px -16px rgba(224, 42, 92, 0.65);
  animation: beat 2.2s ease-in-out infinite;
}

.welcome .big-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.welcome h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--pink-600);
}

.welcome p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  letter-spacing: 0.6px;
}

.welcome .meta {
  margin-top: 10px;
  font-size: 12px;
  color: #b0929f;
}

/* ===== 小屏 / 矮屏适配 ===== */
@media (max-height: 700px) {
  .stage {
    gap: 16px;
    padding-top: calc(env(safe-area-inset-top) + 20px);
  }

  .logo {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    margin-bottom: 10px;
  }

  .brand h1 {
    font-size: 23px;
  }

  .card {
    padding: 20px 18px 16px;
  }

  .card-title {
    margin-bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
