/* ==================== Reset & Base ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.08);
  --purple: #8b5cf6;
  --blue: #06b6d4;
  --green: #22c55e;
  --orange: #f97316;
  --red: #ef4444;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: rgba(255,255,255,0.08);
  --glow-purple: 0 0 20px rgba(139,92,246,0.3);
  --glow-blue: 0 0 20px rgba(6,182,212,0.3);
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Grid background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(139,92,246,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ==================== Intro Screen ==================== */
#intro-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  text-align: center;
  overflow: hidden;
}

.logo {
  font-size: 80px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.title {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 40px;
  text-align: center;
  width: 100%;
}

.subtitle span {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: block;
  margin-top: 8px;
}

.btn-start {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  border: none;
  padding: 16px 48px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-purple), var(--glow-blue);
}

.btn-start:active {
  transform: translateY(0);
}

/* ==================== Test Screen ==================== */
#test-screen { display: none; }

.progress-bar-container {
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  padding: 20px 0 16px;
  z-index: 10;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: right;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.question-card:hover {
  border-color: rgba(139,92,246,0.2);
}

.question-number {
  font-size: 0.8rem;
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 24px;
  line-height: 1.7;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  line-height: 1.5;
}

.option-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(139,92,246,0.3);
  color: var(--text-primary);
}

.option-btn.selected {
  background: rgba(139,92,246,0.15);
  border-color: var(--purple);
  color: var(--text-primary);
  box-shadow: var(--glow-purple);
}

.option-label {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.option-btn.selected .option-label {
  background: var(--purple);
}

.btn-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 12px;
  opacity: 0.4;
  pointer-events: none;
}

.btn-submit.active {
  opacity: 1;
  pointer-events: auto;
}

.btn-submit.active:hover {
  box-shadow: var(--glow-purple), var(--glow-blue);
  transform: translateY(-1px);
}

/* ==================== Result Screen ==================== */
#result-screen { display: none; }

.result-hero {
  text-align: center;
  padding: 48px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.result-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(139,92,246,0.08), transparent 50%);
  pointer-events: none;
}

.result-emoji {
  font-size: 72px;
  margin-bottom: 16px;
  animation: result-pop 0.5s ease-out;
}

@keyframes result-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.result-type-code {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.result-type-cn {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.result-intro {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--text-primary);
  font-style: italic;
}

.result-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: left;
}

.result-match {
  display: inline-block;
  margin-top: 20px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(34,197,94,0.15);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.3);
}

/* Traits */
.result-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  justify-content: center;
}

.trait-tag {
  padding: 6px 14px;
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--purple);
}

/* Dimension Scores */
.dimensions-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.dimensions-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.dimension-group {
  margin-bottom: 16px;
}

.dimension-group:last-child { margin-bottom: 0; }

.dimension-group-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: 600;
}

.dimension-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.dimension-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
}

.dimension-bar-bg {
  flex: 2;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin: 0 12px;
  overflow: hidden;
}

.dimension-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.dimension-bar-fill.low { background: var(--blue); }
.dimension-bar-fill.mid { background: var(--purple); }
.dimension-bar-fill.high { background: var(--orange); }

.dimension-level {
  font-size: 0.75rem;
  font-weight: 600;
  width: 20px;
  text-align: center;
}

.dimension-level.low { color: var(--blue); }
.dimension-level.mid { color: var(--purple); }
.dimension-level.high { color: var(--orange); }

/* Buttons */
.result-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-secondary {
  flex: 1;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(139,92,246,0.3);
}

/* Share watermark */
.share-area {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.share-area .url {
  color: var(--purple);
  font-weight: 600;
}

/* ==================== Loading ==================== */
.loading-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

.loading-emoji {
  font-size: 64px;
  animation: float 1.5s ease-in-out infinite;
}

.loading-text {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ==================== Responsive ==================== */
@media (max-width: 480px) {
  .container { padding: 24px 16px; }
  .title { font-size: 2.2rem; }
  .question-card { padding: 24px 20px; }
  .result-hero { padding: 36px 20px; }
  .result-emoji { font-size: 56px; }
  .result-actions { flex-direction: column; }
}

/* ==================== Animations ==================== */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
