/* =========================================================
   login.css —— 登录页
   左侧氛围区 + 右侧磨砂登录卡
   ========================================================= */

.login-page {
  min-height: 100svh;
  background: #fffafc;
}

.login-shell {
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, 0.88fr);
}

/* ========== 左侧品牌氛围区 ========== */
.login-story {
  position: relative;
  display: flex;
  overflow: hidden;
  padding: 40px clamp(36px, 5.4vw, 88px) 32px;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 72% 26%, rgba(255, 255, 255, 0.82), transparent 26%),
    radial-gradient(circle at 18% 74%, rgba(255, 255, 255, 0.66), transparent 31%),
    linear-gradient(132deg, #ffeef5 0%, #fff7fb 34%, #eafbf9 70%, #d8f5f1 100%);
  isolation: isolate;
}

.login-story::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background-image:
    radial-gradient(rgba(90, 164, 158, 0.14) 0.7px, transparent 0.7px),
    linear-gradient(115deg, transparent 46%, rgba(255, 255, 255, 0.5) 46.15%, transparent 46.35%);
  background-size: 22px 22px, 100% 100%;
  content: "";
  mask-image: linear-gradient(120deg, rgba(0, 0, 0, 0.42), transparent 58%, rgba(0, 0, 0, 0.2));
  -webkit-mask-image: linear-gradient(120deg, rgba(0, 0, 0, 0.42), transparent 58%, rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.login-story::after {
  position: absolute;
  z-index: 1;
  right: -14%;
  bottom: -33%;
  width: 78%;
  height: 78%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 42px rgba(255, 255, 255, 0.12),
    0 0 0 110px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.login-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.login-story__glow {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(6px);
  pointer-events: none;
}

.login-story__glow--pink {
  top: 6%;
  right: 3%;
  width: 38vw;
  height: 38vw;
  background: radial-gradient(circle, rgba(255, 188, 214, 0.44), transparent 69%);
  animation: login-breathe 12s ease-in-out infinite alternate;
}

.login-story__glow--teal {
  bottom: -10%;
  left: -6%;
  width: 42vw;
  height: 42vw;
  background: radial-gradient(circle, rgba(134, 228, 218, 0.4), transparent 68%);
  animation: login-breathe 16s ease-in-out infinite alternate-reverse;
}

.login-story__header,
.login-story__content,
.login-story__footer {
  position: relative;
  z-index: 3;
}

.login-story__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.login-story__edition {
  color: rgba(71, 111, 111, 0.5);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.25em;
  white-space: nowrap;
}

/* 标题和介绍 */
.login-story__content {
  max-width: 620px;
  margin: 0 0 2vh;
  padding: 6vh 0 0;
}

.login-title {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin: 20px 0 14px;
  align-items: baseline;
  color: transparent;
  background: linear-gradient(116deg, #c7638c 3%, #e27fa4 37%, #5fc6bf 73%, #21908a 100%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 16px 32px rgba(207, 120, 151, 0.12));
  font-family: var(--font-serif);
  font-size: clamp(104px, 12.6vw, 172px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 0.95;
  user-select: none;
}

.login-title span {
  display: inline-block;
  animation: title-rise 1.2s var(--ease-soft) both;
}

.login-title span:nth-child(2) {
  animation-delay: 0.12s;
}

.login-poem {
  margin-top: 14px;
  color: #405f60;
  font-family: var(--font-serif);
  font-size: clamp(21px, 2vw, 29px);
  letter-spacing: 0.09em;
  line-height: 1.7;
}

.login-story__desc {
  max-width: 380px;
  margin-top: 20px;
  color: rgba(70, 104, 105, 0.68);
  font-size: 12px;
  letter-spacing: 0.05em;
  line-height: 2.1;
}

.login-since {
  display: flex;
  margin-top: 30px;
  align-items: center;
  gap: 13px;
  color: rgba(70, 111, 111, 0.62);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.28em;
}

.login-since__line {
  display: block;
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, rgba(57, 153, 147, 0.5), transparent);
}

.login-story__footer {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(73, 109, 109, 0.45);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.19em;
}

.login-story__footer-heart {
  color: var(--pink-500);
  font-size: 12px;
  animation: heart-beat 3.6s ease-in-out infinite;
}

/* 旋转轨道装饰 */
.login-orbit {
  position: absolute;
  z-index: 2;
  top: 49%;
  left: 53%;
  width: min(57vw, 690px);
  height: min(57vw, 690px);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.8s var(--ease-soft);
}

.login-orbit__ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 50%;
}

.login-orbit__ring--one {
  inset: 8%;
  border-color: rgba(255, 255, 255, 0.62);
  animation: orbit-spin 46s linear infinite;
}

.login-orbit__ring--one::before {
  position: absolute;
  top: 13%;
  right: 8%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-400);
  box-shadow: 0 0 0 5px rgba(105, 212, 204, 0.13);
  content: "";
}

.login-orbit__ring--two {
  inset: 24%;
  border-color: rgba(255, 255, 255, 0.74);
  border-style: dashed;
  animation: orbit-spin 34s linear infinite reverse;
}

.login-orbit__heart {
  position: absolute;
  color: rgba(216, 105, 144, 0.54);
  font-family: var(--font-serif);
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.9);
}

