/* CRM 登录页 — 品牌优先、浅色氛围、表单为唯一交互区 */
:root {
  --crm-login-ink: #0c2a2e;
  --crm-login-muted: #5b6f74;
  --crm-login-line: #d5e0e3;
  --crm-login-panel: #fbfcfc;
  --crm-login-accent: #0f766e;
  --crm-login-accent-deep: #0a5c56;
  --crm-login-glow: rgba(15, 118, 110, 0.18);
  --crm-login-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html,
body.crm-login-body {
  height: 100%;
  margin: 0;
}

body.crm-login-body {
  font-family: var(--crm-login-font);
  color: var(--crm-login-ink);
  background: #e8f1f0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.crm-login {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  position: relative;
}

/* 左侧氛围面：单层渐变，避免大面积遮罩和模糊阴影拖慢首屏 */
.crm-login__visual {
  position: relative;
  min-height: 100vh;
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: linear-gradient(145deg, #c5ddd8 0%, #a8cfc8 42%, #7eb5ad 100%);
}

.crm-login__mark {
  display: none;
}

.crm-login__brand-block {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.crm-login__brand {
  margin: 0;
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--crm-login-ink);
  text-wrap: balance;
}

.crm-login__tagline {
  margin: 18px 0 0;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--crm-login-muted);
  max-width: 28em;
}

.crm-login__visual-foot {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  color: rgba(12, 42, 46, 0.55);
}

/* 右侧表单交互区 */
.crm-login__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px) clamp(24px, 4vw, 64px);
  background: var(--crm-login-panel);
  border-left: 1px solid rgba(12, 42, 46, 0.06);
}

.crm-login__panel-inner {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.crm-login__panel-title {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--crm-login-ink);
}

.crm-login__panel-desc {
  margin: 0 0 28px;
  font-size: 0.95rem;
  color: var(--crm-login-muted);
}

.crm-login__form {
  margin: 0;
}

.crm-login__field {
  position: relative;
  margin-bottom: 18px;
}

.crm-login__icon {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7a9096;
  pointer-events: none;
}

.crm-login__field input {
  width: 100%;
  height: 48px;
  padding: 0 42px;
  border-radius: 12px;
  border: 1px solid var(--crm-login-line);
  background: #f4f8f8;
  font-size: 15px;
  font-family: inherit;
  color: var(--crm-login-ink);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.crm-login__field input:hover {
  border-color: #b7cbcf;
}

.crm-login__field input:focus {
  background: #fff;
  border-color: var(--crm-login-accent);
  box-shadow: 0 0 0 4px var(--crm-login-glow);
}

.crm-login__eye {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 42px;
  border: 0;
  background: transparent;
  color: #7a9096;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.crm-login__eye:hover {
  color: var(--crm-login-accent);
}

.crm-login__eye .crm-login__eye-on,
.crm-login__eye.is-revealed .crm-login__eye-off {
  display: block;
}

.crm-login__eye .crm-login__eye-off,
.crm-login__eye.is-revealed .crm-login__eye-on {
  display: none;
}

.crm-login__submit {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--crm-login-accent);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.crm-login__submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(15, 118, 110, 0.34);
}

.crm-login__submit:active {
  transform: translateY(0);
}

.crm-login-code {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.crm-login-code__input {
  flex: 1;
  min-width: 0;
}

.crm-login-code__img {
  flex: 0 0 136px;
  width: 136px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--crm-login-line);
  cursor: pointer;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.crm-login-code__img:hover {
  opacity: 0.9;
  border-color: var(--crm-login-accent);
}

.crm-login__panel-foot {
  margin-top: 28px;
  font-size: 0.8rem;
  color: #8a9ea3;
  text-align: center;
}

.crm-login-toast[hidden],
.crm-login-mask[hidden],
.crm-login-alert[hidden] {
  display: none !important;
}

.crm-login-toast {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  z-index: 40;
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(12, 42, 46, 0.88);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(12, 42, 46, 0.22);
}

.crm-login-toast.is-ok {
  background: rgba(15, 118, 110, 0.94);
}

.crm-login-mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(12, 42, 46, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.crm-login-mask__box {
  min-width: 140px;
  padding: 16px 22px;
  border-radius: 12px;
  background: #fff;
  color: var(--crm-login-ink);
  font-size: 15px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(12, 42, 46, 0.16);
}

.crm-login-alert {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 42, 46, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.crm-login-alert__box {
  width: min(360px, 100%);
  padding: 22px 20px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(12, 42, 46, 0.18);
}

.crm-login-alert__box p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--crm-login-ink);
}

.crm-login-alert__box button {
  display: block;
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--crm-login-accent);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}

