/* CSS Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #1e1b4b;
  --bg-secondary: #4c1d95;
  --bg-tertiary: #5b21b6;
  --text-primary: #ffffff;
  --text-secondary: rgba(221, 214, 254, 0.8);
  --text-muted: rgba(196, 181, 228, 0.5);
  --pink-300: #fbcfe8;
  --purple-300: #c4b5fd;
  --purple-400: #a78bfa;
  --green-400: #4ade80;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --radius: 1rem;
  --radius-lg: 1.5rem;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
#app {
  position: relative;
  min-height: 100vh;
}

/* Background Decoration */
.bg-decoration {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: pulse 4s ease-in-out infinite;
}

.orb-1 {
  width: 288px;
  height: 288px;
  background: rgba(168, 85, 247, 0.2);
  top: 80px;
  left: 40px;
}

.orb-2 {
  width: 384px;
  height: 384px;
  background: rgba(99, 102, 241, 0.2);
  bottom: 80px;
  right: 40px;
  animation-delay: 1s;
}

.orb-3 {
  width: 256px;
  height: 256px;
  background: rgba(236, 72, 153, 0.1);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 2s;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.emoji-float {
  position: absolute;
  opacity: 0.2;
  animation: float 3s ease-in-out infinite;
}

.emoji-1 { top: 128px; right: 25%; font-size: 4rem; animation-duration: 3s; }
.emoji-2 { bottom: 33%; left: 25%; font-size: 3rem; animation-duration: 2.5s; animation-delay: 0.5s; }
.emoji-3 { top: 25%; left: 33%; font-size: 2rem; animation-duration: 2s; animation-delay: 1s; }
.emoji-4 { bottom: 25%; right: 33%; font-size: 5rem; animation-duration: 4s; animation-delay: 0.3s; }

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

/* Page System */
.page {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  animation: fadeIn 0.5s ease;
}

.page.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Container */
.container {
  width: 100%;
  max-width: 896px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  font-size: 0.875rem;
  backdrop-filter: blur(10px);
}

.badge-dot {
  position: relative;
  width: 8px;
  height: 8px;
}

.badge-dot::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--green-400);
  border-radius: 50%;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.badge-dot::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--green-400);
  border-radius: 50%;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

/* Typography */
.title-main {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink-300), var(--purple-300), #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.title-sub {
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--purple-300);
  text-align: center;
  margin-bottom: 2rem;
}

.intro {
  font-size: 1.125rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

/* Features Grid */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.feature-emoji {
  font-size: 1.75rem;
}

.feature-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 2rem;
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px -10px rgba(168, 85, 247, 0.5);
}

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

.btn-secondary {
  display: block;
  width: 100%;
  max-width: 200px;
  margin: 0 auto 2.5rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  color: white;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.warning {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Test Page */
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--purple-300);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-back:hover {
  color: white;
}

.progress-text {
  font-size: 0.875rem;
  color: rgba(196, 181, 228, 0.7);
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ec4899, #a855f7);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Question Card */
.question-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.question-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: #f9a8d4;
  background: rgba(236, 72, 153, 0.2);
  border-radius: 9999px;
  margin-bottom: 1rem;
}

.question-text {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option {
  width: 100%;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
  text-align: left;
  color: rgba(255, 255, 255, 0.9);
  background: var(--glass-bg);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
}

.option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border);
  transform: translateX(4px);
}

.option.selected {
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.3), rgba(168, 85, 247, 0.3));
  border-color: rgba(236, 72, 153, 0.5);
}

