:root {
  --xy-primary: #0f3d6e;
  --xy-primary-2: #1769aa;
  --xy-bg: #f5f8fc;
  --xy-sidebar: #0d233d;
  --xy-card: #ffffff;
  --xy-text: #172033;
  --xy-muted: #6c7a89;
  --xy-border: #e6edf5;
  --xy-shadow: 0 18px 50px rgba(24, 48, 79, .10);
  --xy-radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--xy-text);
}

.admin-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 5%, rgba(23, 105, 170, .12), transparent 28%),
    linear-gradient(135deg, #f7faff, #eef4fb);
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.admin-sidebar {
  background:
    radial-gradient(circle at 30% 0%, rgba(255,255,255,.12), transparent 25%),
    linear-gradient(180deg, #102b49, #061729);
  color: #fff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1030;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 18px;
}

.admin-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: rgba(255,255,255,.13);
  border-radius: 15px;
  padding: 5px;
}

.admin-brand-title {
  font-weight: 800;
  line-height: 1.25;
}

.admin-brand-sub {
  font-size: 12px;
  opacity: .72;
}

.admin-user-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  padding: 14px;
  margin: 18px 0;
}

.muted-label {
  font-size: 12px;
  color: rgba(255,255,255,.62);
  margin-bottom: 4px;
}

.admin-user-name {
  font-weight: 800;
  margin-bottom: 8px;
}

.admin-status-text {
  font-size: 13px;
  color: rgba(255,255,255,.68);
}

