/* ==========================================================================
   国培科创 · 证书查询
   视觉规范：白头部 + 深蓝 banner + 浅灰内容 + 白色卡片 + 深色页脚
   ========================================================================== */

:root {
  --navy: #16324f;
  --primary: #1f4e9c;
  --accent: #f39800;
  --teal: #17b8ad;
  --teal-soft: #69c5bd;

  --ink: #333333;
  --muted: #777777;
  --muted-2: #98a6b8;
  --placeholder: #8b9bb0;

  --bg: #f5f7fa;
  --white: #ffffff;
  --border: #e5eaf2;
  --border-strong: #dbe4f0;
  --danger: #d93025;

  --font-cn: "Source Han Sans CN", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-en: "Helvetica Neue", Arial, sans-serif;

  --radius-panel: 14px;
  --radius-field: 10px;
  --shadow-panel: 0 18px 44px rgba(20, 40, 80, 0.1), 0 2px 8px rgba(20, 40, 80, 0.04);
  --shadow-card: 0 10px 30px rgba(20, 40, 80, 0.07);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 页面骨架 ---------------------------------------------------------------- */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

/* 顶部白头部 -------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(20, 40, 80, 0.08);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 18px clamp(20px, 4.5vw, 56px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
}

.brand__logo {
  width: auto;
  height: 40px;
}

.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--white);
  color: var(--primary);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.topbar__link svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

.topbar__link:hover {
  border-color: var(--primary);
  background: #f5f8fc;
}

.topbar__link:hover svg {
  transform: translate(1px, -1px);
}

.topbar__link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 深蓝 banner ------------------------------------------------------------- */

.hero {
  position: relative;
  width: 100%;
  height: clamp(240px, 24vw, 440px);
  overflow: hidden;
  background: var(--navy);
  color: #f1f7f7;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 760px);
  height: 100%;
  margin: 0 auto;
  padding: 24px 24px 56px;
  text-align: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: #a0c6ce;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.hero__eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: rgba(160, 198, 206, 0.6);
}

.hero__title {
  margin: 0;
  padding-left: 0.16em;
  color: #f1f7f7;
  font-size: clamp(34px, 3.4vw, 50px);
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.25;
  text-shadow: 0 2px 18px rgba(4, 18, 32, 0.28);
}

.hero__rule {
  width: 36px;
  height: 2px;
  margin: 16px 0 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--teal), var(--teal-soft));
}

.hero__subtitle {
  margin: 0;
  color: #bad1d8;
  font-size: 13px;
  letter-spacing: 0.2em;
}

/* 内容区 ------------------------------------------------------------------ */

.main {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 20px 72px;
  background-color: var(--bg);
  background-image: radial-gradient(58% 42% at 50% 0%, rgba(31, 78, 156, 0.075), rgba(31, 78, 156, 0) 70%);
}

.main::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(31, 78, 156, 0.055) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
  pointer-events: none;
}

/* 查询卡片 ---------------------------------------------------------------- */

.panel {
  position: relative;
  z-index: 2;
  width: min(100%, 640px);
  margin-top: -56px;
  padding: 36px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}

.panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 56px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  opacity: 0.9;
}

.query-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field__label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.field__required {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.field__icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: #8fa2b8;
  pointer-events: none;
  transition: color 0.2s ease;
}

.field__input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-field);
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field__input::placeholder {
  color: var(--placeholder);
}

.field__input:hover {
  border-color: #c3d3e6;
}

.field__input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(31, 78, 156, 0.1);
}

.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--white) inset;
  -webkit-text-fill-color: var(--ink);
  transition: background-color 5000s ease-in-out 0s;
}

.field__error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.field__error:not(:empty) {
  min-height: 16px;
  margin-top: 7px;
}

.field.is-invalid .field__input {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.08);
}

.field.is-invalid .field__icon {
  color: var(--danger);
}

/* 提交按钮 ---------------------------------------------------------------- */

.submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin-top: 4px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-field);
  background: linear-gradient(135deg, var(--primary), #2a63a8);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(31, 78, 156, 0.22);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.submit:hover {
  background: linear-gradient(135deg, #1a448a, #245796);
  box-shadow: 0 14px 26px rgba(31, 78, 156, 0.26);
  transform: translateY(-1px);
}

.submit:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(31, 78, 156, 0.2);
}

.submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(31, 78, 156, 0.18), 0 10px 22px rgba(31, 78, 156, 0.22);
}

.submit:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.submit__arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.submit:hover .submit__arrow {
  transform: translateX(3px);
}

.submit__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.submit.is-loading .submit__spinner {
  display: block;
}

.submit.is-loading .submit__arrow {
  display: none;
}

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

.form__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 0;
  color: #74839a;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-align: center;
}

.form__note svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--primary);
  opacity: 0.8;
}

/* 查询结果 ---------------------------------------------------------------- */

.results {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  margin-top: 44px;
  scroll-margin-top: 78px;
}

