/* ==========================================================================
   经济学院秘书处 · 面试信息查询
   Palette and type inherit the department landing page (msc/style.css) so the
   tool reads as the same institution:
     --ink #142b4a · --blue #1769e0 · --sky #edf5ff · --yellow #ffd76a
   Two tokens are darkened for text use so every pair clears WCAG AA 4.5:1;
   see the contrast report in the handover notes.
   ========================================================================== */

:root {
  /* brand — taken from the department landing page (msc/style.css).
     --sky #edf5ff and --yellow #ffd76a are deliberately NOT reused: this page
     has no decorative tint block and no accent dot to spend them on. */
  --ink: #142b4a;
  --ink-deep: #102746;
  --blue: #1769e0;
  --blue-deep: #0f57bd;
  --sky-soft: #f5f9ff;
  --line: #dbe7f5;

  /* derived: text-safe neutrals */
  --muted: #55657d;          /* 5.9:1 on white — replaces brand #62738b (4.3:1) */
  --body: #2a3f5c;
  --field-border: #c9d7e8;
  --focus-ring: rgba(23, 105, 224, 0.28);

  /* on-navy result surfaces */
  --on-navy: #ffffff;
  --on-navy-soft: #cfe0f7;
  --on-navy-mute: #a9bdd8;
  --navy-line: rgba(207, 224, 247, 0.22);

  /* semantic */
  --warn-bg: #fff6d7;
  --warn-ink: #5a3f00;
  --err-bg: #fff0ef;
  --err-ink: #8f1d18;
  --err-line: #f0c4c0;

  /* shape — cards top out at 16px per the design system */
  --r-md: 10px;
  --r-lg: 16px;

  --shadow-md: 0 6px 18px rgba(20, 43, 74, 0.08);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--sky-soft);
  color: var(--body);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.18s var(--ease-out);
}

.skip-link:focus {
  top: 12px;
}

/* --------------------------------------------------------------- structure */