.admin-nav .nav-link {
  color: rgba(255,255,255,.78);
  border-radius: 15px;
  padding: 13px 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-nav .nav-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.admin-nav .nav-link.active {
  background: rgba(255,255,255,.16);
  color: #fff;
  font-weight: 800;
}

.admin-main {
  padding: 28px;
  min-width: 0;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 28px;
  font-weight: 900;
  margin: 0;
}

.page-subtitle {
  color: var(--xy-muted);
  font-size: 14px;
  margin-top: 4px;
}

.system-pill {
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(230,237,245,.9);
  box-shadow: 0 10px 28px rgba(24,48,79,.08);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.mobile-topbar {
  display: none;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--xy-border);
  border-radius: 18px;
  padding: 10px 12px;
  margin-bottom: 16px;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(24,48,79,.08);
}

.dashboard-hero {
  border-radius: 30px;
  padding: 30px;
  background:
    radial-gradient(circle at 85% 10%, rgba(255,255,255,.22), transparent 28%),
    linear-gradient(135deg, #0f3d6e, #1769aa);
  color: #fff;
  box-shadow: 0 24px 70px rgba(15,61,110,.22);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  overflow: hidden;
}

.dashboard-hero h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 900;
  margin: 8px 0;
}

.dashboard-hero p {
  max-width: 620px;
  opacity: .84;
  margin: 0;
}

.dashboard-kicker {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .68;
}

.dashboard-hero-icon {
  width: 112px;
  height: 112px;
  border-radius: 34px;
  background: rgba(255,255,255,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  flex: 0 0 auto;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card,
.panel-card {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(230,237,245,.92);
  border-radius: var(--xy-radius);
  box-shadow: var(--xy-shadow);
}

.metric-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 124px;
}

.metric-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  flex: 0 0 auto;
}

.metric-icon.blue {
  background: rgba(23,105,170,.12);
  color: #1769aa;
}

.metric-icon.green {
  background: rgba(25,135,84,.12);
  color: #198754;
}

.metric-icon.amber {
  background: rgba(217,164,65,.15);
  color: #b98212;
}

.metric-icon.purple {
  background: rgba(111,66,193,.12);
  color: #6f42c1;
}

.metric-label {
  color: var(--xy-muted);
  font-size: 13px;
  margin-bottom: 5px;
}

.metric-value {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.metric-value-sm {
  font-size: 22px;
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel-card {
  padding: 22px;
}

.panel-heading {
  font-size: 21px;
  font-weight: 900;
  margin-bottom: 8px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-title-row h3 {
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 4px;
}

.panel-title-row p {
  color: var(--xy-muted);
  margin: 0;
  font-size: 14px;
}

.year-bars {
  display: grid;
  gap: 16px;
}

.year-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
}

.year-bar-track {
  height: 12px;
  border-radius: 999px;
  background: #edf3f9;
  overflow: hidden;
}

.year-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1769aa, #53a7e8);
}

.overview-list {
  display: grid;
  gap: 12px;
}

.overview-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: #f7fafd;
  border: 1px solid var(--xy-border);
  border-radius: 16px;
  padding: 14px;
}

.overview-item span {
  color: var(--xy-muted);
}

.overview-item i {
  color: var(--xy-primary-2);
  margin-right: 6px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.quick-action {
  border: 1px solid var(--xy-border);
  background: rgba(255,255,255,.9);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--xy-shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
  color: var(--xy-text);
  transition: .18s ease;
}

.quick-action:hover {
  transform: translateY(-2px);
  border-color: rgba(23,105,170,.35);
}

.quick-action i {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(23,105,170,.10);
  color: var(--xy-primary-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar-left {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-left .form-control {
  width: 280px;
}

.toolbar-left .form-select {
  width: 160px;
}

.form-control,
.form-select,
.btn {
  border-radius: 13px;
}

.admin-table {
  min-width: 850px;
}

.admin-table thead th {
  color: #657489;
  font-weight: 800;
  white-space: nowrap;
  background: #f8fbff;
}

.admin-table td {
  vertical-align: middle;
}

.log-agent {
  max-width: 380px;
  word-break: break-all;
}

.pagination .page-link {
  border-radius: 10px;
  margin: 0 3px;
  border-color: var(--xy-border);
}

.sidebar-mask {
  display: none;
}

@media (max-width: 1200px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    transform: translateX(-105%);
    transition: .22s ease;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.36);
    z-index: 1020;
  }

  .sidebar-mask.show {
    display: block;
  }

  .mobile-topbar {
    display: flex;
  }

  .admin-main {
    padding: 16px;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .system-pill {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .dashboard-hero {
    padding: 22px;
  }

  .dashboard-hero-icon {
    display: none;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .toolbar-left,
  .toolbar-left .form-control,
  .toolbar-left .form-select,
  .toolbar-left .btn,
  .toolbar > .btn {
    width: 100%;
  }

  .panel-card {
    padding: 16px;
    border-radius: 18px;
  }

  .page-title {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .admin-main {
    padding: 12px;
  }

  .dashboard-hero h2 {
    font-size: 24px;
  }

  .metric-card {
    min-height: auto;
    padding: 16px;
  }

  .metric-value {
    font-size: 30px;
  }
}

.import-guide {
  background: #f7fafd;
  border: 1px solid var(--xy-border);
  border-radius: 18px;
  padding: 16px;
  margin: 18px 0 22px;
}

.import-guide-title {
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--xy-primary);
}

@media (max-width: 768px) {
  #downloadStudentsBtn {
    width: 100%;
  }
}

/* =========================
   Admission Query Ultra UI
   ========================= */

.admission-query-body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #061729;
  color: #172033;
  touch-action: pan-y;
}

.admission-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(112, 193, 255, .28), transparent 34%),
    radial-gradient(circle at 8% 78%, rgba(217, 164, 65, .18), transparent 32%),
    linear-gradient(135deg, #061729 0%, #0f3d6e 48%, #07182c 100%);
}

.luxury-gradient {
  position: absolute;
  inset: -30%;
  background:
    conic-gradient(from 160deg at 50% 50%,
      rgba(255,255,255,.04),
      rgba(83,167,232,.18),
      rgba(217,164,65,.12),
      rgba(255,255,255,.04));
  animation: luxurySpin 18s linear infinite;
}

@keyframes luxurySpin {
  to { transform: rotate(360deg); }
}

.light-beam {
  position: absolute;
  width: 42vw;
  height: 160vh;
  top: -35vh;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.12), transparent);
  filter: blur(18px);
  transform: rotate(26deg);
  animation: beamMove 8s ease-in-out infinite;
}

.beam-1 { left: 8%; }
.beam-2 { right: 4%; animation-delay: -3s; opacity: .6; }

@keyframes beamMove {
  0%,100% { transform: translateX(-6vw) rotate(26deg); opacity: .28; }
  50% { transform: translateX(8vw) rotate(26deg); opacity: .72; }
}

.floating-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 0 22px rgba(255,255,255,.8);
  animation: particleFloat 7s ease-in-out infinite;
}

