/* ============================================================
   班级档案库 · 磨砂偏白毛玻璃主题
   ============================================================ */
: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; }
#key-input { text-align: center; letter-spacing: 2px; font-size: 15px; }

.foot-link {
  display: inline-block;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-decoration: none;
  transition: color .18s;
}
.foot-link:hover { color: var(--accent); }

/* ============================ 主站 ============================ */
.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; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(255, 255, 255, .9);
  color: var(--ink-3);
}
.search input {
  border: none; background: transparent; padding: 0;
  font-size: 13.5px; width: 150px; outline: none;
}
.search input:focus { box-shadow: none; background: transparent; }

/* ------------------------------ 卡片网格 ------------------------------ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 16px;
}

.person {
  position: relative;
  padding: 18px;
  border-radius: 18px;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(155deg, rgba(255,255,255,.78) 0%, rgba(255,255,255,.44) 100%);
  border: 1px solid rgba(255, 255, 255, .88);
  box-shadow: 0 6px 22px rgba(64, 76, 130, .07);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  transition: transform .22s cubic-bezier(.2,.8,.3,1), box-shadow .22s, border-color .22s;
  animation: rise .45s ease both;
}
.person:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(64, 76, 130, .14);
  border-color: rgba(255, 255, 255, 1);
}
.person:active { transform: translateY(-1px) scale(.995); }

.person-top { display: flex; align-items: flex-start; gap: 12px; }

.avatar {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #8fa6ff 0%, #b9a6f6 100%);
  box-shadow: 0 6px 16px rgba(120, 130, 240, .26);
}
.avatar.f { background: linear-gradient(135deg, #f2a7c3 0%, #f7c4a8 100%);
            box-shadow: 0 6px 16px rgba(240, 150, 180, .26); }

.person-name { font-size: 15px; font-weight: 620; margin: 0; line-height: 1.35; }
.person-meta {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: .2px;
  line-height: 1.55;
  word-break: break-all;
}

.person-intro {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: #4c5361;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 63px;
  word-break: break-word;
  white-space: pre-wrap;
}
.person-intro.empty { color: var(--ink-3); font-style: normal; }

.tag {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 10.5px;
  color: var(--ink-3);
  background: rgba(255, 255, 255, .75);
  border-radius: 999px;
  padding: 3px 9px;
}

.empty { text-align: center; color: var(--ink-3); font-size: 14px; margin-top: 60px; }

/* ------------------------------ 弹窗 ------------------------------ */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(38, 44, 66, .22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .22s ease both;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 24px;
  background: linear-gradient(155deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.76) 100%);
  animation: pop .26s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.modal-head { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.modal-id { flex: 1; min-width: 0; }
.modal-id h3 { margin: 0; font-size: 17px; font-weight: 640; }
.modal-id p { margin: 3px 0 0; font-size: 12px; color: var(--ink-2); }

.icon-btn {
  border: none; background: rgba(255,255,255,.6);
  width: 32px; height: 32px; border-radius: 10px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: background .16s, color .16s;
}
.icon-btn:hover { background: #fff; color: var(--ink); }

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 8px 2px;
  letter-spacing: .4px;
}

#m-intro { resize: vertical; min-height: 140px; line-height: 1.7; }

.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.modal-actions { display: flex; gap: 10px; margin-left: auto; }
.modal-foot .msg { margin: 0; }

/* ------------------------------ 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%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .person { padding: 14px; }
  .gate-card { padding: 34px 24px 26px; }
}