.login-orbit__heart--one {
  top: 12%;
  left: 12%;
  font-size: 17px;
  animation: float-y 5s ease-in-out infinite;
}

.login-orbit__heart--two {
  right: 10%;
  bottom: 18%;
  color: rgba(42, 152, 145, 0.46);
  font-size: 24px;
  animation: float-y 6.6s ease-in-out infinite reverse;
}

.login-orbit__dot {
  position: absolute;
  top: 46%;
  left: 2%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--pink-400);
  box-shadow: 0 0 0 5px rgba(247, 154, 185, 0.12);
}

/* ========== 右侧登录面板 ========== */
.login-panel {
  position: relative;
  display: flex;
  padding: 40px clamp(28px, 4.8vw, 74px);
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 90% 4%, rgba(255, 221, 232, 0.44), transparent 31%),
    radial-gradient(circle at 8% 90%, rgba(210, 248, 243, 0.5), transparent 30%),
    linear-gradient(165deg, #fffdfb 0%, #fff9fb 55%, #f6fcfb 100%);
  overflow: hidden;
}

.login-panel::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.9) 30%, rgba(92, 158, 154, 0.08) 70%, transparent);
  content: "";
}

.login-panel::after {
  position: absolute;
  right: -180px;
  bottom: -220px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(92, 158, 154, 0.07);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 80px rgba(255, 255, 255, 0.28), 0 0 0 180px rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.login-panel__inner {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 432px);
  flex-direction: column;
  gap: 24px;
}

.login-card {
  position: relative;
  overflow: hidden;
  padding: 42px 40px 32px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow:
    0 34px 90px rgba(85, 126, 125, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(26px) saturate(130%);
  -webkit-backdrop-filter: blur(26px) saturate(130%);
}

.login-card::before {
  position: absolute;
  top: 0;
  left: 12%;
  width: 76%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  content: "";
}

.login-card__head h2 {
  margin-top: 11px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(32px, 3.2vw, 40px);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.34;
}

.login-card__head h2 em {
  color: transparent;
  background: var(--gradient-text);
  background-clip: text;
  -webkit-background-clip: text;
  font-style: normal;
}

.login-card__sub {
  margin-top: 11px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.login-form {
  display: flex;
  margin-top: 28px;
  flex-direction: column;
  gap: 17px;
}

/* 字段错误提示 */
.field-error {
  display: none;
  margin-top: -2px;
  padding-left: 3px;
  color: #cf6388;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.field.has-error .field-error {
  display: block;
}

.field.has-error .input-shell {
  border-color: rgba(217, 109, 144, 0.55);
  background: rgba(255, 246, 249, 0.92);
  box-shadow: 0 0 0 4px rgba(230, 139, 171, 0.08);
  animation: field-shake 0.4s ease;
}

.field.has-error .input-shell__icon {
  color: var(--pink-500);
}

/* 选项行 */
.login-options {
  display: flex;
  margin-top: 1px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  user-select: none;
}

.check-line input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-line__box {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(77, 148, 143, 0.28);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.56);
  transition: 0.25s ease;
}

.check-line input:checked + .check-line__box {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink-400), var(--teal-400));
}

.check-line input:checked + .check-line__box::after {
  position: absolute;
  top: 2px;
  left: 4px;
  width: 4px;
  height: 7px;
  border-right: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  content: "";
  transform: rotate(42deg);
}

.check-line input:focus-visible + .check-line__box {
  outline: 2px solid var(--teal-500);
  outline-offset: 3px;
}

.login-forgot {
  padding: 0;
  color: var(--teal-600);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  transition: color 0.25s ease;
}

.login-forgot:hover {
  color: var(--pink-600);
}

.login-submit {
  height: 53px;
  margin-top: 5px;
  letter-spacing: 0.12em;
}

.login-submit svg {
  margin-left: 2px;
}

