:root {
  --bg: #f4f6fa;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --line: #e8ecf3;
  --line-strong: #dce3ee;
  --text: #1a2332;
  --text-soft: #6b7a99;
  --text-dim: #94a0b8;
  --blue: #4143d5;
  --blue-strong: #4143d5;
  --blue-bright: #4d60eb;
  --blue-soft: #eef1ff;
  --up: #17a267;
  --down: #d34d5e;
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== 登录布局 ===== */
.login-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  min-height: 100vh;
}

/* ===== 左侧品牌区 ===== */
.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 40px;
  background: linear-gradient(145deg, #1a1f3a 0%, #232a4e 50%, #1a1f3a 100%);
  overflow: hidden;
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(65, 67, 213, 0.25), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(77, 96, 235, 0.15), transparent 50%);
  pointer-events: none;
}

.brand-content {
  position: relative;
  z-index: 1;
}

.brand-logo svg {
  width: 52px;
  height: 52px;
  display: block;
  margin-bottom: 20px;
}

.brand-content h1 {
  font-size: 26px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.brand-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.brand-desc {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.7;
  margin-bottom: 28px;
}

.brand-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-features span {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-footer {
  position: relative;
  z-index: 1;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

/* ===== 右侧登录区 ===== */
.login-main {
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card-head {
  margin-bottom: 28px;
}

.login-card-head h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.login-card-head p {
  font-size: 13px;
  color: var(--text-soft);
}

/* ===== 登录方式切换 ===== */
.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
}

.login-tabs button {
  flex: 1;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.login-tabs button:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--line);
}

.login-tabs button.active {
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 600;
}

.login-tabs button:hover:not(.active) {
  color: var(--text);
  background: #f8f9fb;
}

/* ===== 登录表单 ===== */
.login-form {
  display: grid;
  gap: 16px;
}

.login-form[hidden] {
  display: none !important;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(65, 67, 213, 0.1);
}

.field-icon {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-left: 12px;
}

.input-wrap:focus-within .field-icon {
  color: var(--blue);
}

.input-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.input-wrap input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

/* 密码可见切换 */
.pwd-toggle {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-right: 2px;
}

.pwd-toggle svg {
  width: 18px;
  height: 18px;
}

.pwd-toggle:hover {
  color: var(--text-soft);
}

/* 验证码按钮 */
.code-wrap {
  padding-right: 4px;
}

.code-btn {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.code-btn:hover {
  opacity: 0.8;
}

.code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 登录按钮 ===== */
.login-btn {
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 2px;
  transition: opacity 0.15s;
  margin-top: 4px;
}

.login-btn:hover {
  opacity: 0.9;
}

.login-btn:active {
  opacity: 0.8;
}

/* 登录空值/错误提示 */
.login-feedback {
  margin: -6px 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  line-height: 1.5;
}

.login-feedback[hidden] {
  display: none !important;
}

/* ===== 协议勾选 ===== */
.agreement {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  cursor: pointer;
}

.agreement input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.check-wrap {
  display: flex;
  cursor: pointer;
}

.check-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s;
  background: #ffffff;
}

.check-box svg {
  width: 10px;
  height: 10px;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.15s;
}

.agreement input:checked + .check-box {
  background: var(--blue);
  border-color: var(--blue);
}

.agreement input:checked + .check-box svg {
  opacity: 1;
}

.agree-text {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 400;
}

.agree-link {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--blue);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.agree-link:hover {
  text-decoration: underline;
}

/* ===== 协议弹窗 ===== */
.agree-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms;
}

.agree-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.agree-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 24, 46, 0.4);
}

.agree-modal {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 60px));
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  transform: translateY(12px) scale(0.97);
  transition: transform 200ms;
}

.agree-overlay.open .agree-modal {
  transform: translateY(0) scale(1);
}

.agree-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.agree-head h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.agree-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: #f5f7fb;
  color: var(--text-soft);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}

.agree-close:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.agree-body {
  padding: 20px 22px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
}

.agree-body h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--text);
}

.agree-body h3:first-child {
  margin-top: 0;
}

.agree-body p {
  margin-bottom: 10px;
  color: var(--text-soft);
}

.agree-body ul {
  padding-left: 18px;
  margin-bottom: 10px;
}

.agree-body li {
  color: var(--text-soft);
  margin-bottom: 4px;
}

/* ===== 登录成功蒙层 ===== */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: rgba(19, 24, 46, 0.3);
  backdrop-filter: blur(4px);
  animation: fadeIn 200ms;
}

.success-overlay[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.success-card {
  text-align: center;
}

.success-icon svg {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  animation: scaleIn 300ms;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  60% { transform: scale(1.15); }
  to { transform: scale(1); }
}

.success-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.success-card p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}
