/* =============================================
   Fathom — Investor Cognition Assessment
   Aesthetic: Slate Indigo — 黛蓝矿物冷调
   ============================================= */

:root {
  /* Core palette — 薰衣灰 × 矿紫 */
  --ink: #EEEDF5;
  --ink-deep: #E0DFE9;
  --surface-1: #F9F8FC;
  --surface-2: #E0DFE9;
  --surface-3: #D4D2E0;
  --surface-4: #CCC9D8;

  /* Text */
  --text-primary: #1E1B2E;
  --text-secondary: #4A4660;
  --text-muted: #7B7890; /* WCAG AA 4.5:1+ on --ink */

  /* Accents */
  --amber: #5B4A8A;
  --amber-dim: #4A3A75;
  --amber-glow: rgba(91, 74, 138, 0.10);
  --jade: #3A7D6C;
  --jade-dim: rgba(58, 125, 108, 0.10);
  --vermilion: #A84448;
  --vermilion-dim: rgba(168, 68, 72, 0.10);

  /* Semantic colors */
  --info: #3b82f6;
  --warning: #f59e0b;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* Typography */
  --font-display: 'Noto Serif SC', 'Songti SC', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', sans-serif;
  --font-mono: 'DM Mono', 'SF Mono', monospace;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Grain texture overlay */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ============ VIEWS ============ */
.view {
  display: none;
  min-height: 100dvh;
}
.view.active {
  display: flex;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 var(--amber-glow); }
  50% { box-shadow: 0 0 20px 4px var(--amber-glow); }
}

@keyframes inkSpread {
  from { clip-path: circle(0% at 50% 50%); }
  to { clip-path: circle(100% at 50% 50%); }
}

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to { background-position: 200% 0; }
}

@keyframes scoreCount {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes ringDraw {
  from { stroke-dashoffset: 553; }
}

@keyframes feedbackCorrect {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes feedbackWrong {
  0% { opacity: 0; transform: translateX(0); }
  20% { opacity: 1; transform: translateX(-8px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: var(--jade); }
  100% { transform: scale(1); }
}

@keyframes barGrow {
  from { width: 0; }
  to { width: var(--target-width); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ LANDING VIEW ============ */
.landing-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  padding-bottom: env(safe-area-inset-bottom, var(--space-xl));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeInUp 0.8s ease-out;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.brand-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.brand-tagline {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  margin-top: 2px;
}

/* Landing main */
.landing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-2xl) 0;
}

/* Search section */
.search-section {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.search-label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.search-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.search-box {
  position: relative;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.3s;
}

#search-input {
  width: 100%;
  padding: var(--space-md) var(--space-md) var(--space-md) 48px;
  background: var(--surface-2);
  border: 1px solid var(--surface-4);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.1rem;
  outline: none;
  transition: all 0.3s ease;
}

#search-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

#search-input:focus {
  border-color: var(--amber-dim);
  background: var(--surface-1);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

#search-input:focus ~ .search-icon,
.search-input-wrap:focus-within .search-icon {
  color: var(--amber);
}

.search-loading {
  position: absolute;
  right: var(--space-md);
  display: none;
  gap: 4px;
}
.search-loading.active { display: flex; }

.loading-dot {
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
  animation: dotPulse 1.2s infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--surface-4);
  border-radius: var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.search-results.active { display: block; }

.search-result-item {
  padding: var(--space-md);
  cursor: pointer;
  border-bottom: 1px solid var(--surface-3);
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-3); }

.result-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.result-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}
.result-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.result-score {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--amber-dim);
  padding: 2px 8px;
  background: var(--amber-glow);
  border-radius: 20px;
}

/* Divider */
.section-divider {
  text-align: center;
  margin: var(--space-xl) 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  position: relative;
}
.section-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--surface-4), transparent);
}
.section-divider span {
  position: relative;
  background: var(--ink);
  padding: 0 var(--space-md);
}

