/* AI Interviewer — Cosmos Deep Space Theme */
/* 镜见 · AI面试官 — 深空宇宙主题 */

:root {
  /* Core Cosmos Palette */
  --cosmos-deep: #0A0A1A;
  --cosmos-darker: #0F0F23;
  --cosmos-dark: #151530;
  --cosmos-mid: #1E1E3F;
  --cosmos-light: #2A2A55;

  /* Nebula Colors */
  --nebula-purple: #818CF8;
  --nebula-indigo: #6366F1;
  --nebula-deep: #4F46E5;
  --nebula-soft: rgba(129, 140, 248, 0.12);
  --nebula-medium: rgba(129, 140, 248, 0.20);
  --nebula-glow: rgba(129, 140, 248, 0.35);

  /* Cyan Accent */
  --cyan-glow: #22D3EE;
  --cyan-bright: #06B6D4;
  --cyan-soft: rgba(34, 211, 238, 0.10);
  --cyan-medium: rgba(34, 211, 238, 0.18);
  --cyan-glow-strong: rgba(34, 211, 238, 0.30);

  /* Gold / Amber */
  --gold-star: #F59E0B;
  --gold-bright: #FBBF24;
  --gold-soft: rgba(245, 158, 11, 0.10);
  --gold-medium: rgba(245, 158, 11, 0.20);

  /* Rose / Red */
  --rose-cosmic: #F43F5E;
  --rose-soft: rgba(244, 63, 94, 0.10);
  --rose-medium: rgba(244, 63, 94, 0.18);

  /* Teal / Mint */
  --teal-nebula: #34D399;
  --teal-soft: rgba(52, 211, 153, 0.10);
  --teal-medium: rgba(52, 211, 153, 0.18);

  /* Amber Warm */
  --amber-warm: #FB923C;
  --amber-soft: rgba(251, 146, 60, 0.10);

  /* Text Colors */
  --text-primary: #F0EEFF;
  --text-secondary: #A5A3C8;
  --text-muted: #6B6994;
  --text-dim: #4A4870;

  /* Borders & Surfaces */
  --border-subtle: rgba(129, 140, 248, 0.15);
  --border-medium: rgba(129, 140, 248, 0.25);
  --border-focus: var(--cyan-glow);

  /* Background system */
  --bg-deep: var(--cosmos-deep);
  --bg-base: var(--cosmos-darker);
  --bg-surface: rgba(30, 30, 63, 0.6);
  --bg-elevated: rgba(42, 42, 85, 0.7);
  --bg-card: rgba(21, 21, 48, 0.7);

  /* Gradients */
  --gradient-cosmos: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.18) 0%, transparent 60%),
                    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(34, 211, 238, 0.08) 0%, transparent 50%),
                    linear-gradient(180deg, #0A0A1A 0%, #0F0F23 50%, #0A0A1A 100%);
  --gradient-nebula: linear-gradient(135deg, #818CF8 0%, #6366F1 50%, #4F46E5 100%);
  --gradient-cyan: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  --gradient-gold: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);

  /* Typography */
  --font-display: "SF Pro Display", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-body: "SF Pro Text", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "SF Mono", "Menlo", "Consolas", "Courier New", monospace;

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

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows & Glows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --glow-nebula: 0 0 20px rgba(129, 140, 248, 0.25);
  --glow-cyan: 0 0 20px rgba(34, 211, 238, 0.25);
  --glow-gold: 0 0 20px rgba(245, 158, 11, 0.25);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;

  /* Nav */
  --nav-height: 48px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  padding-top: var(--nav-height);
  overflow-x: hidden;
}

/* ===== Starfield Background ===== */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--gradient-cosmos);
}

.page-bg::before,
.page-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-repeat: repeat;
}

.page-bg::before {
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 40px 70px, rgba(200, 200, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 90px 40px, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(180, 180, 230, 0.5), transparent),
    radial-gradient(1px 1px at 160px 120px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 200px 50px, rgba(160, 200, 255, 0.4), transparent),
    radial-gradient(1px 1px at 250px 90px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 300px 140px, rgba(200, 180, 255, 0.5), transparent),
    radial-gradient(1px 1px at 340px 20px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 380px 110px, rgba(220, 220, 255, 0.6), transparent);
  background-size: 400px 180px;
  animation: starDrift 120s linear infinite;
  opacity: 0.8;
}

.page-bg::after {
  background-image:
    radial-gradient(1px 1px at 50px 100px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 100px 150px, rgba(150, 180, 255, 0.4), transparent),
    radial-gradient(1px 1px at 180px 60px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 260px 200px, rgba(200, 160, 255, 0.3), transparent),
    radial-gradient(1px 1px at 320px 100px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 370px 170px, rgba(180, 200, 255, 0.4), transparent);
  background-size: 450px 250px;
  animation: starDrift 180s linear infinite reverse;
  opacity: 0.6;
}

@keyframes starDrift {
  from { transform: translateY(0); }
  to { transform: translateY(-200px); }
}

/* Twinkling stars */
@keyframes twinkle {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Nebula glow orbs */
.nebula-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  animation: nebulaFloat 20s ease-in-out infinite;
}

.nebula-orb.purple {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
  top: -100px;
  right: -100px;
}

.nebula-orb.cyan {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.25) 0%, transparent 70%);
  bottom: 10%;
  left: -50px;
  animation-delay: -10s;
}

