:root {
  --scale: 1;
  --stage-w: 852px;
  --stage-h: 1846px;
  --gold: #ffd76b;
  --gold-deep: #ffc63d;
  --ink: #0a2a63;
  --text: #e8f1ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: #07143a;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.stage-wrap {
  position: relative;
  width: var(--stage-w);
  height: var(--stage-h);
  flex: none;
}

.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 852px;
  height: 1846px;
  transform: scale(var(--scale));
  transform-origin: top left;
  overflow: hidden;
  background: #0a2c86;
}

.stage-bg {
  position: absolute;
  inset: 0;
  width: 852px;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* 右上角品牌卡通形象（从 家书banner.psd 抠出，四页统一） */
.brand-mascot {
  position: absolute;
  right: 38px;
  top: 44px;
  width: 141px;
  height: 140px;
  z-index: 5;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 6px 14px rgba(2, 10, 40, .45));
}

/* ============ 聚合页：标题与三张卡片使用设计稿切图，交互为 DOM ============ */

.hero-sub {
  position: absolute;
  left: 0; top: 340px; width: 852px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 20px;
  letter-spacing: 1px;
  color: #dce8ff;
}
.hero-sub .sub-line {
  width: 56px; height: 1px;
  background: rgba(225, 238, 255, .8);
  flex: none;
}