@media screen and (max-width: 900px) {
  html,
  body.crm-login-body {
    height: auto;
    min-height: 100%;
    background: #f3f6fb;
  }

  body.crm-login-body {
    -webkit-tap-highlight-color: transparent;
  }

  .crm-login {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #f3f6fb;
  }

  .crm-login__visual {
    min-height: 0;
    flex: 0 0 auto;
    padding: calc(36px + env(safe-area-inset-top, 0px)) 28px 64px;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    border-radius: 0 0 32px 32px;
    background: linear-gradient(160deg, #1a6fff 0%, #0958d9 58%, #003eb3 100%);
  }

  .crm-login__visual::before,
  .crm-login__visual::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
  }

  .crm-login__visual::before {
    width: 160px;
    height: 160px;
    top: -48px;
    right: -36px;
    background: rgba(255, 255, 255, 0.1);
  }

  .crm-login__visual::after {
    width: 96px;
    height: 96px;
    left: -28px;
    bottom: 36px;
    background: rgba(255, 255, 255, 0.08);
  }

  .crm-login__brand-block {
    max-width: none;
    width: 100%;
  }

  .crm-login__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 20px;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow: 0 10px 24px rgba(0, 40, 120, 0.18);
  }

  .crm-login__brand {
    font-size: 26px;
    letter-spacing: 0.01em;
    color: #fff;
  }

  .crm-login__tagline {
    margin: 8px auto 0;
    max-width: 18em;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.84);
  }

  .crm-login__visual-foot {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 2;
    text-align: center;
    font-size: 12px;
    color: #98a2b3;
  }

  .crm-login__panel {
    flex: 1;
    margin-top: -40px;
    border-left: 0;
    background: transparent;
    justify-content: flex-start;
    padding: 0 16px calc(48px + env(safe-area-inset-bottom, 0px));
  }

  .crm-login__panel-inner {
    max-width: 440px;
    padding: 22px 18px 18px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 35, 80, 0.1);
  }

  .crm-login__panel-title {
    font-size: 20px;
  }

  .crm-login__panel-desc {
    margin-bottom: 18px;
    font-size: 13px;
  }

  .crm-login__field {
    margin-bottom: 14px;
  }

  .crm-login__field input {
    height: 52px;
    border: 0;
    border-radius: 14px;
    background: #f4f6fa;
    font-size: 16px;
  }

  .crm-login__field input:hover {
    border-color: transparent;
  }

  .crm-login__field input:focus {
    background: #fff;
    border: 1px solid #1677ff;
    box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.16);
  }

  .crm-login__field input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #f4f6fa inset;
    -webkit-text-fill-color: #1d2129;
  }

  .crm-login__submit {
    height: 50px;
    margin-top: 6px;
    border-radius: 25px;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #1a6fff 0%, #0958d9 100%);
    box-shadow: 0 10px 22px rgba(22, 119, 255, 0.32);
  }

  .crm-login__submit:hover {
    transform: none;
    filter: none;
  }

  .crm-login__submit:active {
    transform: scale(0.98);
    filter: brightness(0.96);
  }

  .crm-login-code__img {
    height: 52px;
    border-radius: 14px;
    border: 0;
    background: #f4f6fa;
  }

  .crm-login__panel-foot {
    margin-top: 16px;
    font-size: 12px;
  }

  .crm-login-toast {
    top: calc(12px + env(safe-area-inset-top, 0px));
    border-radius: 999px;
    padding: 10px 18px;
  }
}
