/* =============================================================================
 * 登录页样式（深色科技风）
 * 独立文件：未登录时也能加载，配色与 css/style.css 同一套令牌
 * ========================================================================== */

:root {
  --bg:          #0a0f16;
  --surface:     #121b27;
  --surface-2:   #17222f;
  --surface-3:   #1c2836;
  --line:        #22303f;
  --txt:         #e6eef8;
  --txt-2:       #94a7bd;
  --txt-3:       #61748a;
  --primary:     #3b82f6;
  --primary-2:   #2563eb;
  --cyan:        #22d3ee;
  --danger:      #f87171;
  --danger-soft: rgba(248, 113, 113, .1);
  --grad:        linear-gradient(135deg, #3b82f6, #22d3ee);
  --radius:      10px;
  --radius-sm:   7px;
  --shadow-lg:   0 30px 70px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .05);
  --glow:        0 0 0 3px rgba(59, 130, 246, .18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--txt);
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* 背景：网格 + 两团光晕，营造"控制台"氛围 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 130, 246, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, .055) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 45%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 45%, #000 30%, transparent 78%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 460px at 18% 6%, rgba(59, 130, 246, .20), transparent 62%),
    radial-gradient(680px 420px at 88% 96%, rgba(34, 211, 238, .14), transparent 58%);
}

.login-wrap {
  width: 100%;
  max-width: 404px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 40%), var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 30px 30px 24px;
  animation: card-in .3s ease-out;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 品牌 ---------- */
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }

.logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  box-shadow: 0 6px 18px rgba(59, 130, 246, .4);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.35; }
.brand-txt strong { font-size: 15px; letter-spacing: .3px; }
.brand-txt .sub { font-size: 11.5px; color: var(--txt-3); letter-spacing: .5px; }

/* ---------- 标题 ---------- */
.title { margin: 0 0 5px; font-size: 21px; letter-spacing: .3px; }
.desc { margin: 0 0 22px; font-size: 12.5px; color: var(--txt-2); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--txt-2);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--txt);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder { color: #55677d; }
.field input:focus {
  border-color: var(--primary);
  box-shadow: var(--glow);
  background: #1f2c3c;
}
.field input.is-error { border-color: var(--danger); background: rgba(248, 113, 113, .07); }

/* 密码框右侧的显示/隐藏按钮 */
.pw-row { position: relative; display: flex; }
.pw-row input { padding-right: 62px; }
.pw-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--txt-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.pw-toggle:hover { color: var(--cyan); border-color: rgba(34, 211, 238, .5); }

/* ---------- 提示条 ---------- */
.alert {
  margin: 0 0 15px;
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #ffb4b4;
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, .3);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
}
.alert[hidden] { display: none; }

/* ---------- 提交按钮 ---------- */
.btn-submit {
  position: relative;
  width: 100%;
  height: 44px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 3px;
  color: #fff;
  background: var(--grad);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(59, 130, 246, .32);
  transition: filter .15s, box-shadow .15s, transform .06s;
}
.btn-submit:hover:not(:disabled) {
  filter: brightness(1.09);
  box-shadow: 0 9px 26px rgba(59, 130, 246, .45);
}
.btn-submit:active:not(:disabled) { transform: translateY(1px); }
.btn-submit:disabled { opacity: .65; cursor: not-allowed; }

/* 提交中的转圈 */
.spinner {
  display: none;
  width: 15px; height: 15px;
  margin-left: 9px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-submit.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 页脚说明 ---------- */
.foot {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--txt-3);
}
.foot code {
  padding: 1px 5px;
  font-size: 11px;
  font-family: "Cascadia Mono", Consolas, monospace;
  background: var(--surface-3);
  border-radius: 4px;
  color: var(--txt-2);
}
.foot .lock { margin-right: 4px; }

/* ---------- 小屏 ---------- */
@media (max-width: 420px) {
  .login-card { padding: 24px 20px 18px; }
  .title { font-size: 19px; }
}
