:root {
  --ink: #143247;
  --muted: #7b92a3;
  --blue: #0a5cf5;
  --blue-deep: #02163f;
  --cyan: #43e5ff;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: #fff;
  background: #02163f;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

button {
  color: inherit;
}

.checkin-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 12% 18%, rgba(37, 177, 255, 0.16), transparent 38%),
    radial-gradient(ellipse at 90% 48%, rgba(35, 226, 255, 0.09), transparent 36%),
    linear-gradient(180deg, #02173f 0%, #062c76 46%, #031b4d 100%);
}

.checkin {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding-bottom: calc(26px + env(safe-area-inset-bottom));
}

/* 顶部导航 */
.checkin-nav {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(11px + env(safe-area-inset-top)) max(16px, calc((100vw - 620px) / 2 + 16px)) 11px;
  color: #fff;
}

.nav-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(1, 20, 68, 0.25);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.nav-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-spacer {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.nav-title {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 12px rgba(0, 15, 60, 0.35);
}

.nav-invite {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  color: rgba(238, 252, 255, 0.82);
  font-size: 9px;
  letter-spacing: 0.06em;
  background: rgba(1, 20, 68, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* 顶部主视觉 */
.checkin-hero {
  position: relative;
  height: auto;
  aspect-ratio: 1670 / 941;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
  background: #0637a8;
}

.checkin-hero picture,
.checkin-hero img {
  display: block;
  width: 100%;
  height: 100%;
}

.checkin-hero img {
  object-fit: cover;
  object-position: center center;
  transform: scale(1.025);
  animation: checkinHeroIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.checkin-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 13, 55, 0.16) 0%, transparent 26%, rgba(2, 22, 63, 0.66) 100%);
}

.checkin-hero-copy {
  position: absolute;
  right: 20px;
  bottom: 46px;
  left: 20px;
  z-index: 2;
  text-align: center;
}

.checkin-hero-copy p {
  margin: 0 0 5px;
  color: rgba(219, 248, 255, 0.66);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: 0.18em;
}

.checkin-hero-copy h1 {
  margin: 0;
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(26px, 7.2vw, 34px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  text-shadow: 0 3px 18px rgba(0, 18, 75, 0.45);
}

.checkin-hero-copy span {
  display: block;
  margin-top: 6px;
  color: rgba(227, 249, 255, 0.5);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
}

/* 表单区 */
.checkin-stage {
  position: relative;
  z-index: 3;
  margin-top: -28px;
  padding: 0 18px;
}

body.is-checked-in .checkin-hero {
  display: none;
}

body.is-checked-in .checkin-stage {
  margin-top: 0;
  padding-top: 18px;
}

.form-card,
.pass-card {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(252, 254, 255, 0.97);
  box-shadow: 0 24px 60px rgba(0, 12, 52, 0.34);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.form-card {
  padding: 27px 22px 22px;
  color: var(--ink);
  animation: cardIn 0.8s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.eyebrow {
  margin: 0 0 5px;
  color: #7e9bad;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8px;
  letter-spacing: 0.26em;
}

.form-card h2 {
  margin: 0;
  color: #0d304d;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.08em;
}

.form-intro {
  margin: 8px 0 20px;
  color: #7c92a2;
  font-size: 11px;
  line-height: 1.7;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field span {
  display: block;
  margin: 0 2px 6px;
  color: #46657b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.field i {
  color: #dd5662;
  font-style: normal;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(18, 97, 255, 0.16);
  border-radius: 9px;
  outline: none;
  background: #f6fbff;
  color: var(--ink);
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field input::placeholder {
  color: #a3b5c2;
  font-size: 13px;
}

.field input:focus {
  border-color: rgba(18, 112, 255, 0.7);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(24, 132, 255, 0.1);
}

.form-error {
  min-height: 17px;
  margin: 1px 2px 5px;
  color: #d84b59;
  font-size: 10.5px;
  line-height: 1.5;
}

.checkin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(100deg, #0840c6, #0d6eee 55%, #18b4f1);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  box-shadow: 0 11px 24px rgba(8, 72, 210, 0.22);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.checkin-btn:disabled {
  background: #d6e1e9;
  color: #92a6b4;
  box-shadow: none;
  cursor: not-allowed;
}

.checkin-btn:not(:disabled):active {
  transform: scale(0.985);
}

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

.checkin-btn.is-loading .btn-spinner {
  display: block;
}

.form-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid rgba(23, 74, 130, 0.09);
}

.form-links a {
  color: #7490a4;
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.form-links a:last-child {
  color: #0b61d8;
}

/* 签到成功卡 */
.pass-card {
  color: var(--ink);
  animation: passIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pass-hero {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: #0637a8;
}

.pass-hero picture,
.pass-hero img {
  display: block;
  width: 100%;
  height: 100%;
}

.pass-hero img {
  object-fit: cover;
  object-position: center 38%;
}

.pass-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 16, 62, 0.18), rgba(1, 22, 70, 0.7));
}

.pass-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 82px;
  margin: 0 0 4px;
}

.guest-badge {
  padding: 5px 10px;
  border: 1px solid rgba(19, 99, 190, 0.18);
  border-radius: 20px;
  background: #edf6ff;
  color: #24669e;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.checked-stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  border: 3px double #d43d3d;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #d43d3d;
  box-shadow: 0 4px 13px rgba(178, 44, 44, 0.16), inset 0 0 0 3px rgba(255, 255, 255, 0.8);
  transform: rotate(-11deg);
}

.stamp-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1;
  text-align: center;
}

.stamp-inner strong {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
}

.stamp-inner small {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 5px;
  letter-spacing: 0.13em;
}

.pass-hero-title {
  position: absolute;
  right: 16px;
  bottom: 14px;
  left: 16px;
  z-index: 2;
  color: #fff;
}

.pass-hero-title p {
  margin: 0 0 3px;
  color: rgba(229, 250, 255, 0.64);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.pass-hero-title span {
  color: rgba(233, 252, 255, 0.48);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8px;
  letter-spacing: 0.3em;
}

.pass-body {
  padding: 18px 22px 21px;
  text-align: center;
}

.pass-body h2 {
  margin: 3px 0 7px;
  color: #0c2e4b;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
}

.pass-company {
  margin: 0 0 4px;
  color: #405e73;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.5;
}

.pass-position {
  margin: 0;
  color: #8a9eac;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.pass-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 12px;
  margin: 18px 0 16px;
  padding: 13px 0;
  border-top: 1px dashed rgba(23, 74, 130, 0.13);
  border-bottom: 1px dashed rgba(23, 74, 130, 0.13);
  text-align: left;
}

.pass-meta span {
  color: #8da1ae;
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.pass-meta strong {
  color: #29495f;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.pass-note {
  margin: 0 0 16px;
  color: #8da2b0;
  font-size: 9.5px;
  line-height: 1.7;
}

.pass-home {
  width: 100%;
  height: 43px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(100deg, #0840c6, #0d6eee 55%, #18b4f1);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  box-shadow: 0 9px 20px rgba(8, 72, 210, 0.2);
}

.checkin-foot {
  margin: 15px 0 0;
  color: rgba(195, 235, 255, 0.36);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-align: center;
}

/* 未报名弹窗 */
.checkin-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 15, 48, 0.72);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 370px;
  padding: 30px 22px 20px;
  border-radius: 16px;
  background: #fbfdff;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 8, 36, 0.4);
  animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close {
  position: absolute;
  top: 9px;
  right: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f0f7fd;
  color: #6f8fa4;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.modal-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 11px;
  border-radius: 50%;
  background: #eef7ff;
  color: #0d6de0;
}

.modal-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.modal-card h2 {
  margin: 5px 0 7px;
  color: #12344c;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.04em;
}

.modal-card > p:not(.eyebrow) {
  margin: 0 0 19px;
  color: #7f94a3;
  font-size: 11px;
  line-height: 1.65;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.primary-link,
.ghost-link {
  font: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 8px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

.primary-link {
  background: linear-gradient(100deg, #0840c6, #0d6eee 55%, #18b4f1);
  color: #fff;
}

.ghost-link {
  border: 1px solid rgba(18, 97, 255, 0.16);
  background: #fff;
  color: #5b788c;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  z-index: 120;
  max-width: 86vw;
  padding: 9px 15px;
  border-radius: 20px;
  background: rgba(4, 23, 61, 0.9);
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

@keyframes checkinHeroIn {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
  to {
    opacity: 1;
    transform: scale(1.025);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes passIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@media (min-width: 641px) {
  .checkin {
    padding-top: 0;
  }

  .checkin-nav {
    padding-right: 16px;
    padding-left: 16px;
  }

  .checkin-hero {
    border-radius: 0 0 28px 28px;
  }

  .form-card,
  .pass-card {
    max-width: 450px;
  }
}

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