.amap-main-case[data-amap-cover] {
  --amap-cover-ease: cubic-bezier(.22, 1, .36, 1);
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(330px, .76fr) minmax(620px, 1.24fr);
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  padding: clamp(86px, 10vh, 122px) var(--page-pad);
  overflow: hidden;
  border-top: 1px solid var(--section-rule);
  background: #f5f3ee;
}

.amap-main-case[data-amap-cover]::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -3%;
  opacity: 1;
  mask-image: none;
  -webkit-mask-image: none;
  background: url("assets/amap/taihe-palace-cover.webp") 56% bottom / auto 148% no-repeat;
  filter: saturate(.88) contrast(.97) brightness(1.025);
  transform: scale(1.025);
  transform-origin: 62% 54%;
  will-change: transform;
}

.amap-main-case[data-amap-cover]::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      #f5f3ee 0%,
      rgba(245, 243, 238, .98) 27%,
      rgba(245, 243, 238, .9) 38%,
      rgba(245, 243, 238, .46) 54%,
      rgba(245, 243, 238, .08) 70%,
      transparent 82%),
    linear-gradient(180deg, rgba(29, 37, 43, .04), transparent 42%, rgba(245, 243, 238, .08));
}

.amap-main-case.is-amap-active::before {
  animation: amapCoverSceneWalk 18s ease-in-out infinite alternate;
}

@keyframes amapCoverSceneWalk {
  0% { transform: scale(1.025) translate3d(0, 0, 0); }
  55% { transform: scale(1.043) translate3d(-.3%, -.12%, 0); }
  100% { transform: scale(1.036) translate3d(.12%, -.08%, 0); }
}

.amap-main-case[data-amap-cover] .amap-main-copy {
  z-index: 4;
  width: min(100%, 430px);
  text-shadow: 0 1px rgba(255, 255, 255, .42);
}

.amap-main-case[data-amap-cover] .amap-main-copy > p:first-child {
  margin-bottom: 30px;
  color: #e34f25;
  font-size: 12px;
  letter-spacing: .13em;
}

.amap-main-case[data-amap-cover] .amap-main-copy h2 {
  font-size: clamp(72px, 7.6vw, 122px);
  font-weight: 500;
  letter-spacing: -.045em;
}

.amap-main-case[data-amap-cover] .amap-main-copy .amap-main-role {
  margin-top: 20px;
  color: #1d1b16;
  font-size: clamp(18px, 1.7vw, 24px);
}

.amap-main-case[data-amap-cover] .amap-main-copy > p:not(:first-child) {
  max-width: 420px;
  color: #514b43;
  line-height: 1.9;
}

.amap-main-case[data-amap-cover] .amap-main-copy > div {
  margin-top: 28px;
  border-color: rgba(55, 48, 38, .18);
}

.amap-main-case[data-amap-cover] .amap-main-copy > div span {
  padding: 16px 0;
  border-color: rgba(55, 48, 38, .18);
  font-size: 15px;
}

.amap-main-case[data-amap-cover] .amap-main-copy a {
  color: #e34f25;
  border-color: #e34f25;
}

.amap-cover-art {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0 90%, transparent 100%);
}

.amap-cover-device {
  position: absolute;
  left: 17%;
  top: 50%;
  width: min(1500px, 96vw);
  aspect-ratio: 1624 / 968;
  transform: translateY(-48%);
  transform-origin: 52% 58%;
  will-change: transform;
}