/* 卡片切图：按设计稿画布坐标定位 */
.card-cut {
  position: absolute;
  z-index: 2;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.card-intro { left: 16px; top: 776px; width: 824px; height: 272px; }
.card-letter { left: 23px; top: 1082px; width: 804px; height: 214px; }
.card-service { left: 27px; top: 1327px; width: 797px; height: 221px; }

/* 切图上按钮位置的可点击热区 */
.hotspot {
  position: absolute;
  z-index: 5;
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 40px;
  outline-offset: 4px;
}
.hotspot:focus-visible { outline: 3px solid #fff; }
.hotspot-letter { left: 655px; top: 1170px; width: 157px; height: 50px; }
.hotspot-service { left: 655px; top: 1424px; width: 157px; height: 36px; }

/* ============ 家书页：标题用设计稿原图，表单/控件为 DOM 元素 ============ */
.letter-title-img {
  position: absolute;
  left: 40px; top: 150px;
  width: 772px; height: 402px;
  z-index: 2;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.back-link {
  position: absolute;
  left: 30px; top: 26px; z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 2px solid rgba(255, 214, 102, .92);
  background: linear-gradient(180deg, rgba(12, 46, 120, .95), rgba(5, 24, 78, .95));
  color: #ffe9b0;
  border-radius: 40px;
  padding: 7px 24px 7px 7px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(2, 10, 40, .55), 0 0 20px rgba(255, 205, 90, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
  backdrop-filter: blur(8px);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.back-ico {
  width: 38px; height: 38px;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff0bd 0%, #ffcf5c 60%, #f5b32f 100%);
  color: #0a2c86;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.back-ico svg { width: 21px; height: 21px; }
.back-link:hover {
  transform: translateX(-3px);
  background: linear-gradient(180deg, rgba(18, 58, 145, .98), rgba(8, 32, 96, .98));
  box-shadow: 0 6px 24px rgba(2, 10, 40, .6), 0 0 28px rgba(255, 205, 90, .5), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.back-link:active { transform: translateX(-1px) scale(.97); }

.form-panel {
  position: absolute;
  left: 94px; top: 910px; width: 662px; height: 390px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  border-radius: 30px;
  border: 2px solid rgba(192, 226, 255, .92);
  background: linear-gradient(180deg, rgba(36, 104, 208, .74), rgba(6, 42, 125, .84));
  box-shadow: inset 0 0 32px rgba(90, 160, 255, .26), 0 0 26px rgba(120, 180, 255, .26);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 40px;
}
.form-row {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex; align-items: center; gap: 18px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
  cursor: text;
}
button.form-row { cursor: pointer; }
.form-row:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50px; right: 0; bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, .36);
}
.row-icon {
  width: 36px; height: 36px; flex: none;
  color: #ffffff;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .3));
}
.row-value, .row-input {
  flex: 1; min-width: 0;
  height: 100%;
  border: 0; outline: 0;
  background: transparent;
  color: #fff;
  font-size: 26px;
  font-family: inherit;
  letter-spacing: .5px;
}
.row-input::placeholder { color: rgba(255, 255, 255, .88); opacity: 1; }
.row-value { display: flex; align-items: center; }
.row-value.placeholder { color: rgba(255, 255, 255, .88); }
.row-chevron { width: 24px; height: 24px; flex: none; color: #cfe2ff; }

.generate-btn {
  position: absolute;
  left: 131px; top: 1391px; width: 584px; height: 106px;
  z-index: 4;
  border: 0;
  border-radius: 55px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  font-family: inherit;
  font-size: 34px; font-weight: 700; letter-spacing: 2px;
  color: var(--ink);
  background: linear-gradient(180deg, #fff2bd 0%, #ffdc73 42%, #ffc63f 100%);
  box-shadow: 0 12px 30px rgba(255, 183, 45, .34), inset 0 3px 0 rgba(255, 255, 255, .7);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .15s ease, box-shadow .15s ease;
}
.generate-btn:hover { transform: translateY(-2px); }
.generate-btn:active { transform: translateY(1px); }
.generate-btn svg { width: 40px; height: 40px; }

.consent-row {
  position: absolute;
  left: 94px; top: 1526px;
  z-index: 4;
  display: flex; align-items: center; gap: 18px;
  white-space: nowrap;
  cursor: pointer;
}
.check-input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  width: 32px; height: 32px; flex: none;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 5px;
  background: #082973;
  display: flex; align-items: center; justify-content: center;
}
.check-box::after {
  content: "";
  width: 15px; height: 9px;
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(-45deg) translate(1px, -2px);
  opacity: 0;
}
.check-input:checked + .check-box { background: var(--gold-deep); border-color: var(--gold-deep); }
.check-input:checked + .check-box::after { opacity: 1; }
.check-input:focus-visible + .check-box { outline: 3px solid #fff; outline-offset: 3px; }
.consent-text { font-size: 20px; line-height: 31px; color: #eaf2ff; }

/* ============ 下拉 / 弹层 / 提示 ============ */
.dropdown {
  position: absolute;
  z-index: 10;
  width: 560px;
  max-height: 292px;
  overflow-y: auto;
  background: rgba(4, 28, 92, .97);
  border: 2px solid rgba(255, 215, 107, .65);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 10, 50, .55);
  padding: 8px 0;
  display: none;
}
.dropdown.open { display: block; }
.dropdown-item {
  width: 100%;
  border: 0; background: transparent;
  color: #eaf2ff;
  font-family: inherit; font-size: 24px;
  padding: 15px 26px;
  text-align: left;
  cursor: pointer;
}
.dropdown-item:hover, .dropdown-item.active { background: rgba(255, 215, 107, .16); color: var(--gold); }

.modal-mask {
  position: absolute; inset: 0;
  z-index: 20;
  background: rgba(2, 12, 42, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
}
.modal-mask.open { display: flex; }
.modal-card {
  width: 660px;
  max-height: 1500px;
  overflow-y: auto;
  border-radius: 28px;
  padding: 46px 46px 40px;
  background: linear-gradient(160deg, #123a9e, #071a58 70%);
  border: 2px solid rgba(255, 215, 107, .75);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45), inset 0 0 60px rgba(80, 140, 255, .18);
  position: relative;
}
.modal-title {
  margin: 0 0 22px;
  font-size: 38px; color: var(--gold);
  text-align: center; letter-spacing: 2px;
}
.modal-actions { display: flex; gap: 18px; margin-top: 34px; }
.modal-btn {
  flex: 1; height: 72px;
  border-radius: 36px;
  border: 2px solid rgba(255, 215, 107, .8);
  background: transparent;
  color: var(--gold);
  font-family: inherit; font-size: 25px; font-weight: 600;
  cursor: pointer;
}
.modal-btn.primary {
  background: linear-gradient(180deg, #fff0b6, #ffc63f);
  color: var(--ink); border-color: transparent;
}
.modal-close {
  position: absolute; right: 22px; top: 16px;
  border: 0; background: transparent;
  color: rgba(255, 255, 255, .75);
  font-size: 40px; line-height: 1; cursor: pointer;
}
.service-tip { font-size: 25px; line-height: 44px; color: #e9f2ff; }
.service-tip strong { color: var(--gold); }

.toast {
  position: fixed;
  left: 50%; bottom: 48px;
  transform: translate(-50%, 20px);
  background: rgba(6, 24, 76, .95);
  border: 1px solid rgba(255, 215, 107, .7);
  color: #fff; font-size: 16px;
  padding: 12px 24px; border-radius: 30px;
  z-index: 999;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 写家书加载页 ============ */
/* 进度条贴合设计稿：轨道 x103-745 y1544-1573（宽642 高29） */
.write-loading {
  position: absolute;
  left: 103px; top: 1543px;
  width: 642px; height: 30px;
  z-index: 3;
  pointer-events: none;
}
.write-bar {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(120, 155, 215, .28), rgba(40, 75, 150, .30));
  border: 2px solid rgba(205, 224, 255, .82);
  box-shadow: 0 0 10px rgba(150, 190, 255, .35), inset 0 1px 3px rgba(255, 255, 255, .22);
}
.write-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 13px;
  background: linear-gradient(90deg, #fff6d8 0%, #ffe6a4 55%, #ffd17a 100%);
  box-shadow: 0 0 16px rgba(255, 210, 120, .85), inset 0 1px 2px rgba(255, 255, 255, .8);
}
/* 填充右端的发光圆点 */
.write-bar-dot {
  position: absolute;
  left: 0%; top: 50%;
  width: 30px; height: 30px;
  margin-left: -15px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #fff 0%, #fff8e2 40%, #ffdf9a 66%, rgba(255, 210, 120, .2) 78%, transparent 82%);
  box-shadow: 0 0 18px 6px rgba(255, 216, 130, .8);
}

/* ============ 家书落地页 ============ */
.letter-paper {
  position: absolute;
  left: 96px; top: 390px;
  width: 660px; height: 1010px;
  z-index: 3;
  pointer-events: none;
}
.letter-scroll {
  width: 100%; height: 100%;
  overflow-y: auto;
  pointer-events: auto;
  scrollbar-width: none;
}
.letter-scroll::-webkit-scrollbar { display: none; }
.letter-body {
  margin: 0;
  padding: 22px 24px 0;
  font-family: "STKaiti", "Kaiti SC", "KaiTi", "STSong", serif;
  font-size: 40px;
  line-height: 66px;
  letter-spacing: 1.2px;
  color: #5c3a2e;
  white-space: pre-wrap;
  word-break: break-all;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
}
.letter-sign {
  padding: 16px 44px 0;
  font-family: "STKaiti", "Kaiti SC", "KaiTi", "STSong", serif;
  font-size: 34px;
  line-height: 56px;
  letter-spacing: 1.2px;
  color: #5c3a2e;
  text-align: right;
  white-space: pre-line;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
}

.landing-share {
  left: 126px; top: 1596px;
  width: 590px; height: 76px;
  border-radius: 40px;
}
.landing-edit {
  position: absolute;
  left: 30px; top: 26px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 2px solid rgba(255, 214, 102, .92);
  background: linear-gradient(180deg, rgba(12, 46, 120, .95), rgba(5, 24, 78, .95));
  color: #ffe9b0;
  border-radius: 40px;
  padding: 7px 24px 7px 7px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(2, 10, 40, .55), 0 0 20px rgba(255, 205, 90, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
  backdrop-filter: blur(8px);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.landing-edit .back-ico {
  width: 38px; height: 38px;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff0bd 0%, #ffcf5c 60%, #f5b32f 100%);
  color: #0a2c86;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.landing-edit .back-ico svg { width: 21px; height: 21px; }
.landing-edit:hover {
  transform: translateX(-3px);
  background: linear-gradient(180deg, rgba(18, 58, 145, .98), rgba(8, 32, 96, .98));
  box-shadow: 0 6px 24px rgba(2, 10, 40, .6), 0 0 28px rgba(255, 205, 90, .5), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.landing-edit:active { transform: translateX(-1px) scale(.97); }

/* ============ 微信分享引导浮层 ============ */
.wx-share-guide {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 14px 16px 0 0;
  background: rgba(2, 10, 38, .82);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.wx-share-guide.show { opacity: 1; visibility: visible; }
.wx-share-guide__inner {
  position: relative;
  width: min(330px, 78vw);
  margin-top: 46px;
  padding: 26px 22px 20px;
  text-align: center;
  border: 2px solid rgba(255, 214, 102, .92);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14, 50, 128, .98), rgba(5, 24, 78, .98));
  box-shadow: 0 10px 40px rgba(0, 0, 0, .55), 0 0 26px rgba(255, 205, 90, .35);
  color: #fff3cd;
}
.wx-share-guide__arrow {
  position: absolute;
  top: -58px; right: 6px;
  font-size: 54px;
  line-height: 1;
  color: #ffd666;
  transform: rotate(-32deg);
  filter: drop-shadow(0 0 10px rgba(255, 205, 90, .7));
  animation: wxArrowNudge 1.2s ease-in-out infinite;
}
@keyframes wxArrowNudge {
  0%, 100% { transform: rotate(-32deg) translate(0, 0); }
  50% { transform: rotate(-32deg) translate(6px, -6px); }
}
.wx-share-guide__title {
  margin: 0 0 10px;
  font-family: "STKaiti", "Kaiti SC", "KaiTi", "PingFang SC", serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffe9b0;
}
.wx-share-guide__text {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.7;
  color: #eaf1ff;
}
.wx-share-guide__text b { color: #ffd666; font-size: 19px; letter-spacing: 3px; }
.wx-share-guide__close {
  border: 1px solid rgba(255, 214, 102, .6);
  background: rgba(255, 214, 102, .14);
  color: #ffe9b0;
  border-radius: 24px;
  padding: 8px 26px;
  font-size: 15px;
  cursor: pointer;
}
.wx-share-guide__close:active { background: rgba(255, 214, 102, .28); }

/* ============ 首页主视觉动效 ============ */
.hero-motion {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero-motion img,
.hero-halo,
.hero-spark {
  position: absolute;
  display: block;
  will-change: transform, opacity;
}
.hero-halo {
  left: 260px; top: 632px;
  width: 295px; height: 78px;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 220, 130, .55) 0%, rgba(255, 190, 70, .20) 45%, rgba(255, 170, 40, 0) 72%);
  animation: haloPulse 2.8s ease-out infinite;
}
.hero-envelope {
  left: 260px; top: 405px;
  width: 295px; height: 310px;
  z-index: 2;
  transform-origin: 50% 78%;
  animation: envelopeFloat 4s ease-in-out .6s infinite;
}
.hero-icon { z-index: 2; }
.hero-icon--helmet {
  left: 175px; top: 420px;
  width: 150px; height: 120px;
  animation: iconFloat 3.6s ease-in-out .9s infinite;
}
.hero-icon--car {
  left: 150px; top: 545px;
  width: 145px; height: 130px;
  animation: iconFloat 4.2s ease-in-out 1.35s infinite;
}
.hero-icon--box {
  left: 550px; top: 415px;
  width: 150px; height: 130px;
  animation: iconFloat 3.9s ease-in-out 1.1s infinite;
}
.hero-icon--truck {
  left: 555px; top: 545px;
  width: 150px; height: 130px;
  animation: iconFloat 4.6s ease-in-out 1.65s infinite;
}
.hero-spark {
  left: var(--x); top: var(--y);
  width: var(--s); height: var(--s);
  z-index: 3;
  border-radius: 50%;
  background: #fff3c4;
  box-shadow: 0 0 8px 2px rgba(255, 210, 110, .75);
  opacity: .15;
  animation: sparkDrift var(--d) ease-in-out var(--delay) infinite;
}
.hero-sub { animation: fadeInDown .6s ease-out .15s both; }
.card-intro { animation: cardRise .6s cubic-bezier(.2, .8, .2, 1) .25s both; }
.card-letter { animation: cardRise .6s cubic-bezier(.2, .8, .2, 1) .37s both; }
.card-service { animation: cardRise .6s cubic-bezier(.2, .8, .2, 1) .49s both; }
.brand-mascot--motion {
  transform-origin: 50% 30%;
  animation: mascotSway 5s ease-in-out 1.2s infinite;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate3d(0, -10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes cardRise {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes envelopeFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -8px, 0) scale(1.015); }
}
@keyframes iconFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -10px, 0) rotate(2.5deg); }
}
@keyframes haloPulse {
  0%, 100% { opacity: .35; transform: scale(.96); }
  55% { opacity: .85; transform: scale(1.06); }
}
@keyframes sparkDrift {
  0%, 100% { opacity: .15; transform: translate3d(0, 0, 0) scale(.85); }
  50% { opacity: .9; transform: translate3d(0, -18px, 0) scale(1.15); }
}
@keyframes mascotSway {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -3px, 0) rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-envelope,
  .hero-icon,
  .hero-halo,
  .hero-spark,
  .hero-sub,
  .card-intro,
  .card-letter,
  .card-service,
  .brand-mascot--motion {
    animation: none !important;
  }
  .hero-halo,
  .hero-spark { display: none; }
}