.option-letter {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  color: var(--purple-300);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.option.selected .option-letter {
  background: #ec4899;
  color: white;
}

/* Dots */
.dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.dot.active {
  width: 24px;
  border-radius: 4px;
  background: #ec4899;
}

.dot.completed {
  background: #a855f7;
}

/* Result Page */
.result-header {
  text-align: center;
  margin-bottom: 2rem;
}

.result-title {
  font-size: clamp(1.75rem, 6vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.result-subtitle {
  color: rgba(196, 181, 228, 0.7);
  font-size: 0.875rem;
}

/* Main Type Card */
.main-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(236, 72, 153, 0.3);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .main-type-card {
    flex-direction: row;
    text-align: left;
  }
}

.main-type-icon {
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.main-type-info {
  text-align: center;
}

@media (min-width: 640px) {
  .main-type-info {
    text-align: left;
  }
}

.main-type-label {
  font-size: 0.875rem;
  color: #f9a8d4;
  margin-bottom: 0.25rem;
}

.main-type-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.main-type-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .main-type-keywords {
    justify-content: flex-start;
  }
}

.keyword {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  color: rgba(221, 214, 254, 0.8);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
}

.main-type-desc {
  font-size: 1rem;
  color: rgba(221, 214, 254, 0.8);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  text-align: center;
  backdrop-filter: blur(10px);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(196, 181, 228, 0.7);
}

.stat-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 1s ease;
}

/* AI Analysis */
.ai-analysis-card {
  padding: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.ai-analysis-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ai-emoji {
  font-size: 1.75rem;
}

.ai-label {
  font-size: 0.875rem;
  color: rgba(196, 181, 228, 0.7);
}

.ai-analysis-text {
  font-size: 1rem;
  color: rgba(221, 214, 254, 0.9);
  line-height: 1.75;
}

/* Sections */
.section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgba(196, 181, 228, 0.8);
  text-align: center;
  margin-bottom: 1rem;
}

/* Secondary Types */
.secondary-types {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .secondary-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

.secondary-type {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.secondary-type-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.secondary-type-info {
  flex: 1;
  min-width: 0;
}

.secondary-type-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.secondary-type-score {
  font-size: 0.875rem;
  color: rgba(196, 181, 228, 0.6);
}

.secondary-type-rank {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
}

/* All Types */
.all-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .all-types {
    grid-template-columns: repeat(3, 1fr);
  }
}

.all-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.all-type:first-child {
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.all-type:not(:first-child) {
  background: var(--glass-bg);
}

.all-type-emoji {
  font-size: 1rem;
}

.all-type-name {
  flex: 1;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.all-type-rank {
  font-size: 0.75rem;
  color: rgba(196, 181, 228, 0.5);
}

/* Share Section */
.share-section {
  padding: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-btn:hover {
  transform: scale(1.05);
}

.share-btn-green {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.share-btn-green:hover {
  background: rgba(34, 197, 94, 0.3);
}

.share-btn-red {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.share-btn-red:hover {
  background: rgba(239, 68, 68, 0.3);
}

.share-btn-wechat {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.share-btn-wechat:hover {
  background: rgba(34, 197, 94, 0.3);
}

.share-btn-blue {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.share-btn-blue:hover {
  background: rgba(59, 130, 246, 0.3);
}

.share-emoji {
  font-size: 1rem;
}

.share-preview {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
}

.share-preview-label {
  font-size: 0.75rem;
  color: rgba(196, 181, 228, 0.5);
  margin-bottom: 0.5rem;
}

.share-preview-text {
  font-size: 0.875rem;
  color: rgba(196, 181, 228, 0.8);
  line-height: 1.5;
}

/* Footer */
.footer {
  text-align: center;
  padding-bottom: 2.5rem;
  color: rgba(196, 181, 228, 0.4);
  font-size: 0.875rem;
}

.footer p:first-child {
  margin-bottom: 0.25rem;
}

/* Mobile Optimizations */
@media (max-width: 639px) {
  .emoji-float:not(.emoji-3) {
    display: none;
  }
  
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .feature {
    padding: 0.75rem;
  }
  
  .feature-emoji {
    font-size: 1.5rem;
  }
  
  .dots {
    gap: 2px;
  }
  
  .dot {
    width: 6px;
    height: 6px;
  }
  
  .dot.active {
    width: 20px;
  }
}

/* Hide scrollbar but allow scrolling */
html {
  scroll-behavior: smooth;
}

/* Hide elements */
.hidden {
  display: none !important;
}
