/* 登录页样式 —— 与主页面同一套浅色主题 */

:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-press: #1d4ed8;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px calc(24px + var(--safe-bottom));
}

.login-wrap {
  width: 100%;
  max-width: 380px;
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 34px 26px 28px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(15, 23, 42, .16);
  border: 1px solid var(--line);
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, .5);
}

h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .3px;
}

.sub {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #f8fafc;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.field input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, .13);
}

.pw-wrap {
  position: relative;
}

.pw-wrap input {
  padding-right: 62px;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.pw-toggle:active {
  background: #eff6ff;
}

.err {
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 13px;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 1px solid #fecaca;
}

.err[hidden] { display: none; }

.submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15.5px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background .15s, transform .06s;
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .6);
}

.submit:hover { background: var(--accent-press); }
.submit:active { transform: translateY(1px); }
.submit:disabled {
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
}

.hint {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 11px 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.hint[hidden] { display: none; }

.hint-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

/* toast */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(26px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  z-index: 50;
}

.toast {
  background: rgba(15, 23, 42, .92);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px -8px rgba(15, 23, 42, .5);
  animation: toastIn .22s ease;
  max-width: 84vw;
  text-align: center;
}

.toast.err { background: rgba(220, 38, 38, .95); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
