* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: #232329;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

.phone-frame {
  position: relative;
  width: min(100vw, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: max(10px, env(safe-area-inset-top, 0px)) 0 max(10px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #efc3de, #c6eef3);
}

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

.heart {
  position: absolute;
  top: 34px;
  right: -16px;
  width: 138px;
  opacity: 0.9;
}

.hero {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding-top: 4px;
  text-align: center;
}

.hero--no-subtitle {
  margin-bottom: 18px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.title-row img {
  height: 26px;
}

.title-row .title-svg {
  height: 30px;
}

.hero-subtitle {
  margin: 10px 0 15px;
  color: #1e1e1e;
  font-size: 13px;
}

.card-stack {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  width: 100%;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.question-card {
  width: 100%;
  min-height: min(480px, calc(100dvh - 200px));
  display: flex;
  justify-content: center;
  background: url("../img/kunlun/card_bg.png") no-repeat center / 100% 100%;
}

.question-card .card-content {
  position: relative;
  z-index: 1;
  width: 270px;
  padding: 75px 8px 0 20px;
}

.question-card--consent {
  flex: 1;
  min-height: 0;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

.question-card--consent .card-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  max-width: 290px;
  margin: 0 auto;
  padding: clamp(130px, 22vh, 180px) 12px 0 16px;
  -webkit-overflow-scrolling: touch;
}

.consent-text {
  margin: 0 0 12px;
  color: #2a2235;
  font-size: clamp(15px, 4.2vw, 20px);
  line-height: 1.55;
  font-weight: 700;
}

.prompt {
  height: 38px;
  margin: 0 0 14px;
  color: #222;
  font-size: 14px;
  font-weight: 700;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 12px;
}

.option-card {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #222;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.option-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 4px;
  border: 2px solid transparent;
  border-radius: 12px;
  object-fit: cover;
}

.option-card.is-selected img {
  border-color: #f2009d;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 270px;
  padding: 136px 8px 0 20px;
  text-align: center;
}

.loading-content--center {
  width: 100%;
  min-height: 430px;
  justify-content: center;
  padding-top: 0;
  transform: translateY(-24px);
}

.loading-content--final {
  width: 100%;
  min-height: 430px;
  justify-content: center;
  gap: 18px;
  padding: 0 20px;
  transform: translateY(-10px);
}

.loading-content p {
  margin: 0 0 20px;
  color: #1e1e1e;
  font-size: 14px;
  font-weight: 700;
}

.loading-content--center .loading-line-1 {
  margin-bottom: 36px;
}

.loading-content--center .loading-line-2 {
  margin-bottom: 15px;
}

.loading-final-text {
  margin: 0;
  color: #111;
  font-size: 18px;
  font-weight: 800;
}

.loading-track {
  width: min(234px, 100%);
  height: 16px;
  margin-top: 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.loading-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f2009d, #ff60cf);
  transition: width 0.06s linear;
}

.actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}

.actions--consent {
  flex-shrink: 0;
  margin-top: auto;
  padding: 12px 12px 8px;
}

.phone-frame > .actions {
  flex-shrink: 0;
  margin-top: 8px;
  padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
}

.actions button {
  width: 132px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #1e1e1e;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.actions button:active {
  opacity: 0.95;
  transform: translateY(1px);
}

.result-panel {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  margin-top: 12px;
  padding: 0 24px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  color: #1e1e1e;
  -webkit-overflow-scrolling: touch;
}

.result-panel h3 {
  margin: 0 0 19px;
  font-size: 20px;
  line-height: 1.3;
}

.result-panel .meta {
  margin: 0 0 35px;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 600;
}

.result-panel .lead {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
}

.result-panel ol {
  margin: 32px 0 0;
  padding-left: 20px;
  color: #555;
}

.result-panel li {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.55;
}

.contact-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-row strong {
  font-size: 22px;
}

.contact-placeholder {
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 16px;
  background: url("../img/kunlun/logo.jpg?1") center / cover no-repeat;
  box-shadow: 0 10px 22px rgba(242, 0, 157, 0.25);
  cursor: pointer;
}

@media (max-width: 480px) {
  .phone-frame {
    width: 100vw;
    padding: max(8px, env(safe-area-inset-top, 0px)) 0 max(8px, env(safe-area-inset-bottom, 0px));
  }

  .title-row .title-svg {
    height: clamp(18px, 5vw, 20px);
  }

  .title-row img:not(.title-svg) {
    height: clamp(20px, 5.5vw, 26px);
  }

  .heart {
    top: 22px;
    width: min(126px, 28vw);
  }

  .question-card:not(.question-card--consent) {
    min-height: min(480px, calc(100dvh - 160px));
  }

  .question-card h2 {
    font-size: 14px;
  }

  .consent-text {
    font-size: clamp(14px, 4vw, 17px);
    line-height: 1.5;
  }

  .prompt {
    margin-bottom: 12px;
    font-size: 12px;
  }

  .option-card {
    font-size: 12px;
  }

  .loading-content {
    padding-top: 100px;
  }

  .loading-content--center {
    min-height: 390px;
    transform: translateY(-20px);
  }

  .loading-content--final {
    min-height: 390px;
    transform: translateY(-8px);
  }

  .loading-track {
    height: 12px;
  }

  .result-panel h3 {
    font-size: 20px;
  }

  .result-panel .meta {
    font-size: 15px;
  }

  .result-panel .lead {
    font-size: 18px;
  }

  .result-panel li {
    font-size: 13px;
  }

  .contact-row strong {
    font-size: 16px;
  }

  .actions button {
    width: 134px;
    height: 44px;
  }

  .actions--consent {
    padding: 10px 8px 6px;
  }
}

@media (max-height: 700px) {
  .hero-subtitle {
    margin: 6px 0 8px;
    font-size: 12px;
  }

  .heart {
    top: 16px;
    right: -12px;
    width: min(100px, 26vw);
  }

  .title-row {
    gap: 6px;
  }

  .question-card:not(.question-card--consent) .card-content {
    padding-top: clamp(32px, 8vh, 60px);
  }
}