/* Company grid */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.company-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.company-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.company-card:hover {
  border-color: var(--amber-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.company-card:hover::before { opacity: 1; }

.company-card-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.company-card-ticker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber);
  margin-bottom: var(--space-sm);
}

.company-card-sector {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Question count section */
.question-count-section {
  animation: fadeInUp 0.5s ease-out;
}

.selected-company-banner {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--amber);
  text-align: center;
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--amber-glow), transparent);
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 168, 83, 0.2);
}

.count-label {
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.count-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.count-btn {
  background: var(--surface-1);
  border: 2px solid var(--surface-3);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  cursor: pointer;
  color: var(--text-primary);
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.count-btn:hover {
  border-color: var(--amber-dim);
}

.count-btn.selected {
  border-color: var(--amber);
  background: var(--amber-glow);
}

.count-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 500;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.count-desc {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
}

.count-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.start-btn {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--amber);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: all 0.3s ease;
  margin-bottom: var(--space-md);
}

.start-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.start-btn:not(:disabled):hover {
  background: var(--amber-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--amber-glow);
}

.start-btn-arrow {
  width: 20px;
  height: 20px;
}

.back-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  padding: var(--space-sm);
  transition: color 0.3s;
}
.back-link:hover { color: var(--text-secondary); }

/* Landing footer */
.landing-footer {
  padding: var(--space-lg) 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ============ QUIZ VIEW ============ */
.quiz-container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-lg);
  padding-bottom: env(safe-area-inset-bottom, var(--space-lg));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.quiz-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.quiz-brand:hover { opacity: 1; }

.quiz-brand-icon {
  width: 32px;
  height: 32px;
}

.quiz-brand-text {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quiz-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.quiz-company {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--amber);
  font-weight: 600;
}

.quiz-progress-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Progress bar */
.progress-track {
  width: 100%;
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  border-radius: 2px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Phase bar */
.phase-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  padding: var(--space-sm) 0;
}

.phase-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.phase-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 3px 10px;
  background: var(--surface-2);
  border-radius: 20px;
  border: 1px solid var(--surface-4);
}

.phase-progress {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.score-indicator {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.score-current {
  color: var(--amber);
  font-weight: 500;
}
.score-current.score-bump {
  animation: scoreBump 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.score-divider { color: var(--text-muted); }
.score-max { color: var(--text-muted); font-size: 0.75rem; }

/* Question area */
.question-area {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding-top: var(--space-md);
}

.question-card {
  width: 100%;
  animation: fadeInUp 0.5s ease-out;
}

.question-type-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--amber);
  padding: 3px 10px;
  background: var(--amber-glow);
  border-radius: 20px;
  margin-bottom: var(--space-sm);
  letter-spacing: 0.05em;
}

.question-difficulty {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.question-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: var(--space-xl);
  color: var(--text-primary);
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-1);
  border: 1.5px solid var(--surface-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  color: var(--text-primary);
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}

.option-btn:hover {
  border-color: var(--amber-dim);
  background: var(--surface-2);
  transform: translateX(4px);
}

.option-btn:active {
  transform: translateX(2px) scale(0.98);
  transition: transform 0.1s ease-out;
}

.option-btn.selected {
  border-color: var(--amber);
  background: var(--amber-glow);
}

.option-btn.submitting {
  opacity: 0.6;
  pointer-events: none;
}

.option-letter {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--amber);
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--amber-dim);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.25s;
}

.option-btn:hover .option-letter {
  background: var(--amber);
  color: #fff;
}

.option-btn.selected .option-letter {
  background: var(--amber);
  color: #fff;
}

.option-content {
  flex: 1;
  padding-top: 2px;
}

/* ============ FEEDBACK OVERLAY ============ */
.feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 9, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}
.feedback-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