.p1 { left: 16%; top: 18%; animation-delay: 0s; }
.p2 { left: 78%; top: 24%; animation-delay: -1.2s; }
.p3 { left: 68%; top: 72%; animation-delay: -2.4s; }
.p4 { left: 22%; top: 80%; animation-delay: -3.6s; }
.p5 { left: 48%; top: 12%; animation-delay: -4.8s; }

@keyframes particleFloat {
  0%,100% { transform: translateY(0) scale(.8); opacity: .32; }
  50% { transform: translateY(-36px) scale(1.25); opacity: .92; }
}

.grid-glow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

.admission-shell {
  width: min(1120px, calc(100vw - 28px));
  margin: 0 auto;
  min-height: 100vh;
  padding: max(22px, env(safe-area-inset-top)) 0 42px;
}

.envelope-stage {
  min-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .45s ease, transform .45s ease;
}

.envelope-stage.hide {
  display: none;
}

.premium-glass {
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 70px rgba(0,0,0,.22);
}

.school-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  margin-bottom: 26px;
  padding: 12px 16px;
  border-radius: 999px;
}

.school-mark img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 15px;
  background: rgba(255,255,255,.14);
  padding: 5px;
}

.school-name {
  font-weight: 950;
  font-size: 17px;
  letter-spacing: .02em;
}

.school-motto {
  font-size: 12px;
  opacity: .72;
}

.envelope-wrap {
  position: relative;
  width: min(600px, 90vw);
  height: min(390px, 58vw);
  min-height: 292px;
  perspective: 1400px;
  cursor: grab;
}

.envelope-aura {
  position: absolute;
  inset: 7%;
  border-radius: 42px;
  background: radial-gradient(circle, rgba(255,255,255,.24), transparent 64%);
  filter: blur(34px);
  animation: auraPulse 3s ease-in-out infinite;
}

@keyframes auraPulse {
  0%,100% { opacity: .42; transform: scale(.96); }
  50% { opacity: .9; transform: scale(1.06); }
}

.envelope-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -28px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,.34);
  filter: blur(16px);
}

.envelope {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: envelopeFloat 4s ease-in-out infinite;
}

@keyframes envelopeFloat {
  0%, 100% { transform: translateY(0) rotateX(0deg) rotateZ(-.4deg); }
  50% { transform: translateY(-12px) rotateX(2deg) rotateZ(.4deg); }
}

.envelope-back,
.envelope-front,
.envelope-left,
.envelope-right,
.envelope-bottom,
.envelope-flap,
.letter-preview {
  position: absolute;
  inset: 0;
  border-radius: 28px;
}

.envelope-back {
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(218,232,246,.98));
  box-shadow: 0 34px 110px rgba(0,0,0,.30);
}

.letter-preview {
  left: 8%;
  right: 8%;
  top: 8%;
  bottom: 20%;
  background:
    radial-gradient(circle at 80% 0%, rgba(217,164,65,.18), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(246,250,255,.98));
  border: 1px solid rgba(15,61,110,.08);
  box-shadow: 0 22px 50px rgba(15,61,110,.16);
  transform: translateY(18%);
  transition: transform 1.05s cubic-bezier(.16,.9,.22,1), opacity .9s ease;
  z-index: 1;
  padding: 30px;
  overflow: hidden;
}

.letter-glow {
  position: absolute;
  inset: -60% -20%;
  background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.7), transparent 65%);
  transform: translateX(-80%);
  animation: paperShine 5s ease-in-out infinite;
}

@keyframes paperShine {
  0%, 55% { transform: translateX(-80%); }
  80%, 100% { transform: translateX(80%); }
}

.letter-topline {
  width: 84px;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, #d9a441, #f4d58b);
  margin-bottom: 22px;
}

.letter-title {
  font-size: clamp(24px, 4.3vw, 36px);
  font-weight: 950;
  color: #0f3d6e;
  letter-spacing: -.03em;
}

.letter-subtitle {
  color: #7a8897;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 5px 0 26px;
}

