/* ============================================================
   style.css — 移动端优先 · 美观大方 · 无需外网资源
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --accent: #0ea5e9;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warn: #d97706;
  --warn-light: #fffbeb;
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .14);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------- 通用容器 ---------- */
.page {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 16px 48px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  box-shadow: 0 6px 18px rgba(79, 70, 229, .35);
}
.btn-primary:not(:disabled):hover { box-shadow: 0 8px 24px rgba(79, 70, 229, .45); }

.btn-ghost {
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--line);
}

/* ---------- 输入框 ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: .5px;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .ico {
  position: absolute;
  left: 14px;
  font-size: 18px;
  opacity: .55;
  pointer-events: none;
}
.input-wrap input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #f8fafc;
  border-radius: 14px;
  padding: 13px 14px 13px 44px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.input-wrap input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
.input-wrap input::placeholder { color: var(--text-3); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}
.card-title .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  flex-shrink: 0;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, .92);
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  max-width: 86vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hidden { display: none !important; }

/* ============================================================
   登录页
   ============================================================ */
.login-body {
  background: linear-gradient(160deg, #1e3a8a 0%, #3730a3 45%, #6d28d9 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.login-body::before,
.login-body::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.login-body::before { width: 320px; height: 320px; top: -120px; right: -100px; }
.login-body::after { width: 260px; height: 260px; bottom: -90px; left: -80px; }

.login-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 56px 24px 8px;
  text-align: center;
  color: #fff;
  position: relative;
  z-index: 1;
}
.login-hero .badge {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 22px;
  backdrop-filter: blur(4px);
}
.login-hero h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.login-hero p {
  font-size: 14px;
  opacity: .85;
  letter-spacing: 1px;
}

.login-panel {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  width: 100%;
  max-width: 420px;
  padding: 0 20px 44px;
}
.login-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
}
.login-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-card .sub {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 22px;
}
.login-tip {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.7;
}

/* ============================================================
   信息页（登录后）
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 4px 14px;
}
.topbar .school {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
}
.topbar .school small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; }
.topbar .logout {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.greet {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  box-shadow: 0 10px 26px rgba(79, 70, 229, .3);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.greet::after {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.greet h3 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.greet p { font-size: 13px; opacity: .88; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.info-item {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.info-item .k { font-size: 12px; color: var(--text-3); letter-spacing: .5px; }
.info-item .v { font-size: 20px; font-weight: 800; color: var(--text); }

.dorm-card {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 26px rgba(14, 165, 233, .3);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.dorm-card::after {
  content: '';
  position: absolute;
  left: -40px; bottom: -50px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.dorm-card .left .k { font-size: 12px; opacity: .85; letter-spacing: 1px; }
.dorm-card .left .v { font-size: 40px; font-weight: 800; letter-spacing: 2px; line-height: 1.2; }
.dorm-card .right { font-size: 15px; font-weight: 600; background: rgba(255,255,255,.18); padding: 8px 14px; border-radius: 999px; }

/* ---- 校服意愿 ---- */
.uniform-title { font-size: 16px; font-weight: 800; margin: 4px 0 4px; display: flex; align-items: center; gap: 8px; }
.uniform-sub { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.choice {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .18s ease;
  background: #fff;
  user-select: none;
}
.choice .em { font-size: 30px; display: block; margin-bottom: 6px; }
.choice .t { font-size: 16px; font-weight: 700; color: var(--text); }
.choice .d { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.choice.selected-yes {
  border-color: var(--success);
  background: var(--success-light);
  box-shadow: 0 6px 18px rgba(22, 163, 74, .18);
}
.choice.selected-yes .t { color: var(--success); }
.choice.selected-no {
  border-color: var(--warn);
  background: var(--warn-light);
  box-shadow: 0 6px 18px rgba(217, 119, 6, .18);
}
.choice.selected-no .t { color: var(--warn); }

.saved-status {
  font-size: 13px;
  color: var(--text-2);
  background: var(--primary-light);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  display: none;
}
.saved-status.show { display: block; }
.saved-status b { color: var(--primary); }
.saved-status.status-yes { background: var(--success-light); color: #166534; }
.saved-status.status-yes b { color: var(--success); }
.saved-status.status-no { background: var(--warn-light); color: #92400e; }
.saved-status.status-no b { color: var(--warn); }

/* 毕业学校隐藏时：信息格只有 3 项，最后一项占满整行 */
.info-grid.three-items .info-item:last-child { grid-column: 1 / -1; }

/* ---- 登记照片 ---- */
.photo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.photo-preview {
  width: 150px;
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  background: #f1f5f9;
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { font-size: 13px; color: var(--text-3); text-align: center; line-height: 1.8; }
.photo-actions { display: flex; gap: 10px; width: 100%; }
.photo-actions .btn { flex: 1; padding: 13px; font-size: 15px; }
.photo-hint { font-size: 12px; color: var(--text-3); }

/* ============================================================
   管理端统计页
   ============================================================ */
.admin-login {
  max-width: 420px;
  margin: 0 auto;
  padding: 18vh 20px 40px;
}
.admin-login .card h2 { font-size: 18px; margin-bottom: 4px; }
.admin-login .card .sub { font-size: 13px; color: var(--text-2); margin-bottom: 20px; }

.stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  border-radius: 16px;
  padding: 16px;
  color: #fff;
  box-shadow: var(--shadow);
}
.stat-card .k { font-size: 12px; opacity: .9; letter-spacing: .5px; }
.stat-card .v { font-size: 26px; font-weight: 800; line-height: 1.3; }
.stat-card .p { font-size: 12px; opacity: .85; }
.stat-blue  { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-orange{ background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-gray  { background: linear-gradient(135deg, #94a3b8, #64748b); }
.stat-purple{ background: linear-gradient(135deg, #a855f7, #7c3aed); }

.table-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 18px;
}
.table-wrap h4 {
  padding: 14px 18px 0;
  font-size: 15px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: center; white-space: nowrap; }
th { color: var(--text-2); font-weight: 600; background: #f8fafc; }
tr + tr td { border-top: 1px solid var(--line); }
td.num { font-variant-numeric: tabular-nums; }
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.tag-yes { background: var(--success-light); color: var(--success); }
.tag-no  { background: var(--warn-light); color: var(--warn); }
.tag-none{ background: #f1f5f9; color: var(--text-3); }

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 14px;
}
.admin-bar h2 { font-size: 17px; font-weight: 800; }
.btn-sm {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 999px;
}

/* 大屏微调 */
@media (min-width: 720px) {
  .login-hero h1 { font-size: 34px; }
}