.feedback-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.feedback-card.correct {
  border-color: rgba(78, 201, 160, 0.3);
  animation: feedbackCorrect 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.feedback-card.wrong {
  border-color: rgba(224, 90, 79, 0.3);
  animation: feedbackWrong 0.4s ease-out;
}

.feedback-icon-wrap {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.feedback-icon {
  width: 64px;
  height: 64px;
  display: none;
}
.feedback-card.correct #feedback-icon-correct { display: inline-block; }
.feedback-card.wrong #feedback-icon-wrong { display: inline-block; }

.feedback-result {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.feedback-card.correct .feedback-result { color: var(--jade); }
.feedback-card.wrong .feedback-result { color: var(--vermilion); }

.feedback-points {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.feedback-correct-answer {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--jade);
  background: var(--jade-dim);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  display: none;
}
.feedback-card.wrong .feedback-correct-answer { display: block; }

.feedback-explanation {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: var(--space-md);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--surface-4);
  margin-bottom: var(--space-xl);
}

.feedback-next-btn {
  width: 100%;
  padding: var(--space-md);
  background: var(--surface-3);
  border: 1px solid var(--surface-4);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: all 0.3s;
}
.feedback-next-btn:hover {
  background: var(--surface-4);
  transform: translateY(-1px);
}

/* ============ REPORT VIEW ============ */
.report-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg);
  padding-bottom: env(safe-area-inset-bottom, var(--space-lg));
}

.report-header {
  margin-bottom: var(--space-xl);
}

.report-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Report hero */
.report-hero {
  text-align: center;
  padding: var(--space-2xl) 0;
  animation: fadeInUp 0.8s ease-out;
}

.report-company-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: var(--space-xs);
}

.report-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  margin-bottom: var(--space-xl);
}

.score-ring-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto var(--space-lg);
}

.score-ring {
  width: 100%;
  height: 100%;
}

.score-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring-percent {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score-ring-percent .pct-sign {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-left: 2px;
}

.score-ring-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.report-tier {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: var(--space-sm);
}

.report-score-detail {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Percentile badge */
.percentile-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber);
  background: var(--amber-glow);
  padding: var(--space-xs) var(--space-md);
  border-radius: 20px;
  display: inline-block;
  margin-bottom: var(--space-sm);
  letter-spacing: 0.03em;
}

/* Tier colors */
.tier-diamond { color: #8B9CF7; text-shadow: 0 0 20px rgba(139, 156, 247, 0.3); }
.tier-platinum { color: #B8B5C8; text-shadow: 0 0 20px rgba(184, 181, 200, 0.3); }
.tier-gold { color: var(--amber); text-shadow: 0 0 20px var(--amber-glow); }
.tier-silver { color: #9896A8; }
.tier-bronze { color: #8A7B6A; }

/* Report sections */
.report-section {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--surface-1);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-lg);
  animation: fadeInUp 0.6s ease-out;
}

.report-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.report-summary-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* Strengths & Weaknesses */
.report-sw-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  padding: var(--space-lg);
}

.sw-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: var(--space-md);
  font-size: 1rem;
}

.report-sw-list {
  list-style: none;
}

.report-sw-list li {
  padding: var(--space-sm) 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  border-bottom: 1px solid var(--surface-3);
}
.report-sw-list li:last-child { border-bottom: none; }

.sw-strength + .report-sw-list li::before {
  content: '+ ';
  color: var(--jade);
  font-family: var(--font-mono);
}

.sw-weakness + .report-sw-list li::before {
  content: '- ';
  color: var(--vermilion);
  font-family: var(--font-mono);
}

/* Radar chart */
.radar-wrap {
  display: flex;
  justify-content: center;
  padding: var(--space-md) 0;
}

#radar-canvas {
  max-width: 360px;
  max-height: 360px;
  width: 100%;
  height: auto;
}

/* Hypothesis list */
.hypothesis-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.hypothesis-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
}

.hypothesis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.hypothesis-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  margin-right: var(--space-md);
}

