/* ================= 基础 ================= */
:root {
  --violet: #6a4bea;
  --violet-light: #8b6cf6;
  --violet-deep: #5432d0;
  --ink: #2c2c3e;
  --muted: #8c8ca4;
  --card-radius: 16px;
  --card-height: 477px;
  --card-width: 440px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #d8d2ea;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ================= 页面与背景 ================= */
.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(184deg, rgba(198, 184, 238, 0.2) 0%, rgba(168, 148, 222, 0.2) 30%, rgba(142, 120, 204, 0.26) 64%, rgba(114, 98, 178, 0.34) 100%),
    url("assets/img/bg-login.jpg") center bottom / cover no-repeat;
  filter: saturate(1.2) brightness(1.07) contrast(1);
}

/* 顶部一层极淡柔光，保证顶部文字清晰，同时保留紫色调 */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.18) 30%, rgba(255, 255, 255, 0) 52%),
    radial-gradient(85% 55% at 18% 42%, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

/* ================= 顶部品牌 ================= */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 56px 0 0 4vw;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand__logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  flex: none;
  box-shadow: 0 6px 14px rgba(88, 84, 220, 0.28);
  display: grid;
  place-items: center;
}

.brand__logo img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand__name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #33333f;
}

/* ================= 主区域 ================= */
.stage {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--card-width);
  align-items: center;
  column-gap: 4vw;
  padding: 0 13vw 0 4vw;
}

/* ---- 左侧欢迎语 ---- */
.hero {
  position: relative;
  top: -102px;
  z-index: 2;
}

