/* ─── 云海运营后台 · 登录页 ─────────────────────────────── */
:root {
  --bg:      oklch(97.5% 0.004 250);
  --surface: oklch(100% 0 0);
  --fg:      oklch(18% 0.012 250);
  --muted:   oklch(54% 0.012 250);
  --border:  oklch(92% 0.005 250);
  --accent:  oklch(58% 0.18 255);

  --accent-soft: color-mix(in oklch, var(--accent) 12%, var(--surface));
  --accent-deep: color-mix(in oklch, var(--accent) 72%, black);

  --err:        oklch(42% 0.14 25);
  --err-soft:   color-mix(in oklch, var(--err) 10%, var(--surface));
  --err-border: color-mix(in oklch, var(--err) 28%, transparent);

  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC',
               'Microsoft YaHei', system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC',
                  'Microsoft YaHei', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: #ffffff;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.login-wrap {
  width: min(400px, 100%);
}

/* 背景即框架：去掉卡片边框与阴影 */
.login-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 34px 32px 26px;
  box-shadow: none;
}

/* ─── 品牌区（头像 + 名称，来自 txt 文件） ─────────────── */
.brand { text-align: center; }

/* 白色头像：无白色描边、无外发光，只保留圆形图片本身 */
.avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  margin-inline: auto;
  border: 0;
  box-shadow: none;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: color-mix(in oklch, var(--surface) 88%, var(--border));
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

/* 名称：加粗 + 描边（sticker 质感） */
.title {
  margin: 18px 0 26px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--fg);
  -webkit-text-stroke: 1.2px color-mix(in oklch, var(--fg) 82%, transparent);
  paint-order: stroke fill;
  text-shadow: 0 1px 0 color-mix(in oklch, var(--surface) 60%, transparent);
}

/* ─── 弹窗（Toast，效果参考 Yunhai Login framework V0.1） ─── */
.toast-region {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 18px;
  font-size: 13.5px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border-radius: 12px;
  box-shadow:
    0 10px 32px rgba(20, 25, 40, 0.14),
    0 2px 6px rgba(20, 25, 40, 0.06);
  animation: toast-in 320ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: auto;
}

/* 左侧状态圆点：默认成功绿，错误红 */
.toast::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.toast--error::before {
  background: #ef4444;
}

.toast.is-leaving {
  animation: toast-out 280ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
}

/* 登录失败：卡片震动 */
.login-card.is-shaking {
  animation: card-shake 480ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes card-shake {
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ─── 表单 ─────────────────────────────────────────────── */
.login-form { display: flex; flex-direction: column; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

/* 输入框：无边框、无底色，完全融入白色背景（背景即框架） */
.input {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}

.input::placeholder { color: color-mix(in oklch, var(--muted) 70%, transparent); }

/* 点击/聚焦：不出现任何边框、底色变化与光晕 */
.input:focus {
  outline: none;
  background: transparent;
  box-shadow: none;
}

/* 禁止双击放大（移动端）：输入框与按钮不响应双击缩放 */
.input, .btn-submit {
  touch-action: manipulation;
}

.btn-submit {
  margin-top: 6px;
  padding: 11px 16px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #2c313c, #15171d);
  color: #ffffff;
  font: inherit;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.05s ease;
}

.btn-submit:hover { background: linear-gradient(135deg, #3a4150, #1e2129); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
  }
}