.results__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 12px;
}

.results__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.results__title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(243, 152, 0, 0.12);
}

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

.results__list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result-card {
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #f7f9fc;
}

.result-card__img {
  width: 100%;
  height: auto;
}

.result-card__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 4px 1px;
}

.result-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #66788c;
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.result-card__meta svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
}

.result-card__download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid #c9d8ee;
  border-radius: 999px;
  color: var(--primary);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.result-card__download svg {
  width: 14px;
  height: 14px;
}

.result-card__download:hover {
  border-color: var(--primary);
  background: #f2f7fd;
}

.result-card__download:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.result-card__download[aria-disabled="true"] {
  opacity: 0.42;
  pointer-events: none;
}

.result-card__fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 300px;
  padding: 24px;
  background: #f7f9fc;
  color: #8a97a8;
  font-size: 12.5px;
  text-align: center;
}

.result-card__fallback svg {
  width: 44px;
  height: 44px;
  color: #b3c1d2;
}

.result-card__frame--error {
  border: 1px dashed #c9d8ee;
  background: #f7f9fc;
}

.result-card__frame--error .result-card__fallback {
  color: #7b8ba0;
}

.result-card__frame--error .result-card__fallback svg {
  color: var(--primary);
  opacity: 0.7;
}

/* 空结果 ------------------------------------------------------------------ */

.notice {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  width: min(100%, 640px);
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 40, 80, 0.06);
  scroll-margin-top: 78px;
}

.notice__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eef4fb;
  color: var(--primary);
}

.notice__icon svg {
  width: 20px;
  height: 20px;
}

.notice__title {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.notice__desc {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

/* 轻提示 ------------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 11px 20px;
  border-radius: 8px;
  background: #1c2331;
  color: var(--white);
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 32px rgba(10, 25, 45, 0.22);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 深色页脚 ---------------------------------------------------------------- */

.footer {
  background: #1c2331;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 26px clamp(20px, 4.5vw, 56px);
}

.footer__logo {
  width: auto;
  height: 30px;
  opacity: 0.95;
}

.footer__copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* 响应式 ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .hero {
    height: 280px;
  }

  .panel {
    margin-top: -48px;
  }
}

@media (max-width: 640px) {
  .topbar__inner {
    padding: 14px 18px;
  }

  .brand__logo {
    height: 30px;
  }

  .topbar__link {
    padding: 8px 12px;
    font-size: 11.5px;
  }

  .hero {
    height: 240px;
  }

  .hero__inner {
    padding: 20px 20px 44px;
  }

  .hero__eyebrow {
    margin-bottom: 10px;
    font-size: 10px;
    letter-spacing: 0.26em;
  }

  .hero__title {
    font-size: 32px;
    letter-spacing: 0.14em;
  }

  .hero__rule {
    margin: 13px 0 11px;
  }

  .hero__subtitle {
    font-size: 12px;
  }

  .main {
    padding: 0 16px 52px;
  }

  .panel {
    margin-top: -36px;
    padding: 22px 18px;
    border-radius: 12px;
  }

  .panel::before {
    width: 48px;
  }

  .query-form {
    gap: 16px;
  }

  .field__label {
    font-size: 12.5px;
  }

  .field__input,
  .submit {
    height: 50px;
  }

  .submit {
    font-size: 14.5px;
  }

  .field__icon {
    left: 14px;
    width: 17px;
    height: 17px;
  }

  .field__input {
    padding-left: 42px;
  }

  .form__note {
    font-size: 11.5px;
  }

  .results {
    margin-top: 34px;
  }

  .results__head {
    padding-bottom: 10px;
  }

  .results__title {
    font-size: 14px;
  }

  .result-card {
    padding: 10px;
    border-radius: 10px;
  }

  .result-card__bar {
    padding-top: 11px;
  }

  .result-card__fallback {
    min-height: 200px;
  }

  .notice {
    gap: 12px;
    padding: 16px;
  }

  .notice__icon {
    width: 38px;
    height: 38px;
  }

  .notice__desc {
    font-size: 12px;
  }

  .footer__inner {
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 22px 20px;
    text-align: center;
  }

  .footer__logo {
    height: 26px;
  }

  .toast {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .hero {
    height: 220px;
  }

  .hero__title {
    font-size: 28px;
  }

  .panel {
    padding: 20px 14px;
  }
}

@media (min-width: 641px) and (max-height: 820px) {
  .hero {
    height: 260px;
  }

  .panel {
    margin-top: -40px;
    padding: 30px 36px;
  }

  .main {
    padding-bottom: 32px;
  }

  .footer__inner {
    padding-top: 20px;
    padding-bottom: 20px;
  }
}

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

  .result-card {
    animation: none;
  }
}

/* 无脚本提示 -------------------------------------------------------------- */

.noscript {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 8px;
  background: #1c2331;
  color: #fff;
  font-size: 13px;
  transform: translateX(-50%);
}
