/* 登录页独立样式 —— 多巴胺「活力撞色」配色
   独立成文件的原因：登录页必须先于主应用加载，且不能依赖 app.css 或 echarts，
   否则未登录时静态资源被拦截会导致页面裸奔。 */

:root {
  /* 多巴胺主色板 */
  --dp-coral: #FF6B6B;
  --dp-sun: #FFD93D;
  --dp-mint: #4ECDC4;
  --dp-blue: #4D96FF;
  --dp-violet: #A66CFF;
  --dp-lime: #6BCB77;

  /* 语义色 */
  --ink: #2B2140;
  --ink-2: #6B6180;
  --ink-3: #9A93AC;
  --line: #EDE8F5;
  --card: #FFFFFF;
  --bg: #FFFCF5;

  --radius: 20px;
  --shadow-lg: 0 18px 50px rgba(58, 40, 96, .14);
  --shadow-sm: 0 2px 10px rgba(58, 40, 96, .07);
}

* { box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 背景：柔和光斑网格 ---------- */
.bg-wrap {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(900px 600px at 8% 0%,  rgba(255, 217, 61, .30), transparent 60%),
    radial-gradient(800px 620px at 96% 8%,  rgba(78, 205, 196, .26), transparent 62%),
    radial-gradient(900px 700px at 88% 96%, rgba(166, 108, 255, .24), transparent 62%),
    radial-gradient(760px 560px at 4% 92%,  rgba(255, 107, 107, .22), transparent 62%),
    linear-gradient(160deg, #FFFCF5 0%, #F6F1FF 55%, #FFF3F0 100%);
}
.bg-wrap::after {
  /* 细网格纹理，增加一点"设计感"但不抢内容 */
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(43, 33, 64, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 33, 64, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 40%, transparent 100%);
}

.blob {
  position: absolute; border-radius: 50%; filter: blur(46px); opacity: .5;
  animation: float 15s ease-in-out infinite;
}
.blob.b1 { width: 260px; height: 260px; background: #FF6B6B; left: -60px; top: 8%;  animation-delay: 0s; }
.blob.b2 { width: 300px; height: 300px; background: #4D96FF; right: -80px; top: 4%; animation-delay: -4s; }
.blob.b3 { width: 240px; height: 240px; background: #FFD93D; left: 12%; bottom: -70px; animation-delay: -8s; }
.blob.b4 { width: 280px; height: 280px; background: #A66CFF; right: 6%; bottom: -90px; animation-delay: -12s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(26px, -22px) scale(1.06); }
  66%      { transform: translate(-18px, 18px) scale(.96); }
}

/* ---------- 布局 ---------- */
.stage {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 18px;
}

.card {
  width: 100%; max-width: 420px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 34px 30px 28px;
  animation: rise .5s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* 顶部彩色条：多巴胺撞色点缀 */
.card::before {
  content: ''; display: block; height: 6px; border-radius: 99px; margin: -12px 0 22px;
  background: linear-gradient(90deg, var(--dp-coral) 0%, var(--dp-sun) 26%, var(--dp-lime) 50%, var(--dp-mint) 72%, var(--dp-blue) 100%);
}

/* ---------- 品牌区 ---------- */
.brand { text-align: center; margin-bottom: 26px; }
.logo {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 20px;
  display: grid; place-items: center; font-size: 30px;
  background: linear-gradient(135deg, #FFD93D 0%, #FF6B6B 48%, #A66CFF 100%);
  box-shadow: 0 10px 24px rgba(255, 107, 107, .34);
  animation: pop .6s cubic-bezier(.34, 1.56, .64, 1) both .1s;
}
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.brand h1 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: .3px; }
.brand p  { margin: 0; font-size: 13px; color: var(--ink-2); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }

.input-wrap { position: relative; }
.input-wrap .ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 15px; pointer-events: none; opacity: .75;
}
.input {
  width: 100%; padding: 13px 14px 13px 40px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.input:focus {
  border-color: var(--dp-violet);
  box-shadow: 0 0 0 4px rgba(166, 108, 255, .16);
}
.input::placeholder { color: var(--ink-3); }

/* 强度条：仅首次设置口令时出现 */
.strength { margin-top: 9px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; display: none; }
.strength.on { display: block; }
.strength i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .28s ease, background .28s ease; }
.strength-tip { display: none; margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.strength-tip.on { display: block; }

.btn {
  width: 100%; margin-top: 8px; padding: 14px;
  font-size: 15.5px; font-weight: 700; font-family: inherit; color: #fff;
  background: linear-gradient(135deg, #4D96FF 0%, #A66CFF 100%);
  border: 0; border-radius: 13px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(77, 150, 255, .32);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(77, 150, 255, .4); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .62; cursor: not-allowed; filter: saturate(.7); }

.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 提示条 ---------- */
.alert {
  display: none; margin-bottom: 16px; padding: 11px 13px;
  font-size: 13px; line-height: 1.6; border-radius: 11px;
  border-left: 4px solid;
}
.alert.on { display: block; animation: shake .34s ease; }
.alert.err  { background: #FFF1F1; color: #C0392B; border-color: var(--dp-coral); }
.alert.info { background: #F0F6FF; color: #1F5FBF; border-color: var(--dp-blue); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---------- 底部 ---------- */
.foot { margin-top: 20px; text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.7; }
.foot .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

.hint-box {
  margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 217, 61, .16), rgba(78, 205, 196, .14));
  font-size: 12.5px; color: #5C5170; line-height: 1.75;
}
.hint-box b { color: var(--ink); }

/* ---------- 移动端 ---------- */
@media (max-width: 420px) {
  .card { padding: 28px 20px 22px; border-radius: 18px; }
  .brand h1 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .blob, .card, .logo, .alert.on { animation: none !important; }
}