.letter-line {
  height: 10px;
  border-radius: 999px;
  background: #d8e5f2;
  margin-bottom: 12px;
}

.letter-line.w80 { width: 80%; }
.letter-line.w60 { width: 60%; }
.letter-line.w70 { width: 70%; }

.letter-seal {
  position: absolute;
  right: 26px;
  bottom: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(217,164,65,.72);
  color: #b98212;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  transform: rotate(-12deg);
}

.envelope-left {
  clip-path: polygon(0 0, 52% 50%, 0 100%);
  background: linear-gradient(135deg, #e5eef8, #cbdced);
  z-index: 3;
}

.envelope-right {
  clip-path: polygon(100% 0, 48% 50%, 100% 100%);
  background: linear-gradient(225deg, #e8f0f8, #ccddec);
  z-index: 3;
}

.envelope-bottom {
  clip-path: polygon(0 100%, 50% 42%, 100% 100%);
  background: linear-gradient(180deg, #d9e7f4, #bfcede);
  z-index: 4;
}

.envelope-flap {
  clip-path: polygon(0 0, 50% 58%, 100% 0);
  background:
    radial-gradient(circle at 50% 6%, rgba(255,255,255,.96), transparent 40%),
    linear-gradient(180deg, #f8fbff, #dbe8f5);
  transform-origin: top center;
  transition: transform 1.08s cubic-bezier(.16,.9,.22,1), filter .8s ease;
  z-index: 5;
}

.envelope-front {
  z-index: 6;
  inset: auto 8% 15% 8%;
  height: 38%;
  background:
    radial-gradient(circle at 90% 0%, rgba(217,164,65,.20), transparent 32%),
    linear-gradient(135deg, rgba(15,61,110,.96), rgba(23,105,170,.92));
  border: 1px solid rgba(255,255,255,.20);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  box-shadow: 0 20px 44px rgba(15,61,110,.28);
  overflow: hidden;
}

.front-shine {
  position: absolute;
  inset: -80% -20%;
  background: linear-gradient(120deg, transparent 36%, rgba(255,255,255,.28), transparent 62%);
  transform: translateX(-90%);
  animation: frontShine 4.8s ease-in-out infinite;
}

@keyframes frontShine {
  0%, 55% { transform: translateX(-90%); }
  85%, 100% { transform: translateX(90%); }
}

.front-title {
  font-size: 12px;
  letter-spacing: .17em;
  text-transform: uppercase;
  opacity: .68;
  position: relative;
}

.front-main {
  font-size: clamp(23px, 4vw, 35px);
  font-weight: 950;
  margin-top: 4px;
  position: relative;
}

.front-sub {
  font-size: 13px;
  opacity: .70;
  margin-top: 4px;
  position: relative;
}

.wax-seal {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #f0c06b, #b98212 58%, #7f5510);
  z-index: 8;
  box-shadow:
    0 12px 28px rgba(0,0,0,.24),
    0 0 28px rgba(217,164,65,.32);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff8df;
  font-weight: 950;
  border: 2px solid rgba(255,255,255,.24);
  animation: sealPulse 2.2s ease-in-out infinite;
}

@keyframes sealPulse {
  0%,100% { box-shadow: 0 12px 28px rgba(0,0,0,.24), 0 0 20px rgba(217,164,65,.22); }
  50% { box-shadow: 0 16px 36px rgba(0,0,0,.28), 0 0 42px rgba(217,164,65,.55); }
}

.swipe-hint {
  margin-top: 38px;
  text-align: center;
  color: rgba(255,255,255,.82);
  user-select: none;
}

.swipe-track {
  height: 52px;
  display: grid;
  place-items: center;
  gap: 0;
  margin-bottom: 4px;
}

.swipe-track i {
  display: block;
  font-size: 26px;
  line-height: 14px;
  animation: swipeArrow 1.25s ease-in-out infinite;
}

.swipe-track i:nth-child(2) {
  animation-delay: .16s;
  opacity: .55;
}

@keyframes swipeArrow {
  0% { transform: translateY(12px); opacity: 0; }
  45% { opacity: 1; }
  100% { transform: translateY(-12px); opacity: 0; }
}

.swipe-text {
  font-weight: 900;
  letter-spacing: .06em;
}

.envelope-stage.opening .envelope {
  animation: none;
}

.envelope-stage.opening .wax-seal {
  animation: sealBreak .55s ease forwards;
}

@keyframes sealBreak {
  to {
    transform: translate(-50%, -50%) scale(.12) rotate(28deg);
    opacity: 0;
  }
}

.envelope-stage.opening .envelope-flap {
  transform: rotateX(176deg);
  filter: brightness(1.06);
}

.envelope-stage.opening .letter-preview {
  transform: translateY(-58%) scale(1.045);
}

.envelope-stage.opening .letter-glow {
  animation: paperOpenGlow .9s ease forwards;
}

@keyframes paperOpenGlow {
  from { transform: translateX(-80%); }
  to { transform: translateX(95%); }
}

.envelope-stage.opening .envelope-wrap {
  animation: envelopeExit 1.05s .32s cubic-bezier(.16,.9,.22,1) forwards;
}

@keyframes envelopeExit {
  to {
    transform: translateX(-42vw) translateY(4vh) rotate(-9deg) scale(.94);
    opacity: 0;
  }
}

.envelope-stage.opening .school-mark,
.envelope-stage.opening .swipe-hint {
  animation: fadeDown .52s ease forwards;
}

@keyframes fadeDown {
  to {
    opacity: 0;
    transform: translateY(18px);
  }
}

.query-stage {
  display: none;
  padding-top: 28px;
  animation: queryIn .72s cubic-bezier(.16,.9,.22,1) forwards;
}

.query-stage.show {
  display: block;
}

@keyframes queryIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(.975);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.premium-card,
.query-card {
  width: min(760px, 100%);
  margin: 0 auto;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 34px;
  box-shadow:
    0 36px 110px rgba(0,0,0,.24),
    inset 0 1px 0 rgba(255,255,255,.72);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.query-card-header {
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  background:
    radial-gradient(circle at 88% 0%, rgba(217,164,65,.24), transparent 30%),
    linear-gradient(135deg, rgba(15,61,110,.99), rgba(23,105,170,.94));
  color: #fff;
}

.query-logo {
  width: 64px;
  height: 64px;
  border-radius: 21px;
  background: rgba(255,255,255,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}

.query-logo img {
  width: 49px;
  height: 49px;
  object-fit: contain;
}

.query-kicker {
  font-size: 13px;
  opacity: .72;
  margin-bottom: 4px;
}

.query-card-header h2 {
  margin: 0;
  font-weight: 950;
  font-size: clamp(26px, 5vw, 38px);
}

.query-card-body {
  padding: 30px;
}

.query-intro {
  background:
    radial-gradient(circle at 90% 0%, rgba(83,167,232,.12), transparent 38%),
    #f7fafd;
  border: 1px solid #e6edf5;
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 22px;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f3d6e;
  font-weight: 900;
  margin-bottom: 8px;
}

.query-intro p {
  margin: 0;
  color: #6c7a89;
  line-height: 1.7;
}

.floating-field {
  position: relative;
  margin-bottom: 16px;
}

.floating-field input {
  width: 100%;
  height: 58px;
  border-radius: 18px;
  border: 1px solid #dce7f2;
  background: #fff;
  padding: 22px 16px 8px;
  font-size: 16px;
  outline: none;
  transition: .18s ease;
}

.floating-field label {
  position: absolute;
  left: 16px;
  top: 18px;
  color: #7b8998;
  pointer-events: none;
  transition: .18s ease;
}

.floating-field input:focus,
.floating-field input:not(:placeholder-shown) {
  border-color: #1769aa;
  box-shadow: 0 0 0 4px rgba(23,105,170,.10);
}

.floating-field input:focus + label,
.floating-field input:not(:placeholder-shown) + label {
  top: 8px;
  font-size: 12px;
  color: #1769aa;
  font-weight: 800;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 142px;
  gap: 12px;
}

.captcha-input {
  margin-bottom: 0;
}

.captcha-display {
  height: 58px;
  border-radius: 18px;
  border: 1px solid #dce7f2;
  background:
    linear-gradient(135deg, #f8fbff, #e7f0f8);
  color: #0f3d6e;
  font-weight: 950;
  letter-spacing: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

.query-submit-btn {
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 18px;
  margin-top: 20px;
  background: linear-gradient(135deg, #0f3d6e, #1769aa);
  color: #fff;
  font-weight: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 18px 42px rgba(15,61,110,.22);
}

.query-submit-btn:disabled {
  opacity: .75;
}

.query-tips {
  margin-top: 18px;
  display: grid;
  gap: 8px;
  color: #6c7a89;
  font-size: 14px;
}

.query-tips i {
  color: #198754;
}

.result-notice-card {
  display: none;
  width: min(760px, 100%);
  margin: 22px auto 0;
  background:
    radial-gradient(circle at 90% 0%, rgba(217,164,65,.16), transparent 32%),
    rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 30px;
  box-shadow: 0 28px 90px rgba(0,0,0,.22);
  overflow: hidden;
  position: relative;
}

.result-notice-card.show {
  display: block;
  animation: resultIn .55s cubic-bezier(.16,.9,.22,1) forwards;
}

@keyframes resultIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.notice-ribbon {
  background: linear-gradient(135deg, #d9a441, #f1cf80);
  color: #432f08;
  font-weight: 950;
  padding: 10px 24px;
  letter-spacing: .08em;
}

.notice-header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid #e6edf5;
}

.notice-title {
  font-size: 26px;
  font-weight: 950;
  color: #0f3d6e;
}

.notice-message {
  color: #198754;
  font-weight: 800;
  margin-top: 4px;
}

.notice-stamp {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid rgba(25,135,84,.5);
  color: #198754;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  transform: rotate(-10deg);
  flex: 0 0 auto;
}

.notice-table-wrap {
  padding: 10px 24px 24px;
}

.notice-table th {
  width: 34%;
  color: #6c7a89;
  font-weight: 800;
  padding: 14px 0;
}

.notice-table td {
  color: #172033;
  font-weight: 900;
  padding: 14px 0;
}

.query-footer {
  color: rgba(255,255,255,.62);
  text-align: center;
  padding: 28px 0 0;
  font-size: 13px;
}

.query-status-pill {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1000;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  box-shadow: 0 14px 38px rgba(0,0,0,.16);
  backdrop-filter: blur(14px);
  color: #6c7a89;
}

.query-status-pill.status-ok {
  color: #198754;
}

.query-status-pill.status-bad {
  color: #dc3545;
}

@media (max-width: 768px) {
  .admission-shell {
    width: min(100vw - 22px, 560px);
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .envelope-stage {
    min-height: calc(100vh - 74px);
    justify-content: center;
  }

  .school-mark {
    width: 100%;
    border-radius: 24px;
    justify-content: flex-start;
    margin-bottom: 22px;
  }

  .envelope-wrap {
    width: 94vw;
    max-width: 450px;
    height: 318px;
    min-height: 318px;
  }

  .letter-preview {
    padding: 22px;
  }

  .swipe-hint {
    margin-top: 34px;
  }

  @keyframes envelopeExit {
    to {
      transform: translateX(-76vw) translateY(3vh) rotate(-10deg) scale(.92);
      opacity: 0;
    }
  }

  .query-stage {
    padding-top: 10px;
  }

  .query-card {
    border-radius: 28px;
  }

  .query-card-header {
    padding: 22px;
  }

  .query-card-body {
    padding: 20px;
  }

  .captcha-row {
    grid-template-columns: 1fr;
  }

  .captcha-display {
    width: 100%;
  }

  .notice-header {
    padding: 20px;
  }

  .notice-stamp {
    width: 64px;
    height: 64px;
    font-size: 14px;
  }

  .notice-table-wrap {
    padding: 8px 20px 20px;
  }

  .notice-table th,
  .notice-table td {
    display: block;
    width: 100%;
    padding: 8px 0;
  }

  .notice-table tr {
    border-bottom: 1px solid #edf3f9;
  }

  .query-status-pill {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .envelope-wrap {
    height: 292px;
    min-height: 292px;
  }

  .front-main {
    font-size: 22px;
  }

  .front-sub {
    font-size: 12px;
  }

  .query-card-body {
    padding: 18px;
  }

  .query-logo {
    width: 54px;
    height: 54px;
  }

  .query-logo img {
    width: 42px;
    height: 42px;
  }
}