/* MBTI 模組（原心向樣式，限定於 .mbti） */
.mbti{
  --bg: #120f0c;
  --bg-2: #1a1612;
  --paper: #f4ede1;
  --paper-dim: #e7ddcc;
  --ink: #161310;
  --gold: #e0c088;
  --gold-hi: #f3ddb0;
  --gold-dim: rgba(224, 192, 136, 0.28);
  --muted: rgba(244, 237, 225, 0.58);
  --muted-2: rgba(244, 237, 225, 0.38);
  --line: rgba(224, 192, 136, 0.28);
  --copper: #c4623a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --serif: "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --display: "Cormorant Garamond", "Noto Serif TC", "Noto Serif CJK TC", serif;
  --radius: 18px;
}
.mbti *{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.mbti .view{
  width: min(480px, 100%);
  margin: 0 auto;
  
  
}
.mbti .view-inner.view-fwd{ animation: inFwd 0.42s cubic-bezier(0.22, 1, 0.32, 1) both; }
.mbti .view-inner.view-back{ animation: inBack 0.42s cubic-bezier(0.22, 1, 0.32, 1) both; }
@keyframes inFwd{
  from { opacity: 0; transform: translate3d(28px, 0, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes inBack{
  from { opacity: 0; transform: translate3d(-28px, 0, 0); }
  to { opacity: 1; transform: none; }
}
.mbti .screen{ padding: calc(24px + var(--safe-top)) 22px calc(36px + var(--safe-bot)); }
.mbti .screen.intro, .mbti .screen.calc{
  
  
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.mbti .intro-mark, .mbti .calc-mark{ color: var(--gold); width: 88px; height: 88px; margin-bottom: 28px; }
.mbti .compass{ width: 88px; height: 88px; display: block; }
.mbti .compass.spin{ animation: slowspin 2.8s linear infinite; }
@keyframes slowspin{ to { transform: rotate(360deg); } }
.mbti .eyebrow{
  letter-spacing: 0.28em;
  font-size: 12px;
  color: var(--gold);
  text-transform: none;
  margin: 0 0 18px;
  font-weight: 500;
}
.mbti .title{
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(64px, 18vw, 88px);
  letter-spacing: 0.28em;
  line-height: 1;
  margin: 0 0 28px 0.28em;
  color: var(--paper);
  text-shadow: 0 0 40px rgba(224, 192, 136, 0.18);
}
.mbti .lead{
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  margin: 0 0 16px;
  color: var(--paper);
  max-width: 22em;
}
.mbti .note{
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 36px;
  max-width: 26em;
}
.mbti .disclaimer-mini{
  margin-top: 28px;
  font-size: 12px;
  color: var(--muted-2);
  max-width: 26em;
}
.mbti .btn{
  appearance: none;
  border: 0;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.08em;
  padding: 14px 28px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 48px;
  min-width: 44px;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.mbti .btn:active{ transform: scale(0.98); }
.mbti .btn:disabled{ opacity: 0.6; cursor: default; }
.mbti .btn.primary{
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}
.mbti .btn.primary:hover{ background: var(--gold-hi); }
.mbti .btn.ghost{
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--line);
  margin-top: 12px;
}
.mbti .intro-extra{ display: flex; flex-direction: column; align-items: center; width: 100%; }
.mbti .quiz-bar{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  position: sticky;
  top: var(--safe-top);
  background: linear-gradient(to bottom, var(--bg) 70%, rgba(18,15,12,0));
  padding: 4px 0 16px;
  z-index: 2;
}
.mbti .icon-btn{
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--paper);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}
.mbti .icon-btn:active{ background: rgba(244, 237, 225, 0.08); }
.mbti .quiz-progress{ flex: 1; min-width: 0; }
.mbti .quiz-count{ font-size: 13px; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.mbti .quiz-count .dim{ color: var(--muted-2); }
.mbti .bar{
  height: 3px;
  background: rgba(244, 237, 225, 0.12);
  border-radius: 99px;
  overflow: hidden;
}
.mbti .bar-fill{
  height: 100%;
  background: linear-gradient(90deg, #b8894a, var(--gold-hi));
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.32, 1);
}
.mbti .q-body{ padding-bottom: 12px; }
.mbti .q-num{
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin: 0 0 14px;
}
.mbti .q-text{
  font-family: var(--serif);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.55;
  margin: 0 0 28px;
  letter-spacing: 0.01em;
}
.mbti .scale{ display: flex; flex-direction: column; gap: 8px; }
.mbti .scale-opt{
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(244, 237, 225, 0.03);
  color: var(--paper);
  border-radius: 14px;
  min-height: 52px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.18s ease;
}
.mbti .scale-opt .dot{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  flex: 0 0 auto;
  position: relative;
  background: transparent;
}
.mbti .scale-opt .dot::after{
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--gold);
  transform: scale(0);
  transition: transform 0.18s ease;
}
.mbti .scale-opt.selected{
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.mbti .scale-opt.selected .dot{ border-color: var(--ink); }
.mbti .scale-opt.selected .dot::after{ background: var(--ink); transform: scale(1); }
.mbti .scale-opt:active{ transform: scale(0.99); }
.mbti .calc-text{
  font-family: var(--serif);
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-top: 8px;
}
.mbti .screen.result{ padding-top: calc(36px + var(--safe-top)); }
.mbti .result-hero{ text-align: center; margin-bottom: 28px; }
.mbti .type-code{
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(64px, 20vw, 92px);
  letter-spacing: 0.08em;
  line-height: 1;
  margin: 6px 0 10px;
  color: var(--paper);
}
.mbti .type-code .letter{
  display: inline-block;
  animation: stamp 0.7s cubic-bezier(0.22, 1, 0.32, 1) both;
}
@keyframes stamp{
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.mbti .type-nick{
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  margin: 8px 0 10px;
  color: var(--gold);
}
.mbti .type-tag{
  font-family: var(--serif);
  color: var(--muted);
  margin: 0;
  font-size: 16px;
}
.mbti .axes{
  margin: 8px 0 28px;
  padding: 20px 18px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(244, 237, 225, 0.03);
}
.mbti .axis{ margin-bottom: 18px; }
.mbti .axis-labs, .mbti .axis-pcts{
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
}
.mbti .axis-labs .on, .mbti .axis-pcts .on{ color: var(--paper); font-weight: 600; }
.mbti .axis-pcts{ margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--muted-2); }
.mbti .axis-pcts .on{ color: var(--gold); }
.mbti .axis-track{
  position: relative;
  height: 8px;
  margin-top: 8px;
  background: rgba(244, 237, 225, 0.12);
  border-radius: 99px;
}
.mbti .axis-fill{
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(224, 192, 136, 0.5);
  border-radius: 99px;
}
.mbti .axis-mid{
  position: absolute;
  left: 50%;
  top: -3px;
  width: 1px;
  height: 14px;
  background: rgba(244, 237, 225, 0.25);
}
.mbti .axis-knob{
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  background: var(--gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--bg), 0 0 16px rgba(224, 192, 136, 0.45);
}
.mbti .card{
  margin: 0 0 14px;
  padding: 20px 18px 18px;
  border-radius: var(--radius);
  background: #1c1814;
  border: 1px solid rgba(224, 192, 136, 0.14);
}
.mbti .card h3{
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--gold);
}
.mbti .card p{ margin: 0; color: var(--paper-dim); font-size: 16px; }
.mbti .card ul{ margin: 0; padding: 0 0 0 1.1em; color: var(--paper-dim); }
.mbti .card li{ margin: 0 0 8px; }
.mbti .card li:last-child{ margin-bottom: 0; }
.mbti .compat li strong{
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--paper);
  font-weight: 600;
}
.mbti .compat li span{ color: var(--muted); }
.mbti .disclaimer{
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.7;
  margin: 22px 0 20px;
}
.mbti .result-actions{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-bottom: 20px;
}
.mbti .result-actions .btn{ width: 100%; }
.mbti .sheet{
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 7, 0.82);
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(16px + var(--safe-bot));
}
.mbti .sheet.hidden, .mbti .sheet[hidden]{ display: none; }
.mbti .sheet-inner{
  width: min(480px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  max-height: 88dvh;
  overflow: auto;
}
.mbti .sheet-inner p{ color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.mbti .sheet-inner img{
  width: 100%;
  border-radius: 12px;
  display: block;
  margin-bottom: 14px;
}
@media (prefers-reduced-motion: reduce){.mbti .view-inner.view-fwd, .mbti .view-inner.view-back, .mbti .type-code .letter, .mbti .compass.spin, .mbti .bar-fill, .mbti .btn, .mbti .scale-opt{
    animation: none !important;
    transition: none !important;
  }}
@media (min-width: 720px){.mbti .view{ box-shadow: 0 0 0 1px rgba(224, 192, 136, 0.08); }}
.mbti{background:#120f0c;color:#f4ede1;font-family:var(--sans);border-radius:24px;overflow:hidden;margin:0 -6px;box-shadow:0 10px 40px rgba(0,0,0,.4)}
.mbti .screen.intro,.mbti .screen.calc{min-height:70vh}
.mbti-back{display:inline-block;color:#e0c088;padding:10px 14px;text-decoration:none;font-size:15px}
.mbti .quiz-bar{top:0}