/* 演示暗号 */
.demo-key {
  display: flex;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed rgba(80, 143, 139, 0.19);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.demo-key__label {
  color: rgba(84, 127, 126, 0.54);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.25em;
}

.demo-key__value {
  display: inline-flex;
  padding: 5px 11px;
  border: 1px solid rgba(80, 143, 139, 0.1);
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.demo-key__value i {
  color: var(--pink-400);
  font-family: var(--font-serif);
  font-style: normal;
}

.login-panel__foot {
  display: flex;
  padding: 0 4px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(104, 137, 137, 0.5);
  font-size: 8.5px;
  letter-spacing: 0.13em;
}

/* ========== 动画 ========== */
@keyframes login-breathe {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.7;
  }
  100% {
    transform: translate3d(3vw, 3vh, 0) scale(1.12);
    opacity: 1;
  }
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes title-rise {
  from {
    opacity: 0;
    transform: translateY(34px) rotate(1deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

@keyframes field-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

/* ========== 响应式 ========== */
@media (max-width: 1120px) {
  .login-shell {
    grid-template-columns: minmax(0, 0.95fr) minmax(430px, 1.05fr);
  }

  .login-story {
    padding-inline: 42px;
  }

  .login-story__edition {
    display: none;
  }

  .login-orbit {
    left: 54%;
    width: 64vw;
    height: 64vw;
  }
}

@media (max-width: 920px) {
  .login-shell {
    display: block;
  }

  .login-story {
    min-height: 440px;
    padding: 28px 34px 30px;
  }

  .login-story::after {
    right: -22%;
    bottom: -48%;
    width: 70%;
    height: 70%;
  }

  .login-story__content {
    margin: 4vh 0 2vh;
    padding-top: 0;
  }

  .login-title {
    margin-top: 14px;
    margin-bottom: 4px;
    font-size: clamp(80px, 16vw, 120px);
  }

  .login-poem {
    font-size: 19px;
  }

  .login-story__desc {
    max-width: 340px;
    margin-top: 12px;
    font-size: 11px;
  }

  .login-since {
    margin-top: 18px;
  }

  .login-story__footer {
    margin-top: 24px;
  }

  .login-orbit {
    top: 56%;
    left: 64%;
    width: 60vw;
    height: 60vw;
    opacity: 0.74;
  }

  .login-panel {
    padding: 38px 24px 42px;
  }

  .login-panel::before {
    top: -30px;
    right: 8%;
    bottom: auto;
    left: 8%;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(92, 158, 154, 0.12), transparent);
  }

  .login-panel__inner {
    max-width: 460px;
  }
}

@media (max-width: 560px) {
  .login-story {
    min-height: 272px;
    padding: 18px 20px 18px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-type strong {
    font-size: 19px;
  }

  .brand-type small {
    display: none;
  }

  .login-story__content {
    margin: 8px 0 0;
  }

  .login-story__content > .eyebrow {
    font-size: 8px;
  }

  .login-title {
    margin: 5px 0 0;
    font-size: 62px;
    letter-spacing: 0.06em;
  }

  .login-poem {
    margin-top: 5px;
    font-size: 15px;
    letter-spacing: 0.06em;
    line-height: 1.6;
  }

  .login-poem br {
    display: none;
  }

  .login-story__desc {
    display: none;
  }

  .login-since,
  .login-story__footer {
    display: none;
  }

  .login-orbit {
    top: 58%;
    left: 72%;
    width: 76vw;
    height: 76vw;
    opacity: 0.48;
  }

  .login-panel {
    padding: 24px 16px 28px;
  }

  .login-card {
    padding: 26px 22px 22px;
    border-radius: 25px;
  }

  .login-card__head h2 {
    font-size: 28px;
  }

  .login-card__sub {
    margin-top: 8px;
    font-size: 10.5px;
  }

  .login-form {
    margin-top: 19px;
    gap: 12px;
  }

  .login-submit {
    height: 49px;
    margin-top: 2px;
  }

  .login-panel__foot {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .demo-key {
    margin-top: 17px;
    padding-top: 14px;
  }
}

/* =========================================================
   11-14 加：登录 / 注册 切换、昵称字段、整体错误行
   ========================================================= */
.mode-switch {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(214, 168, 178, 0.35);
}

.mode-switch__btn {
  flex: 1;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9a8388;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.mode-switch__btn.is-on {
  background: #fff;
  color: #6b4f56;
  box-shadow: 0 2px 10px rgba(203, 152, 164, 0.22);
}

.field.is-hidden {
  display: none;
}

#formError {
  margin: -4px 0 10px;
}
