:root {
  --ink: #123b6d;
  --ink-soft: #39638d;
  --blue: #287bd8;
  --blue-deep: #0f5fb6;
  --blue-light: #d9efff;
  --card: rgba(255, 255, 255, 0.94);
  --line: rgba(39, 120, 203, 0.18);
  --shadow: 0 24px 70px rgba(31, 101, 169, 0.18);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #e8f7ff;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.92) 0 8%, transparent 24%),
    radial-gradient(circle at 88% 20%, rgba(192, 229, 255, 0.85) 0 9%, transparent 27%),
    linear-gradient(160deg, #f7fcff 0%, #dff3ff 47%, #b9defb 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  content: "";
}

body::before {
  inset: 0;
  background-image:
    linear-gradient(rgba(28, 111, 189, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 111, 189, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 74%, transparent);
}

body::after {
  width: 220px;
  height: 220px;
  right: -90px;
  top: 10vh;
  border: 1px solid rgba(40, 123, 216, 0.14);
  border-radius: 50%;
  box-shadow: -210px 470px 0 -56px rgba(255, 255, 255, 0.42);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(26px, env(safe-area-inset-bottom));
}

.skyline {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(100vw, 520px);
  transform: translateX(-50%);
  opacity: 0.42;
  pointer-events: none;
}

.skyline svg {
  display: block;
  width: 100%;
  height: auto;
}

svg path,
svg circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skyline svg {
  color: rgba(21, 98, 177, 0.2);
}

.screen {
  display: none;
  min-height: calc(100vh - 44px);
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  animation: riseIn 0.42s ease both;
}

.screen.is-active {
  display: flex;
}

.brand-lockup {
  width: 100%;
  margin-bottom: 18px;
  text-align: center;
}

.cap-mark,
.camera-mark,
.invite-icon {
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  color: var(--blue-deep);
  background: linear-gradient(145deg, #ffffff, #d7efff);
  border: 1px solid rgba(40, 123, 216, 0.18);
  box-shadow: 0 15px 34px rgba(34, 114, 194, 0.18);
}

.cap-mark {
  width: 82px;
  height: 82px;
  border-radius: 25px;
  transform: rotate(-3deg);
}

.cap-mark svg,
.camera-mark svg,
.invite-icon svg {
  width: 70%;
  height: 70%;
}

.camera-mark {
  width: 74px;
  height: 74px;
  border-radius: 23px;
}

.invite-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 7px;
  color: #5b91c5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  color: #0c4f9f;
  font-size: clamp(34px, 10vw, 46px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 10px;
  color: #0c4f9f;
  font-size: 28px;
  line-height: 1.2;
  text-align: center;
}

h3 {
  margin: 22px 0 12px;
  font-size: 17px;
}

.subtitle {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

.subtitle.compact {
  margin-bottom: 20px;
  text-align: center;
}

.card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, #6bc2ff, #1d75cf, #a9dbff);
  content: "";
}

.form-card {
  padding: 32px 22px 24px;
}

.teacher-card {
  text-align: left;
}

.field-label {
  display: block;
  margin-bottom: 9px;
  color: #265f99;
  font-size: 14px;
  font-weight: 800;
}

input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  color: var(--ink);
  border: 1px solid rgba(40, 123, 216, 0.23);
  border-radius: 18px;
  outline: 0;
  background: #f8fcff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus {
  border-color: rgba(15, 95, 182, 0.58);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(40, 123, 216, 0.12);
}

input::placeholder {
  color: #91abc5;
}

.error-message {
  display: none;
  margin: 10px 2px 0;
  color: #d13d3d;
  font-size: 13px;
  line-height: 1.5;
}

.error-message.is-visible {
  display: block;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, #1b78d5, #0f57a8);
  box-shadow: 0 16px 28px rgba(15, 95, 182, 0.24);
}

.ghost-button {
  color: var(--blue-deep);
  border: 1px solid rgba(15, 95, 182, 0.24);
  background: #edf8ff;
}

.primary-button:active,
.ghost-button:active {
  transform: scale(0.98);
}

.intro-card {
  padding: 28px 18px 22px;
}

.success-pill {
  width: fit-content;
  margin: 2px auto 16px;
  padding: 7px 13px;
  color: #0d61ae;
  border: 1px solid rgba(24, 128, 212, 0.18);
  border-radius: 999px;
  background: #e9f7ff;
  font-size: 13px;
  font-weight: 800;
}

.intro-text {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.85;
}

.class-photo-card {
  margin: 18px 0 20px;
}

.photo-frame {
  position: relative;
  overflow: hidden;
  padding: 7px;
  border: 1px solid rgba(40, 123, 216, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(119, 198, 255, 0.9), rgba(15, 95, 182, 0.48)) border-box;
  box-shadow: 0 18px 40px rgba(31, 101, 169, 0.15);
}

.photo-frame::after {
  position: absolute;
  top: 12px;
  right: 14px;
  padding: 5px 9px;
  color: #0c5fac;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 800;
  content: "班级大合照";
}

.photo-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
}

.class-photo-card figcaption {
  margin-top: 9px;
  color: #5e88ae;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}

.info-grid {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.info-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fcff, #eef8ff);
}

.info-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #1a73c9;
  border-radius: 14px;
  background: #ffffff;
}

.info-icon svg {
  width: 24px;
  height: 24px;
}

.info-item span,
.invite-details span,
.message-box span {
  display: block;
  margin-bottom: 4px;
  color: #6590b7;
  font-size: 12px;
  font-weight: 800;
}

.info-item strong,
.invite-details strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.message-box {
  padding: 15px;
  border-radius: 18px;
  background: #f1f9ff;
}

.message-box p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.invite-personal {
  margin-bottom: 14px;
  text-align: left;
}

.student-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-wall span {
  padding: 7px 10px;
  color: #275c91;
  border: 1px solid rgba(39, 120, 203, 0.15);
  border-radius: 999px;
  background: #f7fcff;
  font-size: 13px;
  line-height: 1;
}

.invitation-card {
  padding: 24px 19px 20px;
  text-align: center;
}

.invite-topline {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: #6b99c4;
  font-size: 11px;
  font-weight: 800;
}

.greeting {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.class-line {
  margin-bottom: 20px;
  color: #4f779e;
  font-size: 15px;
}

.invite-copy {
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f0f9ff);
  text-align: left;
}

.invite-copy p {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.85;
}

.invite-copy p:last-child {
  margin-bottom: 0;
}

.invite-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0;
  text-align: left;
}

.invite-details div {
  padding: 13px 14px;
  border-radius: 18px;
  background: #edf8ff;
}

blockquote {
  margin: 0;
  padding: 15px 16px;
  color: var(--ink-soft);
  border-left: 4px solid #2b86dc;
  border-radius: 16px;
  background: #f7fcff;
  font-size: 14px;
  line-height: 1.75;
  text-align: left;
}

.signature {
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-align: right;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.button-row .primary-button,
.button-row .ghost-button {
  min-height: 48px;
  margin-top: 18px;
  border-radius: 16px;
  font-size: 15px;
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100vw - 42px);
  padding: 12px 16px;
  color: #ffffff;
  border-radius: 999px;
  background: rgba(15, 67, 120, 0.92);
  box-shadow: 0 12px 28px rgba(9, 51, 91, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

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

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

@media (min-width: 430px) {
  .app-shell {
    padding-inline: 24px;
  }

  .info-grid,
  .invite-details {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 14px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 25px;
  }

  .form-card,
  .intro-card,
  .invitation-card {
    padding-inline: 15px;
  }

  .button-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
