:root {
  --primary: #409eff;
  --primary-hover: #3593f8;
  --text: #243042;
  --muted: rgba(36, 48, 66, 0.72);
  --line: rgba(36, 48, 66, 0.12);
  --danger: #f56c6c;
  --success: #67c23a;
  --card-radius: 20px;
  --shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #fff;
  background:
    linear-gradient(rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.18)),
    url("../images/loginbg.jpg") center center / cover no-repeat;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.login-logo {
  position: absolute;
  top: 32px;
  left: 32px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.login-logo img {
  object-fit: cover;
}

.login-footer {
  position: absolute;
  left: 32px;
  bottom: 32px;
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.92);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 96px 200px 72px 32px;
}

.login-weaper {
  width: 494px;
  min-height: 600px;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
}

.login-right {
  width: 100%;
  min-height: 600px;
  display: flex;
  background: #fff;
  border-radius: var(--card-radius);
}

.login-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 0 55px;
  color: var(--text);
}

.login-form-wepr {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-title {
  font-size: 36px;
  font-weight: 700;
  color: #333;
  line-height: 1.25;
  text-align: center;
}

.plat-info {
  margin: 9px 0;
  padding: 8px 0;
  text-align: center;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  color: #ff7b00;
  background: linear-gradient(270deg, rgba(255, 236, 218, 0) 0%, rgba(255, 236, 218, 0.7) 46%, rgba(255, 236, 218, 0) 100%);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 10px 0;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.is-hidden {
  display: none !important;
}

.form-item {
  position: relative;
}

.form-input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 56px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
  color: #333;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input::placeholder {
  color: #a8abb2;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.12);
}

.form-item.error .form-input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(245, 108, 108, 0.12);
}

.input-icon {
  position: absolute;
  top: 25px;
  left: 16px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: block;
  color: #606266;
  opacity: 0.5;
  pointer-events: none;
}

.error-text {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

.login-submit {
  width: 100%;
  height: 45px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}

.login-submit:hover {
  background: var(--primary-hover);
}

.login-submit:disabled {
  cursor: not-allowed;
  opacity: 0.75;
  pointer-events: none;
}

.login-submit {
  transition: background 0.2s, opacity 0.2s;
}

/* 错误时卡片抖动 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

.login-right.shake {
  animation: shake 0.4s ease-in-out;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
  font-size: 14px;
  color: var(--muted);
}

.remember-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.remember-wrap input {
  margin: 0;
}

.forgot-link {
  color: var(--primary);
}

.login-register {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  font-size: 14px;
}

.login-account {
  color: rgba(36, 48, 66, 0.72);
}

.login-promptly {
  color: var(--primary);
  cursor: pointer;
}

.login-goto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.24);
}

.other-login-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(36, 48, 66, 0.58);
  font-size: 14px;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 48px);
  height: 1px;
  background: var(--line);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.other-login-way {
  min-height: 48px;
}

.form-status {
  min-height: 22px;
  font-size: 13px;
  color: var(--success);
}

.form-status.error {
  color: var(--danger);
}

@media (max-width: 700px) {
  body {
    background-position: 62% center;
  }

  .login-logo,
  .login-footer {
    display: none;
  }

  .login-shell {
    justify-content: center;
    padding: 0;
  }

  .login-weaper,
  .login-right {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
  }

  .login-main {
    width: min(70%, 360px);
    margin: 0 auto;
    padding: 40px 0;
  }
}

@media (max-width: 500px) {
  .login-main {
    width: calc(100% - 48px);
  }

  .login-title {
    font-size: 30px;
  }

  .plat-info {
    font-size: 14px;
  }
}

/* 密码可见性切换按钮 */
.password-toggle {
  position: absolute;
  top: 25px;
  right: 16px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #909399;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.password-toggle:hover {
  opacity: 1;
}

.eye-icon {
  width: 100%;
  height: 100%;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle.active .eye-open {
  display: none;
}

.password-toggle.active .eye-closed {
  display: block;
}

/* Flash 消息样式 */
.flash-message {
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash-success {
  background: #f0f9ff;
  color: var(--success);
  border: 1px solid #b3e5b3;
}

.flash-error {
  background: #fef0f0;
  color: var(--danger);
  border: 1px solid #fbc4c4;
}

/* 记住我选项 */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.remember-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.remember-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.login-tip {
  font-size: 13px;
  color: rgba(36, 48, 66, 0.65);
  line-height: 1.6;
  text-align: center;
}
