/* ============================================================
   康龄纪商家后台 · 登录门禁样式 v2（高级感重设计）
   兼容性说明：
   - 与 gate.js 生成的 DOM 类名完全对应，可直接替换线上 css/gate.css
   - 复用 admin.css 的 CSS 变量（--dark/--dark-2/--lime 等）
   - 不改动任何 JS 逻辑与后端接口
   ============================================================ */

/* 未登录时隐藏后台本体 */
html.gate-locked .shell { visibility: hidden; }

/* ---------------- 全屏登录底景 ---------------- */

.klj-gate {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff;
  overflow: auto;
  background:
    /* 品牌水印「康」字 */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520'%3E%3Ctext x='260' y='330' font-size='420' font-weight='800' text-anchor='middle' fill='%23c9f227' fill-opacity='0.028' font-family='PingFang SC,Microsoft YaHei,sans-serif'%3E康%3C/text%3E%3C/svg%3E") center 42% no-repeat,
    /* 左上青柠极光 */
    radial-gradient(900px 520px at 12% -6%, rgba(201, 242, 39, .13) 0%, transparent 60%),
    /* 右下暖橄榄辉光 */
    radial-gradient(760px 480px at 104% 108%, rgba(122, 148, 40, .16) 0%, transparent 62%),
    /* 中部冷光提亮 */
    radial-gradient(1100px 600px at 50% 46%, rgba(58, 70, 34, .35) 0%, transparent 70%),
    /* 细点阵网格 */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='1.2' cy='1.2' r='1.2' fill='%23ffffff' fill-opacity='0.035'/%3E%3C/svg%3E"),
    var(--dark);
}
.klj-gate[hidden] { display: none; }

/* 底景四角暗角，聚焦中心卡片 */
.klj-gate::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(8, 10, 4, .55) 100%);
}

/* ---------------- 登录卡片 ---------------- */

.klj-gate-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(168deg, rgba(38, 43, 27, .92) 0%, rgba(24, 28, 16, .96) 100%);
  border: 1px solid rgba(201, 242, 39, .14);
  border-radius: 22px;
  padding: 34px 32px 26px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 40px 90px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(0, 0, 0, .35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: klj-gate-in .5s cubic-bezier(.22, 1, .36, 1) both;
}
/* 卡片顶部青柠高光弧线 */
.klj-gate-card::before {
  content: "";
  position: absolute;
  top: -1px; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 242, 39, .55), transparent);
}
/* 卡片右下微弱青柠晕光 */
.klj-gate-card::after {
  content: "";
  position: absolute;
  right: -60px; bottom: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(201, 242, 39, .10) 0%, transparent 70%);
}

@keyframes klj-gate-in {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* 卡片内元素依次浮现 */
.klj-gate-card > * { animation: klj-gate-fade .45s ease both; }
.klj-gate-card > *:nth-child(1) { animation-delay: .05s; }
.klj-gate-card > *:nth-child(2) { animation-delay: .10s; }
.klj-gate-card > *:nth-child(3) { animation-delay: .15s; }
.klj-gate-card > *:nth-child(n+4) { animation-delay: .20s; }
@keyframes klj-gate-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- 品牌区 ---------------- */

.klj-gate-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.klj-gate-mark {
  width: 42px; height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #dcff54 0%, var(--lime) 55%, #a8d414 100%);
  color: #14180c;
  font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(201, 242, 39, .28), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.klj-gate-brand b {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .04em;
}
.klj-gate-brand span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #8f9587;
  letter-spacing: .14em;
}

/* ---------------- 标题与导语 ---------------- */

.klj-gate h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .01em;
}
.klj-gate .lead {
  margin: 0 0 24px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #9aa08f;
}

/* ---------------- 表单字段 ---------------- */

.klj-field { margin-bottom: 15px; }
.klj-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 600;
  color: #9aa08f;
  letter-spacing: .1em;
}
.klj-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .11);
  background: rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .22);
  color: #fff;
  font-size: 14px;
  outline: none;
  caret-color: var(--lime);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.klj-field input::placeholder { color: #5d6350; }
.klj-field input:hover { border-color: rgba(255, 255, 255, .2); }
.klj-field input:focus {
  border-color: rgba(201, 242, 39, .75);
  background: rgba(201, 242, 39, .05);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, .18),
    0 0 0 3px rgba(201, 242, 39, .13);
}
/* 密码管理器自动填充时保持深色外观 */
.klj-field input:-webkit-autofill,
.klj-field input:-webkit-autofill:hover,
.klj-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  caret-color: var(--lime);
  transition: background-color 99999s ease-in-out 0s;
}

/* ---------------- 登录按钮 ---------------- */

.klj-gate-btn {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, #dcff54 0%, var(--lime) 50%, #b5e01c 100%);
  color: #14180c;
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: .22em;      /* 「登 录」两字舒展排布 */
  text-indent: .22em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(201, 242, 39, .22), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .16s, box-shadow .16s, filter .16s, opacity .16s;
}
.klj-gate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(201, 242, 39, .3), inset 0 1px 0 rgba(255, 255, 255, .5);
  filter: brightness(1.04);
}
.klj-gate-btn:active {
  transform: translateY(0);
  filter: brightness(.97);
  box-shadow: 0 4px 14px rgba(201, 242, 39, .2), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.klj-gate-btn[disabled] {
  opacity: .55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* ---------------- 错误提示 ---------------- */

.klj-gate-err {
  margin: 14px 0 0;
  min-height: 17px;
  font-size: 12px;
  color: #ff9b7a;
  text-align: center;
}

/* ---------------- 底部信息 ---------------- */

.klj-gate-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 11px;
  color: #7d8374;
}
.klj-gate-foot a {
  color: #b9c0a8;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s;
}
.klj-gate-foot a:hover { color: var(--lime); }
.klj-gate-ver {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: #565c4a;
}

/* ---------------- 「返回」链接（修改密码面板） ---------------- */

.klj-gate-back {
  display: inline-block;
  margin: -6px 0 14px;
  font-size: 12px;
  color: #9aa08f;
  cursor: pointer;
  transition: color .15s, transform .15s;
}
.klj-gate-back:hover {
  color: var(--lime);
  transform: translateX(-2px);
}

/* ---------------- 补充说明文字 ---------------- */

.klj-gate-tip {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: #7d8374;
}

/* ---------------- 登录后的账号浮标 ---------------- */

.klj-acct {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 8000;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 6px 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(20, 22, 15, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #e8ece0;
  font-size: 12px;
  box-shadow: 0 10px 26px rgba(15, 17, 8, .28);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.klj-acct[hidden] { display: none; }
.klj-acct .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(201, 242, 39, .7);
}
.klj-acct b { font-weight: 600; }
.klj-acct button {
  height: 25px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #e8ece0;
  font-size: 11px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.klj-acct button:hover { background: var(--lime); color: #14180c; }

/* ---------------- 响应式与无障碍 ---------------- */

@media (max-width: 480px) {
  .klj-gate { padding: 16px; }
  .klj-gate-card {
    padding: 28px 22px 22px;
    border-radius: 18px;
  }
  .klj-gate h2 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .klj-gate-card,
  .klj-gate-card > * { animation: none; }
  .klj-gate-btn,
  .klj-field input,
  .klj-gate-back,
  .klj-acct button { transition: none; }
}
