:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --border: #e2e6ec;
  --border-strong: #cdd4de;
  --text: #1c212b;
  --muted: #6a7381;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --danger: #c0342c;
  --danger-bg: #fdeceb;
  --ok: #197a4b;
  --brand-soft: #eaf0fe;
  --brand-disabled: #9db6ea;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 32px 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .2px;
}

.sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.field { display: block; margin-bottom: 16px; }

.lbl {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
}

input[type=text], input[type=password] {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fbfcfe;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  outline: none;
  transition: border-color .15s, background .15s;
}

input[type=text]:focus, input[type=password]:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 56px; }

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.pw-toggle:hover { background: #f1f3f7; color: var(--text); }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 20px;
  cursor: pointer;
  user-select: none;
}
.check input { width: 15px; height: 15px; accent-color: var(--brand); }

.btn {
  width: 100%;
  height: 44px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 2px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover:not(:disabled) { background: var(--brand-hover); }
.btn:disabled { background: var(--brand-disabled); cursor: default; letter-spacing: .5px; }

.bar {
  height: 3px;
  margin-top: 12px;
  background: #e8ecf3;
  border-radius: 2px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width .12s linear;
}

.msg {
  margin: 14px 0 0;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f6d5d2;
}
.msg.ok { background: #e9f6ef; color: var(--ok); border-color: #cbe8d9; }

.foot {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.75;
  color: #8b939f;
}

@media (max-width: 460px) {
  .card { padding: 26px 20px 20px; border-radius: 12px; }
}

/* ============ 深色模式 ============ */
html[data-theme="dark"] {
  --bg: #0e131a;
  --panel: #161d27;
  --border: #28313d;
  --border-strong: #36404f;
  --text: #e7ebf1;
  --muted: #8b96a6;
  --brand: #5b94ff;
  --brand-hover: #7aa9ff;
  --brand-soft: #1a2740;
  --brand-disabled: #3a4a63;
  --danger: #ff7b72;
  --danger-bg: #3a2020;
  --ok: #56d68a;
  color-scheme: dark;
}
html[data-theme="dark"] input[type=text],
html[data-theme="dark"] input[type=password] { background: #11171f; }
html[data-theme="dark"] input[type=text]:focus,
html[data-theme="dark"] input[type=password]:focus { background: #0e131a; }
html[data-theme="dark"] .pw-toggle:hover { background: #1c2530; }
html[data-theme="dark"] .msg { border-color: #5a2d2d; }
html[data-theme="dark"] .bar { background: #28313d; }
html[data-theme="dark"] .foot { color: var(--muted); }

/* ---------------- 主题切换按钮（浮动） ---------------- */
.theme-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 50;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { display: block; }
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: inline-flex; }
html[data-theme="dark"] .theme-toggle .i-sun { display: inline-flex; }
html[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------------- 站点页脚（ICP 备案号） ---------------- */
.site-footer {
  text-align: center;
  padding: 14px 16px 20px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: transparent;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
/* 公安网备号前的盾牌图标：与文字基线对齐，跟随页面主色 */
.beian-shield {
  vertical-align: -2px;
  margin-right: 3px;
  fill: var(--brand);
}