@keyframes nebulaFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.98); }
}

/* ===== Page Structure ===== */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  animation: pageFadeIn 0.5s ease-out both;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl) var(--space-xl);
  position: relative;
  z-index: 1;
}

/* ===== Global Navigation ===== */
.global-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(10, 10, 26, 0.75);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-brand i {
  color: var(--nebula-purple);
  filter: drop-shadow(0 0 6px var(--nebula-glow));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--nebula-soft);
  color: var(--nebula-purple);
  box-shadow: inset 0 0 0 1px var(--border-medium);
}

.nav-link i { width: 16px; height: 16px; }

@media (max-width: 480px) {
  .nav-link span { display: none; }
  .nav-link { padding: 8px; }
  .nav-brand span { display: none; }
}

/* ===== Base Elements ===== */
button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: var(--space-lg);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--nebula-medium), transparent);
  opacity: 0.5;
}

.card-flat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
}

.card-flat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--nebula-medium), transparent);
  opacity: 0.5;
}

.card-hover {
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal), transform var(--transition-fast);
}

.card-hover:hover, .card-hover:focus-within {
  box-shadow: var(--glow-nebula), var(--shadow-lg);
  border-color: var(--border-medium);
}

/* Card header with icon (Warm Instrument style) */
.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.card-header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--nebula-soft);
  color: var(--nebula-purple);
  box-shadow: inset 0 0 0 1px var(--border-medium);
}

.card-header-icon i { width: 18px; height: 18px; }

.card-header-text h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.card-header-text p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:disabled { opacity: 0.5; cursor: default; }

/* Primary — Nebula gradient */
.btn-primary {
  background: var(--gradient-nebula);
  color: #fff;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Warm — Cyan accent */
.btn-warm {
  background: var(--gradient-cyan);
  color: #0A0A1A;
  box-shadow: 0 2px 12px rgba(34, 211, 238, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 600;
}
.btn-warm:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Text button */
.btn-text {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.btn-text:hover:not(:disabled) { color: var(--text-secondary); text-decoration: underline; }

/* ===== Inputs ===== */
.input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(15, 15, 35, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  backdrop-filter: blur(4px);
}
.input:focus {
  border-color: var(--cyan-bright);
  box-shadow: 0 0 0 3px var(--cyan-soft), 0 0 12px rgba(34, 211, 238, 0.15);
}
.input::placeholder { color: var(--text-dim); }

select option {
  background: var(--cosmos-dark);
  color: var(--text-primary);
}

.select-wrapper { position: relative; }
.select-wrapper select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
}
.select-wrapper .chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.label {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Chips ===== */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
}

.chip-active {
  background: var(--nebula-soft);
  color: var(--nebula-purple);
  border-color: var(--nebula-medium);
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.15);
}

.chip-inactive {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.chip-inactive:hover {
  border-color: var(--nebula-purple);
  color: var(--nebula-purple);
  background: var(--nebula-soft);
}

/* ===== Section Titles ===== */
.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-xs);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 var(--space-md);
}

/* ===== Animations ===== */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes softPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes softBounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@keyframes radarScale {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px var(--nebula-glow); }
  50% { box-shadow: 0 0 20px var(--nebula-glow), 0 0 40px rgba(129, 140, 248, 0.15); }
}

@keyframes cyanGlow {
  0%, 100% { box-shadow: 0 0 8px var(--cyan-glow-strong); }
  50% { box-shadow: 0 0 20px var(--cyan-glow-strong), 0 0 40px rgba(34, 211, 238, 0.15); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .page-bg::before, .page-bg::after { animation: none !important; }
  .nebula-orb { animation: none !important; }
}

/* ===== Report-specific Components ===== */
.noderow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.noderow:last-child { border-bottom: none; }
.good { color: var(--teal-nebula); font-weight: 600; }
.bad { color: var(--gold-star); font-weight: 600; }

.flag {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--rose-soft);
  color: #FDA4AF;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin: 6px 0;
  border: 1px solid var(--rose-medium);
}

.roaditem {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 8px 0;
}
.roaditem.locked {
  position: relative;
  overflow: hidden;
}
.roaditem.locked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 26, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.roadnum {
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-nebula);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}
.roadnum.lock { background: var(--text-dim); box-shadow: none; }
.roadtext { flex: 1; font-size: 14px; color: var(--text-primary); }
.roadnode { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.paywall {
  text-align: center;
  padding: var(--space-lg);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
  background: var(--bg-elevated);
}

/* ===== Stat Grid (Report page) ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}
.stat-item {
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  background: var(--bg-deep);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.stat-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto var(--space-xs);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nebula-soft);
  color: var(--nebula-purple);
}
.stat-icon i { width: 18px; height: 18px; }
.stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.w-full { width: 100%; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.grid { display: grid; }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-4 { gap: var(--space-md); }
.inline-flex { display: inline-flex; }
.w-9 { width: 36px; }
.h-9 { height: 36px; }

/* Radar responsiveness */
.radar-wrap svg { max-width: 100%; height: auto; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .container {
    padding: var(--space-md) var(--space-md) var(--space-lg);
    max-width: 100%;
  }

  .card, .card-flat {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .profile-options { flex-direction: column; }
  .profile-option {
    flex-direction: row;
    justify-content: flex-start;
    padding: var(--space-sm) var(--space-md);
  }

  .chip-row { flex-wrap: wrap; }
}