.hypothesis-score-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.hypothesis-bar {
  height: 4px;
  background: var(--surface-4);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.hypothesis-bar-fill {
  height: 100%;
  border-radius: 2px;
  width: 0;
  animation: barGrow 0.8s ease-out forwards;
  animation-delay: calc(var(--index) * 0.1s);
}

.hypothesis-detail {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Answer details */
.answers-list {
  display: none;
  flex-direction: column;
  gap: var(--space-sm);
}
.answers-list.expanded { display: flex; }

.toggle-answers-btn {
  background: var(--surface-3);
  border: 1px solid var(--surface-4);
  border-radius: 20px;
  padding: 4px 14px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
}
.toggle-answers-btn:hover { background: var(--surface-4); }

.answer-item {
  padding: var(--space-md);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--surface-4);
}
.answer-item.correct { border-left-color: var(--jade); }
.answer-item.wrong { border-left-color: var(--vermilion); }

.answer-q-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  line-height: 1.5;
}

.answer-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.answer-meta span.correct-text { color: var(--jade); }
.answer-meta span.wrong-text { color: var(--vermilion); }

/* LLM Analysis */
.llm-analysis {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.llm-analysis-block {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
}

.llm-block-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--surface-3);
}

.llm-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.llm-content p {
  margin-bottom: var(--space-sm);
}
.llm-content p:last-child {
  margin-bottom: 0;
}

.llm-list {
  list-style: none;
  margin: var(--space-sm) 0;
  padding: 0;
}

.llm-list li {
  padding: var(--space-xs) 0;
  padding-left: var(--space-md);
  position: relative;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.llm-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--amber);
  font-weight: 700;
}

.llm-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #fff;
  background: var(--amber);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Report actions */
.report-actions {
  display: flex;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.action-btn {
  flex: 1;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-4);
  background: var(--surface-1);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: all 0.3s;
}
.action-btn:hover {
  background: var(--surface-2);
  border-color: var(--amber-dim);
  transform: translateY(-1px);
}

.action-restart { border-color: var(--amber-dim); }

/* Report footer */
.report-footer {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============ LOADING VIEW ============ */
.loading-screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  gap: var(--space-lg);
}

.loading-icon {
  width: 64px;
  height: 64px;
}

.loading-text {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-secondary);
}

.loading-bar {
  width: 200px;
  height: 2px;
  background: var(--surface-3);
  border-radius: 1px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 30%;
  background: var(--amber);
  border-radius: 1px;
  animation: shimmer 1.5s infinite;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber), var(--amber-dim));
  background-size: 200% 100%;
}

/* ============ SKELETON LOADING ============ */
.skeleton-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  overflow: hidden;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: var(--space-sm);
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.long { width: 100%; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  :root { font-size: 15px; }

  .landing-container { padding: var(--space-lg) var(--space-md); }
  .brand-name { font-size: 1.6rem; }
  .search-label { font-size: 1.2rem; }
  .company-grid { grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
  .company-card { padding: var(--space-md) var(--space-sm); }

  .quiz-container { padding: var(--space-md); }
  .question-text { font-size: 1.15rem; }

  .report-sw-section { grid-template-columns: 1fr; }
  .report-actions { flex-direction: column; }
}

@media (max-width: 400px) {
  .company-grid { grid-template-columns: 1fr; }
  .count-buttons { grid-template-columns: 1fr; }
  .quiz-meta { flex-direction: column; align-items: flex-end; gap: 2px; }
}

/* ============ USER AUTH AREA ============ */
.user-area {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.login-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: transparent;
  border: 1px solid var(--surface-3);
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.login-btn:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--surface-3);
}

.user-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.logout-btn:hover {
  color: var(--vermilion);
}

/* Share button in report */
.action-share {
  background: var(--amber);
  color: white;
  border: none;
}
.action-share:hover {
  background: var(--amber-dim);
}
.action-share:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Expose share button in report */
.action-expose {
  background: var(--surface-1);
  color: var(--amber);
  border: 1px solid var(--amber);
}
.action-expose:hover {
  background: var(--amber-glow);
}
.action-expose:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
