/* 登录页样式：与图谱页同一套色板（小红书红 + 中性灰），深浅色跟随系统 */
:root {
  --bg: #f6f8fa;
  --card: #ffffff;
  --txt: #1f2328;
  --txt2: #59636e;
  --line: #d1d9e0;
  --brand: #ff2442;
  --brand-2: #e51e39;
  --danger: #cf222e;
  --shadow: 0 8px 24px rgba(31, 35, 40, .10);
  /* 二维码阴影：贴在图片自身轮廓上（图是带圆角透明的卡片，不能套矩形阴影） */
  --qr-shadow: drop-shadow(0 10px 22px rgba(31, 35, 40, .20)) drop-shadow(0 2px 5px rgba(31, 35, 40, .12));
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --card: #161b22;
    --txt: #e6edf3;
    --txt2: #9198a1;
    --line: #30363d;
    --brand: #ff2442;
    --brand-2: #ff3d57;
    --danger: #ff7b72;
    --shadow: 0 8px 24px rgba(1, 4, 9, .55);
    --qr-shadow: drop-shadow(0 12px 26px rgba(0, 0, 0, .70)) drop-shadow(0 2px 6px rgba(0, 0, 0, .45));
  }
}

* { box-sizing: border-box; }

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

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(255, 36, 66, .10), transparent 70%), var(--bg);
  color: var(--txt);
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.card {
  width: 100%;
  max-width: 380px;
  padding: 30px 26px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

h1 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: .3px;
}

.sub {
  margin: 0 0 22px;
  color: var(--txt2);
  font-size: 12.5px;
}

.lbl {
  display: block;
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--txt2);
}

input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--txt);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 36, 66, .16);
}

button {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background .18s, transform .06s;
}
button:hover { background: var(--brand-2); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .62; cursor: default; }

.err {
  display: none;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--danger);
}

.foot {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--txt2);
}
.foot a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .18s;
}
.foot a:hover,
.foot a:focus-visible { border-bottom-color: var(--brand); outline: none; }

/* ── 联系站长：微信二维码弹窗（遮罩 + 居中卡片，样式对齐 xai 客服弹窗） ── */
[hidden] { display: none !important; }

body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom, 0px));
}
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(17, 20, 24, .55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: modal-fade .18s ease-out;
}
.modal-box {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 24px 24px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  outline: none;
  animation: modal-in .22s cubic-bezier(.2, .9, .3, 1.15);
}

.qr-box {
  /* 图本身是带圆角透明边的卡片，容器不再加白底/边框，避免出现一圈白边 */
  width: 176px;
  height: 176px;
  margin: 0 auto;
}
.qr-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: var(--qr-shadow);
}
.qr-tip {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--txt2);
}

.modal-btn {
  display: block;
  width: auto;
  min-width: 108px;
  margin: 18px auto 0;
  padding: 9px 22px;
  font-size: 14px;
}

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 420px) {
  .card { padding: 24px 20px 20px; border-radius: 14px; }
  h1 { font-size: 18px; }
  .qr-box { width: 160px; height: 160px; }
}