.msc-doc {
  width: min(680px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.masthead-text {
  min-width: 0;
}

.masthead-org {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.masthead-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------- headline */

.page-head {
  padding: 32px 0 26px;
}

.page-head h1 {
  margin: 0;
  color: var(--ink-deep);
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.page-head p {
  margin: 12px 0 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  text-wrap: pretty;
}

/* -------------------------------------------------------------- query form */

.query-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.query-card-head {
  padding: 22px 28px 0;
}

.query-card-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.query-card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.query-form {
  display: grid;
  gap: 18px;
  padding: 20px 28px 28px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--field-border);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* >=16px prevents iOS zoom-on-focus */
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field input:hover {
  border-color: #aec4de;
}

.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.field.has-error input {
  border-color: #d2493f;
}

.field.has-error input:focus {
  box-shadow: 0 0 0 4px rgba(210, 73, 63, 0.22);
}

.field-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.field-error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 7px 0 0;
  color: var(--err-ink);
  font-size: 12.5px;
  font-weight: 700;
}

/* ------------------------------------------------------------------ button */

.btn-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s var(--ease-out), transform 0.1s var(--ease-out);
}

.btn-submit:hover {
  background: var(--blue-deep);
}

.btn-submit:active {
  transform: translateY(1px);
}

.btn-submit:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.btn-submit[aria-busy="true"],
.btn-submit:disabled {
  cursor: progress;
  background: #6b93d6;
}

.btn-submit .arrow {
  transition: transform 0.2s var(--ease-out);
}

.btn-submit:hover .arrow {
  transform: translateX(3px);
}

.spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: msc-spin 0.7s linear infinite;
}

.btn-submit[aria-busy="true"] .spinner {
  display: block;
}

.btn-submit[aria-busy="true"] .arrow {
  display: none;
}

/* ------------------------------------------------------------------ alerts */

/* Holds an alert between the card head and the form fields. */
.alert-slot {
  padding: 16px 28px 2px;
}

.alert {
  display: flex;
  gap: 10px;
  margin: 0 0 6px;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.6;
}

.alert-icon {
  flex: none;
  margin-top: 1px;
  font-weight: 700;
}

.alert--warn {
  border-color: #f0dfae;
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.alert--error {
  border-color: var(--err-line);
  background: var(--err-bg);
  color: var(--err-ink);
}

.alert strong {
  font-weight: 700;
}

/* ------------------------------------------------------------------ result */

.result {
  margin-top: 4px;
  margin-bottom: 26px;
  border-radius: var(--r-lg);
  background: var(--ink-deep);
  color: var(--on-navy);
  overflow: hidden;
  animation: msc-result-in 0.42s var(--ease-out) both;
}

.result-head {
  padding: 20px 28px;
  border-bottom: 1px solid var(--navy-line);
}

.result-id {
  min-width: 0;
}

.result-name {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--on-navy);
  overflow-wrap: anywhere;
}

.result-no {
  margin: 4px 0 0;
  color: var(--on-navy-mute);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* status stamp — retired: two independent answers have no single honest
   summary, so the result panel reports both fields verbatim instead. */

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-item {
  padding: 18px 28px 20px;
}

.result-item + .result-item {
  border-left: 1px solid var(--navy-line);
}

.result-item dt {
  margin: 0;
  color: var(--on-navy-soft);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.result-item dd {
  margin: 8px 0 0;
  color: var(--on-navy);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.result-item dd.is-pending {
  color: var(--on-navy-soft);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}

.result-note {
  display: flex;
  gap: 12px;
  padding: 18px 28px 20px;
  border-top: 1px solid var(--navy-line);
}

.result-note-k {
  flex: none;
  color: var(--on-navy-soft);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.result-note-v {
  margin: 0;
  min-width: 0;
  color: var(--on-navy);
  font-size: 14.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.result-note-v.is-empty {
  color: var(--on-navy-mute);
}

/* ------------------------------------------------------------------ footer */

.page-foot {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-foot img {
  flex: none;
  width: 124px; /* keeps the Chinese wordmark legible */
  height: auto;
}

.page-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ------------------------------------------------------------------- motion */

@keyframes msc-result-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes msc-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ compact */

@media (max-width: 560px) {
  .msc-doc {
    width: min(100% - 28px, 680px);
    padding: 24px 0 40px;
  }

  .masthead {
    gap: 8px;
    padding-bottom: 15px;
  }

  .masthead-org {
    font-size: 14px;
  }

  .page-head {
    padding: 24px 0 20px;
  }

  .query-card-head,
  .query-form,
  .alert-slot {
    padding-left: 20px;
    padding-right: 20px;
  }

  .query-card-head {
    padding-top: 20px;
  }

  .query-form {
    padding-bottom: 22px;
  }

  .result-head {
    padding: 18px 20px;
  }

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

  .result-item {
    padding: 15px 20px 17px;
  }

  .result-item + .result-item {
    border-left: 0;
    border-top: 1px solid var(--navy-line);
  }

  .result-note {
    flex-direction: column;
    gap: 5px;
    padding: 16px 20px 18px;
  }
}

/* ------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .btn-submit:hover .arrow {
    transform: none;
  }
}

/* -------------------------------------------------------------- print/ref */

@media print {
  body {
    background: #fff;
  }

  .query-card,
  .page-foot,
  .skip-link {
    display: none !important;
  }

  .result {
    background: #fff;
    color: #000;
    border: 1px solid #000;
  }

  .result-name,
  .result-item dd,
  .result-note-v {
    color: #000;
  }

  .result-item dt,
  .result-note-k,
  .result-no {
    color: #333;
  }
}

/* ------------------------------------------------------------------- noscript */

.noscript-note {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid var(--err-line);
  border-radius: var(--r-md);
  background: var(--err-bg);
  color: var(--err-ink);
  font-size: 13.5px;
}
