/* ============================================================
 * login.css — 登录窗 · 暗黑科幻风
 * 深黑底 + 霓虹蓝/电光紫强调 + 噪点颗粒 + 霓虹发光
 * ============================================================ */

:root {
  --bg: #0a0a0f;
  --ink: #e0e8f0;
  --ink-soft: rgba(224, 232, 240, .62);
  --ink-faint: rgba(224, 232, 240, .35);
  --paper: rgba(15, 15, 25, .72);
  --paper-solid: #0d0d14;
  --line: rgba(0, 212, 255, .1);
  --line-strong: rgba(0, 212, 255, .2);
  --accent: #00d4ff;
  --accent-deep: #a855f7;
  --accent-pink: #ff2d78;
  --accent-glow: rgba(0, 212, 255, .25);
  --accent-purple-glow: rgba(168, 85, 247, .2);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --r: 10px;
  --r-sm: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 80% -5%, rgba(0, 212, 255, .05), transparent 55%),
    radial-gradient(900px 500px at 10% 105%, rgba(168, 85, 247, .04), transparent 55%),
    linear-gradient(165deg, #0a0a14 0%, #0d0d1a 30%, #100d1e 60%, #0a0a12 100%);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  user-select: none;
  cursor: default;
}

/* ── 自定义标题栏（无边框窗口） ─────────────────────── */

.titlebar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 32px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 14px;
  -webkit-app-region: drag;
  background: linear-gradient(180deg, rgba(0, 212, 255, .04) 0%, transparent 100%);
  border-bottom: 1px solid rgba(0, 212, 255, .06);
}
.titlebar-title {
  font-size: 11.7px; font-weight: 500;
  letter-spacing: .08em;
  color: var(--ink-soft);
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.titlebar-btns {
  display: flex; gap: 4px;
  -webkit-app-region: no-drag;
}
.titlebar-btn {
  width: 28px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
  font-size: 13px;
  line-height: 1;
}
.titlebar-btn:hover {
  background: rgba(0, 212, 255, .08);
  border-color: rgba(0, 212, 255, .15);
  color: var(--accent);
}
.titlebar-btn.close:hover {
  background: rgba(255, 45, 120, .12);
  border-color: rgba(255, 45, 120, .2);
  color: var(--accent-pink);
}

/* ── 氛围层：颗粒噪点 ─────────────────────────────────── */

.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.glow {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(800px 400px at 70% -10%, rgba(0, 212, 255, .06), transparent 60%),
    radial-gradient(600px 300px at 20% 110%, rgba(168, 85, 247, .05), transparent 55%);
}

/* ── 舞台与角线 ───────────────────────────────────────── */

.stage {
  position: relative; z-index: 4;
  height: 100%;
  margin: 46px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 32px 30px 22px;
  display: flex; flex-direction: column;
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  background: var(--paper);
  box-shadow: 0 0 40px rgba(0, 212, 255, .03), inset 0 1px 0 rgba(0, 212, 255, .05);
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) both;
}

.tick { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.tick-tl { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); border-radius: 2px 0 0 0; box-shadow: 0 0 8px var(--accent-glow); }
.tick-br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent-deep); border-right: 2px solid var(--accent-deep); border-radius: 0 0 2px 0; box-shadow: 0 0 8px var(--accent-purple-glow); }

/* ── 头部 ─────────────────────────────────────────────── */

.head {
  position: relative;
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.title {
  font-weight: 600;
  font-size: 21.8px;
  letter-spacing: .08em;
  color: var(--ink);
  text-shadow: 0 0 20px rgba(0, 212, 255, .15);
  animation: rise .65s cubic-bezier(.2, .7, .2, 1) .12s both;
}

.head-rule {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep), transparent);
  opacity: .4;
}
.head-rule::after {
  content: ""; position: absolute; left: 0; top: -1px;
  width: 64px; height: 2px;
  background: var(--accent);
  border-radius: 1px;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── 表单 ─────────────────────────────────────────────── */

.form { display: flex; flex-direction: column; gap: 16px; }

.field {
  position: relative;
  display: block;
  animation: rise .6s cubic-bezier(.2, .7, .2, 1) both;
}
.field.d1 { animation-delay: .22s; }
.field.d2 { animation-delay: .29s; }
.btn-primary.d4 { animation: rise .6s cubic-bezier(.2, .7, .2, 1) .36s both; }

.lbl {
  display: block;
  font-size: 8.6px; letter-spacing: .2em;
  color: var(--ink-soft);
  margin-bottom: 4px;
  transition: color .25s;
}

.field input {
  width: 100%;
  background: rgba(0, 212, 255, .03);
  border: 1px solid var(--line);
  outline: 0;
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .04em;
  padding: 10px 12px;
  caret-color: var(--accent);
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus {
  border-color: var(--accent);
  background: rgba(0, 212, 255, .05);
  box-shadow: 0 0 12px rgba(0, 212, 255, .1), inset 0 0 6px rgba(0, 212, 255, .03);
}
.field:focus-within .lbl { color: var(--accent); }

.bar { display: none; }

.note {
  font-size: 9.4px; color: var(--ink-soft);
  letter-spacing: .06em;
  padding-left: 2px;
}
.note::before { content: "— "; color: var(--accent); }

.err {
  font-size: 9.8px; line-height: 1.5;
  color: var(--accent-pink);
  letter-spacing: .04em;
  padding-left: 2px;
  user-select: text;
  text-shadow: 0 0 8px rgba(255, 45, 120, .2);
}
.err.show { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }

/* ── 按钮 ─────────────────────────────────────────────── */

.btn-primary {
  display: block; width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  border: 0; border-radius: var(--r-sm);
  padding: 12px 0 13px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em; text-indent: .2em;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow), 0 0 40px rgba(0, 212, 255, .08);
  transition: filter .18s, transform .18s, box-shadow .18s;
}
.btn-primary:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px var(--accent-glow), 0 0 50px rgba(0, 212, 255, .12);
}
.btn-primary:active { transform: translateY(0); filter: brightness(.94); }
.btn-primary:disabled { opacity: .55; cursor: default; transform: none; filter: none; }

.btn-ghost {
  display: block; width: 100%;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 11px 0;
  font-family: var(--sans); font-size: 10.1px;
  letter-spacing: .12em; text-indent: .12em;
  cursor: pointer;
  transition: color .18s, border-color .18s, box-shadow .18s;
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 212, 255, .08);
}

/* ── 备份面板 ─────────────────────────────────────────── */

.backup { display: flex; flex-direction: column; gap: 14px; animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }

.backup-title {
  font-size: 12.5px; font-weight: 500; letter-spacing: .08em;
}
.backup-title::before { content: "※ "; color: var(--accent); }

.backup-desc {
  font-size: 9.8px; line-height: 1.85;
  color: var(--ink-soft);
  letter-spacing: .03em;
  user-select: text;
}

/* ── 页脚 ─────────────────────────────────────────────── */

.foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line);
}

.switch {
  background: none; border: 0;
  color: var(--ink-soft);
  font-family: var(--sans); font-size: 9.8px;
  letter-spacing: .1em;
  cursor: pointer;
  padding: 4px 0;
  transition: color .18s, text-shadow .18s;
}
.switch:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}


/* ── 动画 ─────────────────────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
