/* ============================================================
   6班点名器 · 管理后台
   ============================================================ */

.admin-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 18px 16px calc(48px + env(safe-area-inset-bottom, 0));
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
  letter-spacing: 0.02em;
  padding: 0 4px 8px;
}
.section { display: flex; flex-direction: column; }
.section .panel { box-shadow: var(--shadow-card); }

.form-row { padding: 12px 18px; }
.form-row + .form-row::before { display: none; }

.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 18px;
  position: relative;
}
.setting-row + .setting-row::before {
  content: "";
  position: absolute;
  left: 18px; right: 0; top: 0;
  height: 1px;
  background: var(--sep);
}
.setting-row .row-main { padding: 3px 0; }
.setting-row .row-title { font-size: 16px; }
.setting-row .row-sub { font-size: 13px; margin-top: 2px; }

.slider-row { display: block; }
.slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.slider-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.slider-row .range { margin-top: 8px; }

.name-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 12px 0 18px;
  position: relative;
}
.name-item + .name-item::before {
  content: "";
  position: absolute;
  left: 18px; right: 0; top: 0;
  height: 1px;
  background: var(--sep);
}
.name-index {
  width: 24px;
  font-size: 13px;
  color: var(--label-3);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.name-text {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.name-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--accent);
  background: #fff;
  font-size: 16px;
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.name-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }

.picked-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: 0 0 auto;
  margin-right: 2px;
}

/* ---------- 登录 / 初始化 ---------- */

.gate {
  min-height: calc(100dvh - 56px);
  display: grid;
  place-items: center;
  padding: 24px 16px 60px;
}
.gate-card {
  width: 100%;
  max-width: 400px;
  border-radius: var(--r-xl);
  padding: 32px 26px 28px;
  text-align: center;
}
.gate-icon {
  width: 58px; height: 58px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--accent-tint);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.gate-icon svg { width: 28px; height: 28px; }
.gate-card h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 7px;
}
.gate-card p {
  font-size: 14px;
  color: var(--label-2);
  line-height: 1.55;
  margin-bottom: 22px;
}
.gate-form { display: flex; flex-direction: column; gap: 11px; text-align: left; }
.gate-form .field { text-align: center; letter-spacing: 0.06em; }
.gate-foot {
  margin-top: 18px;
  font-size: 13px;
  color: var(--label-3);
  line-height: 1.6;
}
.gate-foot a { color: var(--accent); }

/* ---------- 顶部小提示 ---------- */

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--fill-2);
  color: var(--label-2);
}
.mode-chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.mode-chip.local::before { background: #ff9500; }
.mode-chip.broken { background: rgba(255, 59, 48, 0.1); color: var(--danger); }
.mode-chip.broken::before { background: var(--danger); }

/* ---------- 登录页：安全密钥 ---------- */

.gate-passkey { margin-top: 14px; }

.gate-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--label-3);
  font-size: 13px;
}
.gate-or::before,
.gate-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--sep);
}

.gate-passkey .btn { gap: 9px; }

.gate-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: var(--fill-2);
  color: var(--label-2);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: left;
}
.gate-note svg {
  width: 15px; height: 15px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--green);
}
.gate-note b { color: var(--label); font-weight: 600; }

/* ---------- 安全密钥列表 ---------- */

.passkey-head { padding: 15px 18px 10px; }
.passkey-head .row-title { font-size: 16px; }

.passkey-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 12px 0 18px;
  position: relative;
}
.passkey-item + .passkey-item::before {
  content: "";
  position: absolute;
  left: 18px; right: 0; top: 0;
  height: 1px;
  background: var(--sep);
}

.passkey-icon {
  width: 34px; height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.passkey-icon svg { width: 18px; height: 18px; }

.passkey-body { flex: 1; min-width: 0; }
.passkey-name {
  font-size: 16px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.passkey-meta { font-size: 12.5px; color: var(--label-3); margin-top: 2px; }
.passkey-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }

.passkey-empty {
  padding: 8px 18px 16px;
  font-size: 13.5px;
  color: var(--label-3);
  line-height: 1.6;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--sep);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.stat {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  padding: 16px 12px;
  text-align: center;
}
.stat-num {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--label-3); margin-top: 2px; }

.divider-line { height: 1px; background: var(--sep); }

/* ---------- 弹层 ---------- */

.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.16);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 0.24s var(--ease);
}
.sheet-mask.show { opacity: 1; }

.sheet {
  width: 100%;
  max-width: 380px;
  border-radius: 26px;
  padding: 24px 22px 20px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--sep);
  box-shadow: var(--shadow-float);
  transform: translateY(12px) scale(0.975);
  transition: transform 0.34s var(--ease-out);
}
.sheet-mask.show .sheet { transform: none; }
.sheet h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 7px;
}
.sheet p {
  font-size: 14px;
  color: var(--label-2);
  line-height: 1.55;
  margin-bottom: 17px;
}
.sheet-body { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.sheet-actions { display: flex; gap: 9px; }
.sheet-actions .btn { flex: 1; height: 47px; font-size: 16px; }

@media (max-width: 420px) {
  .admin-wrap { gap: 18px; }
  .gate-card { padding: 28px 20px 24px; }
}
