/* ============================================
   MBTI Test — Layout
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* 全局背景光晕 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-glow);
  pointer-events: none;
  z-index: 0;
}

/* ---- Screen 容器 ---- */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-lg);
  padding-top: calc(var(--safe-top) + var(--space-lg));
  padding-bottom: calc(var(--safe-bottom) + var(--space-lg));
  position: relative;
  z-index: 1;
}

.screen.active {
  display: flex;
}

/* ---- Welcome Screen ---- */
.screen--welcome {
  justify-content: center;
  text-align: center;
  background: var(--gradient-hero);
}

.screen--welcome .hero-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e0d0ff, #ffffff, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-md);
}

.screen--welcome .hero-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 320px;
}

.screen--welcome .hero-meta {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  margin-top: var(--space-xl);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.screen--welcome .hero-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ---- Question Screen ---- */
.screen--question {
  justify-content: flex-start;
  padding-top: calc(var(--safe-top) + var(--space-md));
}

.question-header {
  width: 100%;
  max-width: 420px;
  margin-bottom: var(--space-xl);
}

.question-body {
  width: 100%;
  max-width: 420px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.question-nav {
  width: 100%;
  max-width: 420px;
  padding: var(--space-md) 0;
}

/* ---- Loading Screen ---- */
.screen--loading {
  justify-content: center;
  text-align: center;
}

/* ---- Result Screen ---- */
.screen--result {
  justify-content: flex-start;
  padding-top: calc(var(--safe-top) + var(--space-xl));
  gap: var(--space-lg);
}

.result-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* ---- 响应式 ---- */
@media (max-width: 375px) {
  :root {
    --text-4xl: 30px;
    --text-3xl: 24px;
  }

  .screen {
    padding: var(--space-md);
  }
}

@media (min-width: 768px) {
  .screen {
    padding: var(--space-xl);
  }
}
