/* ─── 云海运营后台 · 登录页 ─────────────────────────────────
 * 版式参考：极简白底 / 居中原图头像 / 大写字标 / 灰底圆角输入框 / 蓝色主按钮
 * 说明：本页 CSP 为 style-src 'self'，因此所有视觉样式集中在本文件，
 *       页面内不出现任何内联 style。
 * ───────────────────────────────────────────────────────── */

:root {
  --ink:        #0f1115;
  --ink-soft:   #4b5563;
  --muted:      #9aa1ac;
  --field:      #f1f2f4;
  --field-focus:#eceef1;
  --line:       #e8eaee;
  --blue:       #1a4fd6;
  --blue-deep:  #1642b4;
  --danger:     #e5484d;
}

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

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

body.login-body {
  margin: 0;
  min-height: 100dvh;
  background: #ffffff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 26px calc(32px + env(safe-area-inset-bottom));
}

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

/* 背景即框架：无卡片、无边框、无阴影 */
.login-card {
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* ─── 品牌区：圆形头像 + 大写字标 ─────────────────────────── */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-bottom: 34px;
}

.avatar {
  width: 98px;
  height: 98px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--field);
  box-shadow: 0 8px 22px rgba(15, 17, 21, 0.14);
  display: grid;
  place-items: center;
  flex: none;
}

.avatar-fallback {
  font-size: 36px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: center;
  word-break: break-word;
}

/* 中文品牌名（如「祈求科技」）：收紧字距，避免散开 */
.title-cn {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-indent: 0.10em;
  text-transform: none;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: #8a9099;
  letter-spacing: 0.01em;
}

.field-box {
  position: relative;
  display: flex;
  align-items: center;
}

.input {
  width: 100%;
  height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: background 0.16s ease, box-shadow 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder { color: var(--muted); }

.input:focus {
  background: var(--field-focus);
  box-shadow: inset 0 0 0 1.5px #c3d0f4;
}

/* 密码框内右侧 Show / Hide */
.field-box .input { padding-right: 62px; }

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 3px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.toggle-pw:hover { color: var(--ink); }

/* ─── 主按钮 ─────────────────────────────────────────────── */
.btn-submit {
  margin-top: 6px;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(26, 79, 214, 0.24);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-submit:hover { background: var(--blue-deep); }
.btn-submit:active { transform: translateY(1px); box-shadow: 0 7px 16px rgba(26, 79, 214, 0.20); }
.btn-submit:disabled { opacity: 0.62; cursor: not-allowed; transform: none; }

/* ─── 提示弹窗（登录失败 / 状态提示） ─────────────────────── */
.toast-region {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px 12px 34px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(15, 17, 21, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  animation: toast-in 320ms cubic-bezier(0.34, 1.32, 0.64, 1) both;
}

.toast::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  transform: translateY(-50%);
}

.toast--error::before { background: var(--danger); }

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

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

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

/* 登录失败：轻微抖动 */
.login-card.is-shaking {
  animation: card-shake 460ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

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

/* 移动端：禁止双击放大 / 输入框自动放大 */
.input, .btn-submit, .toggle-pw { touch-action: manipulation; }

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.is-leaving, .login-card.is-shaking { animation: none; }
  .input, .btn-submit { transition: none; }
}

/* 小屏微调 */
@media (max-height: 680px) {
  body.login-body { align-items: flex-start; padding-top: 56px; }
  .brand { margin-bottom: 28px; gap: 18px; }
  .avatar { width: 84px; height: 84px; }
  .title { font-size: 21px; }
  .title-cn { font-size: 20px; }
}