.hero__tag {
  margin: 0 0 10px;
  width: 240px;
  height: 28px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight:500;
  font-size: 14px;
  line-height: 28px;
  font-style: normal;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  text-shadow: 0 8px 20px rgba(59, 108, 240, 0.3);
  background: linear-gradient(180deg, #3B6CF0 0%, #8B5CF6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__title {
  margin: 0;
  font-size: clamp(30px, 2.05vw, 39px);
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.35;
  background: linear-gradient(92deg, #3d63d8 0%, #5f57e2 44%, #7a58e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #3B6CF0;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  margin: 20px 0 0;
  font-size: clamp(18px, 1.32vw, 25px);
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #2a2a38;
}

.hero__en {
  margin: 14px 0 0;
  font-size: clamp(11px, 0.72vw, 13.5px);
  letter-spacing: 0.4px;
  color: #5A6B9B;
}

/* ---- 装饰玻璃方块 ---- */
.deco {
  position: absolute;
  left: 10vw;
  bottom: 13vh;
  width: 190px;
  height: 236px;
  z-index: 1;
  pointer-events: none;
}

.deco__card {
  position: absolute;
  display: block;
  border-radius: 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 26px rgba(126, 105, 190, 0.12);
}

.deco__card--lg {
  left: 0;
  top: 0;
  width: 150px;
  height: 150px;
}

.deco__card--md {
  left: 18px;
  top: 18px;
  width: 114px;
  height: 114px;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
}

.deco__card--sm {
  right: 0;
  bottom: 0;
  width: 58px;
  height: 58px;
  border-radius: 18px;
}

/* ================= 登录卡片 ================= */
/* 登录区铺满主区域高度，卡片在其中垂直居中 */
.login {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 13vw;
  z-index: 3;
  width: var(--card-width);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login__card {
  height: var(--card-height);
  display: flex;
  flex-direction: column;
  padding: 46px 44px 48px;
  border-radius: var(--card-radius);
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 22px 50px rgba(96, 76, 168, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.login__title {
  margin: 0 0 26px;
  text-align: left;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #3B6CF0;
}

/* 标题下的短装饰线 */
.login__title::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, #4c6be6, #9c7df0);
}

/* ---- 表单 ---- */
.form {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 字段分组：撑满卡片剩余空间，两种登录方式高度一致 */
.form__fields {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

/* 错误提示 Message（绝对定位，不挤压布局，卡片高度始终固定） */
.form__message {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  margin: 0;
  padding: 0 2px;
  font-size: 12px;
  line-height: 18px;
  color: #e0546b;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.form__message.is-show {
  opacity: 1;
  transform: translateY(0);
}

/* 输入框 + 外部验证码块 一行 */
.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-row .field {
  flex: 1 1 auto;
  min-width: 0;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
  padding: 0 10px 0 0;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(120, 108, 180, 0.1);
  box-shadow: 0 2px 6px rgba(102, 82, 170, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field:focus-within {
  border-color: rgba(106, 75, 234, 0.55);
  box-shadow: 0 0 0 3px rgba(106, 75, 234, 0.12);
}

.field.is-error {
  border-color: #e5677a;
  box-shadow: 0 0 0 3px rgba(229, 103, 122, 0.14);
}

.field.is-shake {
  animation: shake 0.32s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.field__icon {
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  color: #6f6f88;
}

.field__icon svg {
  width: 17px;
  height: 17px;
}

.field input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
  color: #2f2f42;
  letter-spacing: 0.2px;
}

.field input::placeholder {
  color: #a9a9bd;
}

/* 密码显隐 */
.field__toggle {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: #8f8fa6;
  cursor: pointer;
  line-height: 0;
}

.field__toggle svg {
  width: 19px;
  height: 19px;
}

.field__toggle .icon-eye-off {
  display: none;
}

.field__toggle.is-visible .icon-eye {
  display: none;
}

.field__toggle.is-visible .icon-eye-off {
  display: block;
}

/* 验证码（输入框外部，与输入框右侧对齐） */
.captcha {
  flex: 0 0 auto;
  width: 78px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #8064f0, #5b3fd8);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1.2px;
  font-style: italic;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(103, 74, 230, 0.22);
  transition: filter 0.2s ease;
}

.captcha:hover {
  filter: brightness(1.08);
}

.captcha__text {
  display: inline-block;
  white-space: nowrap;
}

.captcha__text span {
  display: inline-block;
}

/* 短信验证码 "获取验证码"（同样在输入框外部） */
.code-btn {
  flex: 0 0 auto;
  width: 78px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #8064f0, #5b3fd8);
  color: #fff;
  font-size: 11.5px;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(103, 74, 230, 0.22);
  cursor: pointer;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.code-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.code-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* ---- 登录按钮 ---- */
.btn {
  flex: 0 0 auto;
  height: 46px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(96deg, #4c6be6 0%, #6d4fe0 100%);
  color: #fff;
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 3px;
  text-indent: 3px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(84, 84, 224, 0.3);
  transition: box-shadow 0.2s ease, filter 0.2s ease, transform 0.1s ease;
}

.btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 14px 28px rgba(84, 84, 224, 0.38);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: default;
  opacity: 0.85;
}

/* ---- 卡片底部链接 ---- */
.login__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 13px;
}

.link {
  color: #3B6CF0;
  transition: opacity 0.2s ease;
}

.link--muted {
  color: #9b9bb0;
}

/* ---- 版权 ---- */
/* 版权固定在卡片正下方（卡片高 477，一半 238.5 + 24 间距） */
.copyright {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 262px);
  margin: 0;
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  color: #5A6B9B;
}

/* ================= 响应式 ================= */
@media (max-width: 1180px) {
  .stage {
    column-gap: 4vw;
    padding-right: 8vw;
    grid-template-columns: minmax(0, 1fr) min(440px, 44vw);
  }

  .login__card {
    padding: 34px 30px 26px;
  }

  .deco {
    left: 6vw;
  }

  .login {
    right: 8vw;
    width: min(440px, 44vw);
  }
}

@media (max-width: 880px) {
  /* 窄屏回归正常文档流，内容可滚动 */
  .topbar {
    position: relative;
    padding: 28px 0 0 24px;
  }

  .stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px 56px;
    text-align: center;
  }

  .hero {
    top: 0;
    text-align: center;
  }

  .hero__title {
    background: linear-gradient(92deg, #3d63d8, #7a58e8);
    -webkit-background-clip: text;
    background-clip: text;
  }

  .deco {
    display: none;
  }

  .login {
    position: static;
    width: 100%;
    max-width: 380px;
    margin: 34px 0 0;
    display: block;
    text-align: left;
  }

  .login__card {
    padding: 32px 26px 24px;
  }

  .copyright {
    position: static;
    margin-top: 20px;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 18px 0 0 18px;
  }

  .stage {
    padding: 28px 18px 40px;
  }

  .hero__title {
    font-size: 27px;
  }

  .hero__subtitle {
    font-size: 18px;
  }

  .login__card {
    padding: 26px 20px 22px;
  }
}

/* ================= 轻提示 ================= */
.toast {
  display: none;
  position: fixed;
  left: 50%;
  top: 32px;
  z-index: 99;
  padding: 9px 18px;
  border-radius: 9px;
  background: rgba(60, 45, 116, 0.9);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 12px 26px rgba(78, 60, 150, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

.beian-link {
  color: #5A6B9B;
  font-size: 11px;
  text-decoration: none;
}
.beian-link:hover {
  color: #4169ff;
  text-decoration: underline;
}
