/* ============================================================
   密钥管理后台 · 独立站点样式（不依赖主站）
   磨砂偏白毛玻璃主题
   ============================================================ */
:root {
  --white-70: rgba(255, 255, 255, .70);
  --white-55: rgba(255, 255, 255, .55);
  --white-40: rgba(255, 255, 255, .40);
  --stroke:   rgba(255, 255, 255, .85);
  --ink:      #2a2f3a;
  --ink-2:    #6b7280;
  --ink-3:    #9aa1ad;
  --accent:   #4f6ef7;
  --accent-2: #8f7bf5;
  --danger:   #e05252;
  --radius:   20px;
  --shadow:   0 10px 40px rgba(64, 76, 130, .10), 0 2px 8px rgba(64, 76, 130, .05);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #eef1f8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------ 背景光斑 ------------------------------ */
.orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .75;
}

.o1 { width: 620px; height: 620px; left: -160px; top: -180px;
      background: radial-gradient(circle, #cdd9ff 0%, rgba(205,217,255,0) 70%); }
.o2 { width: 560px; height: 560px; right: -140px; top: 8%;
      background: radial-gradient(circle, #f4d7ea 0%, rgba(244,215,234,0) 70%); }
.o3 { width: 680px; height: 680px; left: 28%; bottom: -280px;
      background: radial-gradient(circle, #d6f0ee 0%, rgba(214,240,238,0) 70%); }

/* ------------------------------ 玻璃基类 ------------------------------ */
.glass {
  background: linear-gradient(155deg, rgba(255,255,255,.80) 0%, rgba(255,255,255,.48) 100%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}

.hidden { display: none !important; }

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  font: inherit;
  font-size: 14px;
  border-radius: 14px;
  padding: 11px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, opacity .16s;
  white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 8px 22px rgba(79, 110, 247, .32);
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 10px 28px rgba(79, 110, 247, .42); }

.btn.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, .62);
  border-color: rgba(255, 255, 255, .9);
  box-shadow: 0 2px 10px rgba(64, 76, 130, .06);
}
.btn.ghost:hover { background: rgba(255, 255, 255, .92); }

.btn.danger-ghost {
  color: var(--danger);
  background: rgba(255, 255, 255, .62);
  border-color: rgba(224, 82, 82, .22);
}
.btn.danger-ghost:hover { background: rgba(255, 236, 236, .9); }

/* ------------------------------ 输入框 ------------------------------ */
input[type="text"], input[type="password"], textarea {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .95);
  background: rgba(255, 255, 255, .62);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(79, 110, 247, .45);
  box-shadow: 0 0 0 4px rgba(79, 110, 247, .12);
}

.msg { font-size: 13px; color: var(--danger); min-height: 18px; margin: 10px 0 0; }
.msg.ok { color: #2e9e6b; }

/* ============================ 登录闸门 ============================ */
.gate {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  padding: 42px 36px 32px;
  text-align: center;
  animation: rise .6s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.badge {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 600;
  color: #fff;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 10px 24px rgba(79, 110, 247, .32);
}
.badge.small {
  width: 40px; height: 40px; margin: 0;
  font-size: 16px; border-radius: 13px;
  box-shadow: 0 6px 16px rgba(79, 110, 247, .26);
}

.gate-card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 650; letter-spacing: .5px; }
.gate-card .sub { margin: 0 0 26px; font-size: 13.5px; color: var(--ink-2); }

.gate-card form { display: flex; flex-direction: column; gap: 12px; }

/* ============================ 主面板 ============================ */
.main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 22px clamp(16px, 4vw, 48px) 60px;
  animation: fade .45s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px;
  border-radius: 18px;
  position: sticky;
  top: 16px;
  z-index: 20;
  margin-bottom: 26px;
}

.topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.topbar-left h2 { margin: 0; font-size: 16.5px; font-weight: 650; }
.topbar-sub { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ============================ 后台区块 ============================ */
.block {
  padding: 22px 24px;
  margin-bottom: 18px;
}

.block-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .3px;
  color: var(--ink);
}

.gen-row, .pin-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.gen-row input { flex: 1; }
.pin-row input { flex: 1; }

.gen-result {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(79, 110, 247, .07);
  border: 1px dashed rgba(79, 110, 247, .32);
  animation: pop .28s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.gen-label {
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 1px;
}

.gen-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #33406b;
  user-select: all;
  word-break: break-all;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 4px 14px;
}
.list-head .block-title { margin: 0; }

.key-list { display: flex; flex-direction: column; gap: 12px; }

.key-item {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(255,255,255,.80) 0%, rgba(255,255,255,.48) 100%);
  border: 1px solid rgba(255, 255, 255, .88);
  box-shadow: 0 6px 20px rgba(64, 76, 130, .06);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  animation: rise .35s ease both;
}
.key-item.off { opacity: .58; }

.key-main { flex: 1; min-width: 220px; }

.key-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #33406b;
  user-select: all;
  word-break: break-all;
}

.key-meta {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.key-meta .dot { margin: 0 6px; color: #c8ccd6; }
.key-meta .label-txt { color: var(--accent); }

.chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(46, 158, 107, .12);
  color: #2e9e6b;
  font-weight: 600;
  white-space: nowrap;
}
.chip.off {
  background: rgba(155, 160, 172, .16);
  color: #8a8f9b;
}

.key-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.key-actions .btn { padding: 8px 15px; font-size: 12.5px; border-radius: 11px; }

.empty { text-align: center; color: var(--ink-3); font-size: 14px; margin-top: 40px; }

/* ------------------------------ Toast ------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  z-index: 99;
  padding: 12px 22px;
  border-radius: 14px;
  font-size: 13.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 12px 34px rgba(64, 76, 130, .16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; padding: 13px 15px; }
  .topbar-right { width: 100%; }
  .topbar-right .btn { flex: 1; }
  .gen-row, .pin-row { flex-direction: column; align-items: stretch; }
  .gen-code { font-size: 17px; letter-spacing: 2px; }
  .key-actions { width: 100%; }
  .key-actions .btn { flex: 1; }
  .gate-card { padding: 34px 24px 26px; }
}
