/* 《后会友期》趣味测试 — 移动端 H5，适配微信内置浏览器 */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  height: 100dvh;
  background: #0c1618;
  color: #f7f4ee;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.55;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

img {
  max-width: 100%;
  display: block;
}

#app {
  position: relative;
  height: 100%;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 18% 0%, rgba(42, 212, 197, 0.2), transparent 58%),
    radial-gradient(ellipse 70% 42% at 92% 8%, rgba(243, 239, 230, 0.09), transparent 52%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(14, 124, 116, 0.22), transparent 55%),
    #0c1618;
}

.font-preload {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  pointer-events: none;
}

.font-preload--serif {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", serif;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding:
    calc(20px + env(safe-area-inset-top, 0px))
    22px
    calc(20px + env(safe-area-inset-bottom, 0px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.is-active {
  display: flex;
}

.kicker {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: #d4b06a;
  text-align: center;
  font-weight: 500;
}

.show-title {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", serif;
  font-size: 34px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.08em;
  margin-top: 14px;
}

.quiz-title,
.lead {
  text-align: center;
}

.quiz-title {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 500;
  color: #f3efe6;
}

.lead {
  margin-top: 8px;
  color: rgba(247, 244, 238, 0.7);
  font-size: 15px;
}

.hint,
.foot,
.disclaimer {
  text-align: center;
  color: rgba(247, 244, 238, 0.45);
  font-size: 12px;
  line-height: 1.7;
}

/* —— Home —— */
#screen-home {
  justify-content: space-between;
}

.home-top {
  padding-top: 28px;
}

.emblem-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 36px 0 8px;
}

.emblem {
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
}

.emblem-vs {
  font-size: 13px;
  letter-spacing: 0.14em;
  color: #d4b06a;
  font-weight: 600;
}

.home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
}

.home-copy {
  padding: 0 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: transform 0.12s ease, opacity 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  color: #06201e;
  background: linear-gradient(180deg, #7af0e4 0%, #2ad4c5 48%, #1aa89c 100%);
  box-shadow: 0 8px 24px rgba(42, 212, 197, 0.28);
}

.btn-ghost {
  color: #f3efe6;
  background: rgba(243, 239, 230, 0.08);
  border: 1px solid rgba(243, 239, 230, 0.16);
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
}

/* —— Quiz —— */
.quiz-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.quiz-progress-label {
  font-size: 13px;
  color: rgba(247, 244, 238, 0.62);
  letter-spacing: 0.08em;
}

.bar-track {
  height: 6px;
  width: 100%;
  border-radius: 999px;
  background: rgba(243, 239, 230, 0.12);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #1aa89c, #2ad4c5);
  transition: width 0.28s ease;
}

.question-text {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 28px;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option-btn {
  width: 100%;
  text-align: left;
  min-height: 72px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(243, 239, 230, 0.07);
  border: 1px solid rgba(243, 239, 230, 0.14);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  color: #f7f4ee;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.option-btn:active {
  transform: scale(0.99);
}

.option-btn.is-qing {
  background: rgba(42, 212, 197, 0.22);
  border-color: rgba(42, 212, 197, 0.55);
}

.option-btn.is-bai {
  background: rgba(243, 239, 230, 0.18);
  border-color: rgba(243, 239, 230, 0.5);
}

.option-btn:disabled {
  cursor: default;
}

/* —— Result —— */
#screen-result {
  text-align: center;
}

.result-eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: #d4b06a;
  margin-top: 8px;
}

.result-ratio {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 18px 0 8px;
  line-height: 1.1;
}

.result-emblems {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 8px 0 22px;
}

.result-emblems .emblem {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
}

.ratio-bar-wrap {
  margin: 0 4px 8px;
}

.ratio-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(220, 214, 204, 0.92);
  overflow: hidden;
  display: flex;
  direction: ltr;
}

.ratio-bar-qing {
  height: 100%;
  background: #2ad4c5;
  width: 0;
  transition: width 0.55s ease;
}

.ratio-bar-names {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(247, 244, 238, 0.62);
}

.ratio-bar-names .qing {
  color: #2ad4c5;
}

.ratio-bar-names .bai {
  color: #c9c3b8;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 28px auto 22px;
  color: #d4b06a;
}

.divider::before,
.divider::after {
  content: "";
  width: 48px;
  height: 1px;
  background: rgba(212, 176, 106, 0.35);
}

.diamond {
  width: 8px;
  height: 8px;
  background: #d4b06a;
  transform: rotate(45deg);
}

.result-persona {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", serif;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 12px;
}

.result-desc {
  font-size: 15px;
  line-height: 1.8;
  color: rgba(247, 244, 238, 0.86);
  padding: 0 6px;
}

/* —— Poster —— */
#screen-poster {
  padding-left: 16px;
  padding-right: 16px;
}

.poster-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}

.poster-frame {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: auto;
}

#poster-image {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  /* 允许微信长按保存：不要禁止 callout / 选择 */
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
  pointer-events: auto;
}

.poster-hint {
  flex: 0 0 auto;
  margin: 12px 0 8px;
  text-align: center;
  font-size: 14px;
  color: rgba(247, 244, 238, 0.72);
}
