:root {
  --blue: #0738bd;
  --ink: #12439f;
  --gold: #efc96e;
  --gold-deep: #aa711c;
  --max-width: 750px;
}

@font-face {
  font-family: "SOURCEHANSERIFCN-HEAVY";
  src: url("../SOURCEHANSERIFCN-HEAVY.OTF?v=20260910-heavy-3") format("opentype");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "SOURCEHANSERIFCN-MEDIUM";
  src: url("../SOURCEHANSERIFCN-MEDIUM.OTF?v=20260910-medium-4") format("opentype");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 0;
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #03185d;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  color: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.is-sheet-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
img {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.page {
  position: relative;
  width: min(100%, var(--max-width));
  height: auto;
  aspect-ratio: 750 / 1624;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: var(--blue);
}

.page-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.stage-background {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.stage-background.is-missing {
  display: none;
}

.image-layer {
  display: block;
  max-width: 100%;
  object-fit: contain;
}

.image-layer.is-missing,
.image-button.is-missing {
  display: none;
}

.brand-lockup {
  position: absolute;
  top: 11.6995%;
  left: 27.7333%;
  z-index: 4;
  width: 44.6667%;
}

.brand-lockup img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-fallback {
  display: none;
  color: #fff;
  font-family: Georgia, "Songti SC", serif;
  font-size: 12px;
  text-align: center;
}

.brand-lockup img.is-missing + .brand-fallback {
  display: block;
}

.brand-note {
  margin: 2px 0 0;
  color: rgba(235, 244, 255, 0.82);
  font-family: Georgia, "Songti SC", serif;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-align: center;
}

.title-art {
  position: absolute;
  top: 26.9089%;
  left: 7.2%;
  z-index: 3;
  width: 85.6%;
  height: auto;
}

.title-fallback {
  display: none;
  color: var(--gold);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.title-art.is-missing + .title-fallback {
  position: absolute;
  top: 26.9089%;
  left: 7.2%;
  display: block;
  width: 85.6%;
}

.image-button {
  display: block;
  height: auto;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.image-button:hover,
.image-button:active {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.button-fallback {
  display: none;
  place-items: center;
  min-height: 38px;
  color: var(--gold-deep);
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: #ffedb9;
  cursor: pointer;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 20px;
  font-weight: 700;
}

.image-button.is-missing + .button-fallback {
  display: grid;
}

.cover-page .brand-note {
  margin-top: 1px;
}

.vertical-cover-title {
  position: absolute;
  top: 27.2167%;
  left: 38.9333%;
  z-index: 3;
  width: 23.4667%;
  height: auto;
}

.vertical-cover-fallback {
  display: none;
}

.vertical-cover-title.is-missing + .vertical-cover-fallback {
  position: absolute;
  top: 27.2167%;
  left: 38.9333%;
  display: block;
  width: 23.4667%;
  color: var(--gold);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 32px;
  line-height: 1.5;
  writing-mode: vertical-rl;
}

.cover-enter {
  position: absolute;
  top: 73.5222%;
  left: 24.6667%;
  z-index: 3;
  width: 50.6667%;
}

.cover-enter-fallback {
  position: absolute;
  top: 73.5222%;
  left: 24.6667%;
  width: 50.6667%;
}

.form-page .title-art {
  top: 26.9089%;
}

.profile-form {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.profile-fields {
  position: absolute;
  top: 47.7833%;
  left: 15%;
  display: grid;
  gap: min(64px, 8.5333vw);
  width: 70%;
}

.asset-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.name-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: min(30px, 4vw);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.name-placeholder.is-hidden {
  visibility: hidden;
}

.asset-input,
.year-select {
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 412 / 82;
  padding: 0 min(30px, 4vw);
  overflow: hidden;
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  outline: 0;
  background: #fff url("./images/input-art.png") center / 100% 100% no-repeat;
  text-align: center !important;
  text-indent: 0;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: min(30px, 4vw);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.asset-input::placeholder {
  opacity: 0;
}

.year-select {
  position: relative;
  cursor: pointer;
}

.year-value {
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.year-value.is-placeholder {
  font-size: min(30px, 4vw);
}

.year-value.has-value {
  font-size: min(30px, 4vw);
}

.year-chevron,
.field-caption {
  display: none;
}

.form-error {
  position: absolute;
  top: 70%;
  left: 0;
  width: 100%;
  min-height: 18px;
  margin: 0;
  color: #ffe2a0;
  font-size: 11px;
  text-align: center;
}

.profile-form .image-button {
  position: absolute;
  top: 73.5222%;
  left: 24.6667%;
  z-index: 5;
  width: 50.6667%;
}

.profile-form .button-fallback {
  position: absolute;
  top: 73.5222%;
  left: 24.6667%;
  z-index: 5;
  width: 50.6667%;
}

.ornament-frame {
  position: absolute;
  top: 39.1626%;
  left: 15.7333%;
  z-index: 1;
  width: 68.5333%;
  height: auto;
}

.ornament-frame.is-missing {
  display: none;
}

.year-picker {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.year-picker.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.year-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 15, 68, 0.74);
}

.year-sheet {
  position: relative;
  width: min(100%, 430px);
  max-height: min(62svh, 500px);
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  color: var(--ink);
  border-radius: 16px 16px 0 0;
  background: #f8fbff;
  box-shadow: 0 -10px 30px rgba(0, 13, 75, 0.28);
  transform: translateY(100%);
  transition: transform 220ms ease;
}

.year-picker.is-open .year-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 7px;
  border-radius: 99px;
  background: #bfd1ea;
}

.year-sheet-header {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid #e0eafa;
}

.year-sheet-header h2 {
  margin: 0;
  color: #2552a0;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 20px;
  text-align: center;
}

.sheet-close,
.sheet-confirm {
  min-height: 34px;
  padding: 0;
  color: #3166b4;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.sheet-close {
  justify-self: start;
  width: 36px;
  font-size: 26px;
  font-weight: 300;
}

.sheet-confirm {
  justify-self: end;
  font-size: 14px;
}

.year-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: calc(min(62svh, 500px) - 82px);
  padding: 14px 1px 2px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.year-option {
  min-height: 38px;
  color: #5577ad;
  border: 1px solid #d8e4f4;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.year-option.is-selected {
  color: #fff;
  border-color: #2772d5;
  background: #2772d5;
  box-shadow: 0 4px 9px rgba(39, 114, 213, 0.24);
}

.letter-stage {
  position: absolute;
  inset: 0;
}

.letter-envelope {
  position: absolute;
  top: 5.234%;
  left: 2.6667%;
  z-index: 1;
  width: 94.8%;
  height: auto;
}

.letter-fallback-envelope {
  display: none;
}

.letter-envelope.is-missing + .letter-fallback-envelope {
  position: absolute;
  top: 14%;
  left: 8%;
  display: block;
  width: 84%;
  height: 70%;
  border: 1px solid #d29a34;
  background: linear-gradient(155deg, #eef6ff, #0b45a6);
  clip-path: polygon(0 23%, 50% 0, 100% 23%, 100% 100%, 0 100%);
}

.letter-logos {
  position: absolute;
  top: 13.916%;
  left: 34%;
  z-index: 3;
  width: 32.1333%;
  height: auto;
}

.letter-title-image {
  position: absolute;
  top: 16.5%;
  left: 62.5%;
  z-index: 4;
  width: 23.4667%;
  height: auto;
}

.letter-content {
  position: absolute;
  top: 24.138%;
  left: 16.8%;
  right: 16.8%;
  bottom: 28%;
  z-index: 4;
  width: auto;
  overflow: visible;
  color: #063b99;
  font-family: "SimSun", "STSong", "Songti SC", serif;
}

.letter-content h2 {
  margin: 0 0 0 min(16px, 2.1333vw);
  color: #073d9d;
  max-width: 100%;
  overflow: hidden;
  font-family: "SOURCEHANSERIFCN-MEDIUM" !important;
  font-size: min(26px, 3.4667vw);
  font-weight: 400 !important;
  font-synthesis: none;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.letter-content .duration-line {
  margin: min(32px, 4.2667vw) 0 0;
  overflow: hidden;
  color: #c39135;
  font-family: "SOURCEHANSERIFCN-MEDIUM" !important;
  font-size: min(46px, 6.1333vw);
  font-weight: 400 !important;
  font-synthesis: none;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.letter-content .letter-copy {
  margin: min(35px, 4.6667vw) 0 0;
  max-width: 100%;
  overflow: visible;
  color: #063b99;
  font-size: var(--letter-copy-size, min(26px, 3.4667vw));
  font-family: "SOURCEHANSERIFCN-HEAVY" !important;
  font-weight: 400 !important;
  font-synthesis: none;
  line-height: 2;
  text-align: justify;
  text-indent: 2em;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  text-justify: inter-ideograph;
}

.letter-content .letter-copy-second {
  margin-top: 0;
  margin-bottom: min(88px, 11.7333vw);
  text-align: left;
}

.letter-content .copy-no-break {
  display: inline;
  text-indent: 0;
  white-space: normal;
}

.letter-content .letter-year {
  position: absolute;
  right: 0;
  width: max-content;
  bottom: 0;
  margin: 0;
  max-width: 100%;
  overflow: visible;
  color: #073d9d;
  font-family: "SOURCEHANSERIFCN-HEAVY" !important;
  font-size: var(--letter-copy-size, min(26px, 3.4667vw));
  font-weight: 400 !important;
  font-synthesis: none;
  line-height: 1.5;
  text-align: center;
}

.letter-share {
  position: absolute;
  top: 83.743%;
  left: 30%;
  z-index: 6;
  width: 40%;
}

.letter-share-fallback {
  position: absolute;
  top: 83.743%;
  left: 30%;
  z-index: 6;
  width: 40%;
}

.share-page {
  background: #031d68;
}

.share-page .share-dialog {
  position: absolute;
  top: 6.5271%;
  left: 50%;
  width: 86.9333%;
  max-width: 652px;
  aspect-ratio: 652 / 1412;
  margin: 0;
  transform: translateX(-50%);
}

.share-page .share-dim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.42);
}

.share-page .share-panel {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 18px;
}

.share-page .share-poster {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 100%;
  max-width: 652px;
  max-height: none;
  height: auto;
  border: 0;
  border-radius: 0;
  -webkit-touch-callout: default;
  pointer-events: auto;
  user-select: none;
}

.share-page .share-poster.is-missing {
  display: none;
}

.share-page .poster-fallback {
  position: absolute;
  top: 6.2%;
  left: 2.6074%;
  z-index: 3;
  display: none;
  width: 94.7853%;
  max-width: 618px;
  max-height: none;
  aspect-ratio: 618 / 1312;
  background: url("./images/envelope.png") center / 100% 100% no-repeat;
}

.share-page .share-dialog.poster-ready .share-qr,
.share-page .share-dialog.poster-ready .share-qr-caption {
  display: none;
}

.share-page .share-poster.is-missing + .poster-fallback {
  display: block;
}

.share-page .share-long {
  position: absolute;
  top: 83.5694%;
  left: 32.6667%;
  z-index: 6;
  width: 34.6667%;
  pointer-events: none;
}

.share-page .share-long-fallback {
  position: absolute;
  top: 83.5694%;
  left: 32.6667%;
  z-index: 6;
  width: 34.6667%;
  pointer-events: none;
}

.share-page .share-qr {
  position: absolute;
  top: 92.35%;
  left: 66.67%;
  z-index: 5;
  width: 13.33%;
  height: auto;
  object-fit: contain;
}

.share-page .share-qr-caption {
  position: absolute;
  top: 95.18%;
  right: 34.1%;
  z-index: 5;
  width: 25.3%;
  color: #fff;
  font-family: "SimSun", "STSong", serif;
  font-size: 15px;
  line-height: 1.5;
  text-align: right;
  white-space: nowrap;
}

.share-page .share-qr-caption span,
.share-page .share-qr-caption strong {
  display: block;
  font-weight: 400;
}

.share-page .share-qr-caption strong {
  font-weight: 700;
}

.share-page .share-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: block;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  background: rgba(0, 0, 0, 0.68);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.share-page .share-mask.is-open {
  opacity: 1;
  pointer-events: auto;
}

.share-page .share-mask:not(.is-open) .share-poster,
.share-page .share-mask:not(.is-open) .poster-fallback {
  pointer-events: none;
}

.share-page .share-mask.is-open .share-poster {
  pointer-events: auto;
}

.share-tip {
  position: relative;
  width: min(290px, 84vw);
  margin-top: 12px;
  padding: 18px 16px;
  color: #173d95;
  border: 1px solid var(--gold);
  background: #f9fcff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.share-tip .tip-arrow {
  position: absolute;
  top: 11px;
  right: 18px;
  width: 31px;
  height: 31px;
  border-top: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  transform: rotate(-20deg);
}

.share-tip h3 {
  position: relative;
  margin: 0 0 7px;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 21px;
}

.share-tip p {
  position: relative;
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

.share-tip button {
  position: relative;
  display: block;
  margin: 12px 0 0 auto;
  padding: 3px 0;
  color: #2c61ad;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

@media (min-width: 600px) {
  .page {
    margin-top: 18px;
    margin-bottom: 18px;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
  }
}

@media (max-height: 680px) and (min-width: 600px) {
  .brand-lockup {
    top: 9.5%;
  }

  .cover-page .vertical-cover-title {
    top: 23%;
  }

  .cover-page .cover-enter,
  .cover-page .cover-enter-fallback {
    top: 72.5%;
  }

  .form-page .title-art {
    top: 22%;
  }

  .profile-fields {
    top: 42%;
    gap: min(30px, 4vw);
  }

  .profile-form .image-button,
  .profile-form .button-fallback {
    top: 68%;
  }

  .share-page .share-long,
  .share-page .share-long-fallback {
    top: 83.5694%;
  }
}
