/* 首页挽留弹窗 — Figma 4014:371 702×510；窄屏整体等比缩放 */

.retention-modal.in {
  display: block !important;
}

body.retention-popup-open .modal-backdrop.in {
  background: rgba(0, 0, 0, 0.7);
  opacity: 1;
}

.retention-modal .modal-dialog.retention-modal__dialog {
  position: relative;
  z-index: 1;
  width: 702px;
  max-width: calc(100vw - 24px);
  margin: 30px auto;
  pointer-events: none;
}

.retention-modal .modal-dialog.retention-modal__dialog > * {
  pointer-events: auto;
}

.retention-modal .modal-content.retention-modal__panel {
  position: relative;
  width: 702px;
  max-width: 100%;
  height: 588px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  color: #fff;
}

/* 外层：topbar + capture + 保存按钮 */
.retention-modal__popup {
  position: relative;
  width: 702px;
  height: 588px;
  overflow: visible;
}

/* 截图区域 702×510，Figma 4014:371 */
.retention-modal__capture {
  position: relative;
  width: 702px;
  height: 510px;
  overflow: visible;
}

/* 690×500 背景层，仅裁切氛围纹理 */
.retention-modal__decor-bg {
  position: absolute;
  left: 6px;
  top: 10px;
  width: 690px;
  height: 500px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.retention-modal__frame-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.retention-modal__bg-texture {
  position: absolute;
  max-width: none;
  pointer-events: none;
}

.retention-modal__bg-texture--left {
  left: -80.54px;
  top: -39.37px;
  width: 216.072px;
  height: 432.143px;
  transform: rotate(-165.68deg);
  mix-blend-mode: soft-light;
}

.retention-modal__bg-texture--right {
  right: 0;
  top: -12px;
  width: 512px;
  height: 1024px;
  transform: rotate(90deg);
  mix-blend-mode: soft-light;
}

/* 边框装饰层：overflow visible，避免角饰被裁切 */
.retention-modal__decor {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.retention-modal__header-strip {
  position: absolute;
  left: 6px;
  top: 54px;
  width: 690px;
  height: 88px;
  display: block;
  max-width: none;
}

.retention-modal__side {
  position: absolute;
  display: block;
  max-width: none;
  width: 22px;
  height: 394px;
}

.retention-modal__side--left {
  left: 2.94px;
  top: 116px;
}

.retention-modal__side--right {
  left: 677.06px;
  top: 116px;
  transform: scaleY(-1) rotate(180deg);
}

.retention-modal__corner {
  position: absolute;
  display: block;
  max-width: none;
  width: 325.385px;
  height: 423.794px;
}

.retention-modal__corner--left {
  left: 0;
  top: 3.5px;
}

.retention-modal__corner--right {
  left: 376.62px;
  top: 3.5px;
  transform: scaleY(-1) rotate(180deg);
}

.retention-modal__top-glow {
  position: absolute;
  left: 199px;
  top: 12px;
  width: 304px;
  height: 86px;
  transform: rotate(90deg);
  transform-origin: center center;
  opacity: 0.85;
  mix-blend-mode: screen;
}

.retention-modal__heart {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 3;
  width: 44px;
  height: 44px;
  overflow: visible;
  transform: translateX(-50%);
  pointer-events: none;
}

.retention-modal__heart img {
  display: block;
  width: 44px;
  height: 44px;
  max-width: none;
  margin-top: 0;
  object-fit: contain;
}

/* 倒计时 / 关闭：框外上方，Figma 4023:491 / 4023:482 */
.retention-modal__topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  height: 0;
  pointer-events: none;
}

.retention-modal__countdown {
  position: absolute;
  left: 0;
  top: -24px;
  margin: 0;
  font-size: 14px;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  pointer-events: auto;
}

.retention-modal__close {
  position: absolute;
  right: 0;
  top: -40px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.retention-modal__close img {
  display: block;
  width: 20px;
  height: 20px;
}

.retention-modal__header {
  position: absolute;
  left: 50%;
  top: 42px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transform: translateX(-50%);
  max-width: calc(100% - 120px);
}

.retention-modal__wing {
  flex: 0 0 auto;
  width: 12px;
  height: 10px;
}

.retention-modal__wing--right {
  transform: scaleY(-1) rotate(180deg);
}

.retention-modal__title {
  margin: 0;
  font-size: 0;
  line-height: 0;
  white-space: nowrap;
  background: none;
  color: transparent;
}

.retention-modal__title svg {
  display: block;
}

.retention-modal__body {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.retention-modal__left {
  position: absolute;
  left: 30px;
  top: 130px;
  width: 315px;
  height: 348px;
  box-sizing: border-box;
  padding: 2px;
  border: 1px solid #b18e5d;
  border-radius: 4px;
  background: #14131e;
}

.retention-modal__left-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid #3d3a5d;
  border-radius: 2px;
  background: #19172f;
}

.retention-modal__left-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  pointer-events: none;
}

/* 模糊照片景深层：CSS blur 自动生成，换主图无需额外准备模糊版 */
.retention-modal__left-photo-blur {
  position: absolute;
  left: calc(50% + 7px);
  bottom: 0;
  width: 293px;
  height: 342px;
  transform: translateX(-50%);
  object-fit: cover;
  object-position: bottom center;
  opacity: 0.55;
  mix-blend-mode: screen;
  filter: blur(8px);
  pointer-events: none;
}

/* 紫色光晕层：竖向铺满左侧，screen混合让黑底透明 */
.retention-modal__left-glow {
  position: absolute;
  left: -20px;
  top: -30px;
  width: 320px;
  height: 420px;
  object-fit: cover;
  object-position: top left;
  opacity: 0.6;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* 星光粒子层：超宽图截取左侧区域，screen混合仅显示亮点 */
.retention-modal__left-effect {
  position: absolute;
  left: -60px;
  top: -20px;
  width: 440px;
  height: 260px;
  object-fit: cover;
  object-position: left center;
  opacity: 0.35;
  mix-blend-mode: screen;
  pointer-events: none;
}

.retention-modal__left-photo {
  position: absolute;
  left: calc(50% + 7px);
  bottom: 0;
  width: 293px;
  height: 342px;
  transform: translateX(-50%);
  object-fit: cover;
  object-position: bottom center;
}

.retention-modal__email {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 16px 14px 14px;
  text-align: center;
  background: linear-gradient(180deg, rgba(25, 23, 47, 0) 0%, rgba(25, 23, 47, 0.92) 42%, rgba(20, 19, 30, 0.98) 100%);
}

.retention-modal__email-label {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.4;
  color: #fff;
}

.retention-modal__email-value {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: #ffea00;
  word-break: break-all;
}

.retention-modal__email-value a {
  color: #ffea00;
  text-decoration: none;
}

.retention-modal__email-tip {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.retention-modal__box {
  position: absolute;
  left: 357px;
  width: 315px;
  box-sizing: border-box;
  padding: 2px;
  border: 1px solid #b18e5d;
  border-radius: 4px;
  background: #14131e;
}

.retention-modal__box--top {
  top: 130px;
  height: 111px;
}

.retention-modal__box--bottom {
  top: 299px;
  height: 179px;
}

.retention-modal__box-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  height: 100%;
  padding: 10px 12px;
  border: 1px solid #3d3a5d;
  border-radius: 2px;
  background: #19172f;
}

.retention-modal__box--bottom .retention-modal__box-inner {
  justify-content: flex-start;
  gap: 6px;
  padding-top: 12px;
}

.retention-modal__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.retention-modal__row.is-hidden {
  display: none;
}

.retention-modal__label {
  flex: 0 0 auto;
  color: #fff;
  white-space: nowrap;
}

.retention-modal__value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  font-size: 16px;
  color: #ffea00;
  word-break: break-all;
}

.retention-modal__value a {
  color: #ffea00;
  text-decoration: underline;
}

.retention-modal__row[data-row="latest"] .retention-modal__value,
.retention-modal__row[data-row="overseas"] .retention-modal__value,
.retention-modal__row[data-row^="line"] .retention-modal__value,
.retention-modal__row[data-row="latest"] .retention-modal__value a,
.retention-modal__row[data-row="overseas"] .retention-modal__value a,
.retention-modal__row[data-row^="line"] .retention-modal__value a {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 2px;
}

.retention-modal__notice {
  position: absolute;
  left: calc(50% + 164px);
  top: 274px;
  z-index: 2;
  width: 280px;
  margin: 0;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 0;
  line-height: 0;
  background: none;
  color: transparent;
}

.retention-modal__notice svg {
  display: block;
  margin: 0 auto;
}

.retention-modal__notice span {
  display: none;
}

.retention-modal__notice.is-hidden,
.retention-modal__email-label:empty,
.retention-modal__email-tip:empty {
  display: none;
}

/* 保存按钮：弹窗下方 24px，Figma 4076:3484 */
.retention-modal__save {
  position: absolute;
  left: 50%;
  top: 534px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 267px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 100px;
  overflow: hidden;
  cursor: pointer;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffed67 0%, #995b10 100%);
  box-shadow: inset 0 1px 1px 0 #ffffb0, inset 0 -1px 0.908px 0 #693413;
}

.retention-modal__save-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: cover;
}

.retention-modal__save-text {
  position: relative;
  z-index: 1;
  font-size: 17px;
  font-weight: 500;
  line-height: 20px;
  color: #000;
  text-transform: capitalize;
}

.retention-modal__save:hover {
  filter: brightness(1.05);
}

.retention-modal__save:active {
  filter: brightness(0.96);
}

/* 窄屏：整块 dialog 缩放并视口居中（由 JS 设置 --retention-mobile-scale） */
@media (max-width: 767px) {
  body.retention-popup-open .modal-backdrop.in {
    display: block !important;
    z-index: 5000;
  }

  #retention_modal.retention-modal.in {
    display: block !important;
    z-index: 5001;
  }

  .retention-modal--mobile-scale .modal-dialog.retention-modal__dialog {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: 702px !important;
    max-width: none !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) scale(var(--retention-mobile-scale, 1)) !important;
    transform-origin: center center;
  }

  .retention-modal--mobile-scale .modal-content.retention-modal__panel {
    width: 702px !important;
    max-width: none !important;
  }
}