@media (min-width: 901px) and (max-height: 800px) {
  .amap-main-case[data-amap-cover] {
    height: 100svh;
    min-height: 100svh;
    padding-block: clamp(26px, 7vh, 54px);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy > p:first-child {
    margin-bottom: clamp(9px, 2.4vh, 18px);
    font-size: clamp(9px, 1.55vh, 11px);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy h2 {
    font-size: clamp(58px, 12vh, 90px);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy .amap-main-role {
    margin-top: clamp(7px, 1.7vh, 14px);
    font-size: clamp(15px, 2.7vh, 20px);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy > p:not(:first-child) {
    margin-block: clamp(8px, 2vh, 16px);
    max-width: 360px;
    font-size: clamp(11px, 1.8vh, 13px);
    line-height: 1.62;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy > div {
    margin-top: clamp(8px, 2vh, 16px);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy > div span {
    padding: clamp(6px, 1.65vh, 12px) 0;
    font-size: clamp(11px, 1.8vh, 13px);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy a {
    margin-top: clamp(9px, 2.2vh, 18px);
    padding: clamp(7px, 1.7vh, 12px) 0;
    font-size: clamp(11px, 1.8vh, 13px);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy small {
    margin-top: clamp(5px, 1.35vh, 10px);
    font-size: clamp(8px, 1.35vh, 10px);
  }

  .amap-cover-device {
    left: 25%;
    width: min(1250px, calc(99vh * 1.678));
  }
}

.amap-cover-composite {
  position: absolute;
  inset: 0;
  transform-origin: 52% 60%;
}

.amap-cover-device::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 38%;
  top: 17%;
  width: 42%;
  height: 67%;
  border-radius: 50%;
  background: rgba(91, 67, 45, .18);
  filter: blur(36px);
  transform: rotate(8deg) scale(.82);
}

.amap-cover-screen {
  position: absolute;
  z-index: 3;
  left: 39.37%;
  top: 7.55%;
  width: 21.1%;
  height: 71%;
  overflow: hidden;
  border-radius: 12.7% / 6.2%;
  background: #e8efeb;
  clip-path: inset(0 round 12.7% / 6.2%);
  contain: size layout paint style;
  isolation: isolate;
  pointer-events: auto;
  container-type: inline-size;
}

/* Short, narrow desktop windows need a side-by-side composition rather than a
   vertically stacked mobile layout. This keeps the CTA and phone independent. */
@media (min-width: 520px) and (max-width: 900px) and (max-height: 700px) {
  .amap-main-case[data-amap-cover] {
    height: 100svh;
    min-height: 100svh;
    padding: 42px 24px 18px;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy {
    position: relative;
    z-index: 5;
    width: min(46vw, 292px);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy > p:first-child {
    margin-bottom: 10px;
    font-size: 9px;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy h2 {
    font-size: clamp(44px, 8vw, 58px);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy .amap-main-role {
    margin-top: 8px;
    font-size: 15px;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy > p:not(:first-child) {
    margin-block: 8px;
    font-size: 11px;
    line-height: 1.55;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy > div {
    display: none;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy a {
    width: min(100%, 250px);
    margin-top: 12px;
    padding: 9px 0;
    font-size: 12px;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy small {
    width: min(100%, 250px);
    margin-top: 6px;
    font-size: 8px;
    line-height: 1.35;
  }

  .amap-cover-art {
    inset: 0;
    height: 100%;
  }

  .amap-cover-device {
    left: -10%;
    top: 50%;
    width: min(1040px, calc(102svh * 1.678));
    transform: translateY(-49%);
  }

  .amap-main-case.is-amap-active .amap-cover-device {
    animation: none;
  }
}

.amap-cover-screen iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.amap-cover-enter {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: start start;
  padding: 15.5cqw 0 0 4cqw;
  color: #1d1b16;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
}

.amap-cover-enter > span {
  position: relative;
  overflow: hidden;
  padding: clamp(5px, 2.2cqw, 8px) clamp(8px, 3.8cqw, 13px);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, .5), rgba(245, 243, 238, .15) 55%, rgba(218, 119, 86, .08));
  box-shadow:
    0 8px 24px rgba(41, 48, 49, .13),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 0 0 1px rgba(255, 255, 255, .18);
  font-size: clamp(7px, 2.8cqw, 10px);
  font-weight: 650;
  letter-spacing: .02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .72);
  opacity: .76;
  transform: translateY(2px);
  transition: opacity .25s ease, transform .38s var(--amap-cover-ease), box-shadow .3s ease;
  -webkit-backdrop-filter: blur(16px) saturate(1.28);
  backdrop-filter: blur(16px) saturate(1.28);
}

.amap-cover-enter > span::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, rgba(255, 255, 255, .65), transparent 34% 68%, rgba(255, 255, 255, .24));
  opacity: .55;
  pointer-events: none;
}

.amap-cover-enter:hover > span,
.amap-cover-enter:focus-visible > span {
  opacity: 1;
  transform: translateY(0);
  box-shadow:
    0 10px 28px rgba(41, 48, 49, .18),
    inset 0 1px 0 rgba(255, 255, 255, .96),
    inset 0 0 0 1px rgba(255, 255, 255, .26);
}

.amap-cover-enter:focus-visible {
  outline: 3px solid rgba(218, 119, 86, .82);
  outline-offset: -5px;
}

.amap-main-case[data-demo-stage^="vision-"] .amap-cover-enter > span {
  opacity: 0;
  transform: translateY(-4px);
}

.amap-portal-layer {
  position: fixed;
  z-index: 9999;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.amap-portal-paper {
  position: absolute;
  z-index: 1;
  inset: -3%;
  background-color: #f3efe7;
  background-image:
    linear-gradient(rgba(63, 57, 47, .038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 57, 47, .038) 1px, transparent 1px),
    radial-gradient(circle at 78% 18%, rgba(218, 119, 86, .08), transparent 26%);
  background-size: 42px 42px, 42px 42px, auto;
  box-shadow: -32px 0 60px rgba(56, 43, 31, .16);
  clip-path: polygon(58% 0, 60% 0, 67% 100%, 65% 100%);
  will-change: clip-path, transform;
}

.amap-portal-fold {
  position: absolute;
  z-index: 3;
  left: 58%;
  top: -10%;
  width: 7vw;
  height: 120%;
  opacity: 0;
  transform: rotate(3deg);
  background:
    linear-gradient(90deg,
      transparent,
      rgba(255, 252, 246, .82) 40%,
      rgba(79, 61, 42, .13) 52%,
      transparent 72%);
  filter: blur(6px);
  will-change: transform, opacity;
}

.amap-portal-case-copy {
  position: fixed;
  z-index: 2;
  left: clamp(44px, 5vw, 76px);
  top: clamp(48px, 8vh, 82px);
  width: min(34vw, 510px);
  color: #292722;
  text-shadow: none;
}

.amap-portal-case-copy p {
  margin: 0;
  color: #f15325;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}

.amap-portal-case-copy h2 {
  margin: 24px 0;
  font: 500 clamp(48px, 5vw, 72px) / 1.18 Georgia, "Songti SC", serif;
  letter-spacing: 0;
}

.amap-portal-case-copy span {
  display: block;
  color: #4e4a43;
  font-size: 17px;
  line-height: 1.9;
}

.amap-portal-layer .amap-cover-device {
  z-index: 4;
  margin: 0;
}

body.is-amap-portal-entering {
  overflow: hidden;
}

.amap-cover-hand {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.amap-cover-touch {
  position: absolute;
  z-index: 3;
  left: 74%;
  top: 70%;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(218, 119, 86, .8);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.amap-main-case.is-amap-active .amap-cover-device {
  animation: amapCoverFloat 7.2s ease-in-out infinite;
}

.amap-main-case[data-demo-stage="question"] .amap-cover-composite {
  animation: amapCoverNudge .72s var(--amap-cover-ease) both;
}

.amap-main-case[data-demo-stage="question"] .amap-cover-touch {
  animation: amapCoverTouch .78s ease-out both;
}

.amap-main-case[data-demo-stage="expand"] .amap-cover-composite {
  animation: amapCoverLift .9s var(--amap-cover-ease) both;
}

.amap-main-case[data-demo-stage="vision-enter"] .amap-cover-composite {
  animation: amapCoverTurnIn 1.25s cubic-bezier(.22, 1, .36, 1) both;
}

.amap-main-case[data-demo-stage="vision-answer"] .amap-cover-composite {
  animation: amapCoverLift .9s var(--amap-cover-ease) both;
}

@keyframes amapCoverFloat {
  0%, 100% { transform: translateY(-48%) translate3d(0, 4px, 0) rotate(-.18deg); }
  50% { transform: translateY(-48%) translate3d(0, -7px, 0) rotate(.2deg); }
}

@keyframes amapCoverNudge {
  0% { transform: translate3d(0, 0, 0) rotate(0); }
  45% { transform: translate3d(-3px, 5px, 0) rotate(-.18deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0); }
}

@keyframes amapCoverLift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  52% { transform: translate3d(0, -6px, 0); }
}

@keyframes amapCoverTurnIn {
  0% { opacity: .82; transform: translate3d(-7%, 2.2%, 0) rotate(-2.4deg) scale(.97); }
  62% { opacity: 1; transform: translate3d(.7%, -.25%, 0) rotate(.42deg) scale(1.006); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0) scale(1); }
}

@keyframes amapCoverTouch {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
  28% { opacity: .9; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.3); }
}

@media (min-width: 901px) and (min-height: 801px) {
  .amap-cover-device {
    left: 23%;
    top: auto;
    bottom: -120px;
    transform: none;
  }

  .amap-main-case.is-amap-active .amap-cover-device {
    animation-name: amapCoverFloatEdge;
  }

  @keyframes amapCoverFloatEdge {
    0%, 100% { transform: translate3d(0, 4px, 0) rotate(-.18deg); }
    50% { transform: translate3d(0, -7px, 0) rotate(.2deg); }
  }
}

@media (max-width: 900px) {
  .amap-main-case[data-amap-cover] {
    min-height: 100svh;
    display: block;
    padding: 78px 34px 0;
  }

  .amap-main-case[data-amap-cover]::before {
    background-position: 52% bottom;
    background-size: auto 124%;
  }

  .amap-main-case[data-amap-cover]::after {
    background: linear-gradient(180deg, rgba(245, 243, 238, .44) 0, rgba(245, 243, 238, .24) 36%, rgba(245, 243, 238, .04) 70%, transparent 100%);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy {
    width: min(100%, 620px);
  }

  .amap-cover-art {
    position: absolute;
    inset: auto 0 0;
    height: 54svh;
    margin: 0;
    -webkit-mask-image: linear-gradient(to bottom, #000 0 96%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0 96%, transparent 100%);
  }

  .amap-cover-device {
    left: 50%;
    top: -6%;
    width: 1180px;
    transform: translateX(-49.4%);
  }

  .amap-main-case.is-amap-active .amap-cover-device {
    animation-name: amapCoverFloatMobile;
  }

  @keyframes amapCoverFloatMobile {
    0%, 100% { transform: translateX(-49.4%) translate3d(0, 3px, 0) rotate(-.12deg); }
    50% { transform: translateX(-49.4%) translate3d(0, -5px, 0) rotate(.14deg); }
  }
}

@media (max-width: 600px) {
  .amap-main-case[data-amap-cover] {
    padding: 70px 20px 0;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy h2 {
    font-size: 56px;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy > p:not(:first-child) {
    font-size: 13px;
    line-height: 1.65;
    margin-block: 10px;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy > p:first-child {
    margin-bottom: 12px;
  }

  .amap-main-case[data-amap-cover] .amap-main-copy > div {
    display: none;
  }

  .amap-cover-art {
    height: 50svh;
  }

  .amap-cover-device {
    top: -14%;
    width: 1030px;
  }

  .amap-portal-case-copy {
    left: 20px;
    top: 20px;
    width: calc(100vw - 40px);
  }

  .amap-portal-case-copy p {
    font-size: 12px;
  }

  .amap-portal-case-copy h2 {
    margin: 12px 0;
    font-size: 38px;
    line-height: 1.12;
  }

  .amap-portal-case-copy span {
    font-size: 13px;
    line-height: 1.62;
  }
}

/* Keep the embedded phone readable across the former 900/901px short-screen jump. */
@media (min-width: 901px) and (max-height: 800px) {
  .amap-cover-device {
    width: clamp(1080px, calc(99vh * 1.678), 1250px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .amap-main-case.is-amap-active::before,
  .amap-main-case.is-amap-active .amap-cover-device,
  .amap-main-case[data-demo-stage] .amap-cover-composite,
  .amap-main-case[data-demo-stage] .amap-cover-touch {
    animation: none;
  }

  .amap-cover-enter > span {
    transition: none;
  }
}

/* Final cascade guard for Retina narrow desktop windows (roughly 520–900 CSS px). */
@media (min-width: 520px) and (max-width: 900px) and (max-height: 700px) {
  .amap-main-case[data-amap-cover] .amap-main-copy {
    width: min(45vw, 270px);
  }

  .amap-main-case[data-amap-cover] .amap-main-copy h2 {
    font-size: clamp(42px, 7.8vw, 54px);
  }

  .amap-cover-art {
    inset: 0;
    height: 100%;
  }

  .amap-cover-device {
    left: -8%;
    top: 50%;
    width: min(950px, calc(96svh * 1.678));
    transform: translateY(-50%);
  }

  .amap-main-case.is-amap-active .amap-cover-device {
    animation: none;
  }
}
