:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
}

button {
  font: inherit;
}

.welcome-page {
  display: grid;
  min-height: 100svh;
  grid-template-rows: 1fr auto;
  row-gap: 16px;
  padding: 32px 20px;
  place-items: center;
  background-color: #a5a0a6;
  background-image: url("../welcome-background/desktop");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  isolation: isolate;
}

.welcome-page::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgb(30 44 63 / 10%), transparent 40%, rgb(25 36 57 / 7%));
  content: "";
  pointer-events: none;
}

.welcome-card {
  display: flex;
  width: min(100%, 402px);
  min-height: 450px;
  flex-direction: column;
  align-items: center;
  padding: 30px 28px 34px;
  border: 1px solid rgb(255 255 255 / 49%);
  border-radius: 25px;
  background: linear-gradient(155deg, rgb(255 255 255 / 36%), rgb(255 246 238 / 26%) 55%, rgb(255 255 255 / 39%));
  box-shadow: 0 20px 55px rgb(39 45 67 / 16%), inset 0 1px rgb(255 255 255 / 24%);
  text-align: center;
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  animation: card-appear 650ms ease-out both;
}

.welcome-avatar {
  display: block;
  width: 136px;
  height: 136px;
  border: 4px solid rgb(255 255 255 / 72%);
  border-radius: 50%;
  box-shadow: 0 7px 20px rgb(40 48 69 / 21%);
  object-fit: cover;
}

.welcome-card h1 {
  margin: 12px 0 5px;
  color: #243142;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(2.1rem, 3vw, 2.75rem);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.2;
}

.welcome-quote {
  margin: 14px 0 0;
  color: #344153;
  font-size: 15px;
  letter-spacing: 0.06em;
  line-height: 1.7;
}

.welcome-divider {
  width: 26px;
  height: 1px;
  margin: 23px 0 20px;
  background: rgb(41 55 73 / 68%);
}

.welcome-message {
  margin: 0 0 26px;
  color: #344153;
  font-size: 17px;
  letter-spacing: 0.13em;
  line-height: 1.6;
}

.enter-button {
  display: inline-flex;
  min-width: 226px;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 11px 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #5d7ba6, #466894);
  box-shadow: 0 8px 18px rgb(50 75 110 / 18%);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  letter-spacing: 0.15em;
  transition: box-shadow 180ms ease, transform 180ms ease, filter 180ms ease;
}

.enter-button:hover {
  box-shadow: 0 12px 23px rgb(50 75 110 / 25%);
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.enter-button:active {
  transform: translateY(0);
}

.enter-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.welcome-footer a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 84%);
  color: #243142;
  font-size: 12px;
  line-height: 1.5;
  text-underline-offset: 2px;
}

.welcome-page.is-leaving {
  animation: page-leave 420ms ease-in both;
}

@keyframes card-appear {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes page-leave {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (max-width: 640px) {
  .welcome-page {
    min-height: 100svh;
    align-items: start;
    padding: clamp(86px, 12svh, 130px) 18px 30px;
    background-image: url("../welcome-background/mobile");
    background-position: center top;
  }

  .welcome-page::before {
    background: linear-gradient(to bottom, rgb(46 54 82 / 8%), transparent 62%);
  }

  .welcome-card {
    width: min(100%, 368px);
    min-height: 0;
    padding: 20px 20px 23px;
    border-radius: 24px;
  }

  .welcome-avatar {
    width: 102px;
    height: 102px;
  }

  .welcome-card h1 {
    margin-top: 10px;
    font-size: 2.3rem;
  }

  .welcome-quote {
    margin-top: 10px;
    font-size: 13px;
    letter-spacing: 0.02em;
  }

  .welcome-divider {
    margin: 15px 0 13px;
  }

  .welcome-message {
    margin-bottom: 15px;
    font-size: 15px;
  }

  .enter-button {
    min-height: 48px;
    font-size: 16px;
  }
}

@media (max-width: 360px) {
  .welcome-page { padding-inline: 14px; }
  .welcome-card { padding-inline: 14px; }
  .welcome-quote { font-size: 12px; }
}

@media (max-width: 640px) and (max-height: 700px) {
  .welcome-page { padding-top: 42px; }
  .welcome-card { padding-top: 14px; padding-bottom: 18px; }
  .welcome-avatar { width: 82px; height: 82px; }
  .welcome-card h1 { margin-top: 7px; font-size: 2rem; }
  .welcome-quote { margin-top: 7px; }
  .welcome-divider { margin: 10px 0 9px; }
  .welcome-message { margin-bottom: 10px; }
  .enter-button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-card,
  .welcome-page.is-leaving { animation-duration: 1ms; }
  .enter-button { transition: none; }
}
