/* ========================================
   MBTI 人格测试 - 公共样式
   ======================================== */

/* ── CSS Variables ── */
:root {
  --bg-deep:       #07091a;
  --bg-primary:    #0d1230;
  --bg-card:       rgba(20, 28, 72, 0.55);
  --bg-card-hover: rgba(35, 50, 110, 0.8);
  --accent-gold:   #f0c674;
  --accent-purple: #9d7cd8;
  --accent-cyan:   #7dcfff;
  --accent-pink:   #ff79c6;
  --accent-green:  #9ece6a;
  --accent-orange: #ff9e64;
  --accent-blue:   #7aa2f7;
  --accent-red:    #f7768e;
  --text-primary:  #e8e6f0;
  --text-secondary:#8a87a8;
  --border:        rgba(157, 124, 216, 0.18);
  --glow-gold:     0 0 24px rgba(240, 198, 116, 0.45);
  --glow-purple:   0 0 30px rgba(157, 124, 216, 0.35);
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background Effects ── */
.nebula {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(157,124,216,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(122,162,247,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255,121,198,0.05) 0%, transparent 60%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(157,124,216,0.1) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 90%, rgba(122,162,247,0.07) 0%, transparent 60%);
}

/* ── Particle Canvas ── */
#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Navigation ── */
nav, header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  background: rgba(7, 9, 26, 0.7);
  border-bottom: 1px solid var(--border);
}

.nav-logo, .logo {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-decoration: none;
  letter-spacing: 3px;
  text-shadow: var(--glow-gold);
}

.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.3s;
  font-weight: 400;
}
.nav-links a:hover { color: var(--accent-gold); }

/* ── Sections ── */
.section {
  position: relative;
  z-index: 1;
  padding: 120px 48px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 80px 32px 100px;
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 80px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--accent-purple);
  margin-bottom: 32px;
  animation: fadeUp 0.8s ease both;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 24px;
  animation: fadeUp 0.8s 0.2s ease both;
}

.hero-title .gold { color: var(--accent-gold); text-shadow: var(--glow-gold); }
.hero-title .purple { color: var(--accent-purple); text-shadow: var(--glow-purple); }

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 48px;
  animation: fadeUp 0.8s 0.4s ease both;
}

.hero-btns {
  display: flex;
  gap: 20px;
  animation: fadeUp 0.8s 0.6s ease both;
}

/* ── Buttons ── */
.btn-primary {
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--accent-purple), #7b5ea7);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 24px rgba(157,124,216,0.4);
  letter-spacing: 1px;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(157,124,216,0.6);
}

.btn-outline {
  padding: 16px 40px;
  background: transparent;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  border-radius: 50px;
  font-size: 1rem;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}
.btn-outline:hover {
  background: rgba(240,198,116,0.1);
  transform: translateY(-3px);
}

.action-btn {
  padding: 13px 28px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-download {
  background: linear-gradient(135deg, var(--accent-purple), #7b5ea7);
  color: #fff;
  box-shadow: 0 4px 20px rgba(157,124,216,0.4);
}
.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(157,124,216,0.55);
}

.btn-share {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  border: 1px solid var(--border) !important;
}
.btn-share:hover { background: rgba(255,255,255,0.12); }

/* ── Section Headers ── */
.section-label {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 4px;
  color: var(--accent-purple);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.section-title {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 60px;
  line-height: 1.8;
}

/* ── Cards ── */
.feature-card {
  padding: 40px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-align: center;
  transition: all 0.4s;
  backdrop-filter: blur(12px);
}
.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(157,124,216,0.4);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(157,124,216,0.15);
}

.feature-icon {
  font-size: 2.8rem;
  margin-bottom: 20px;
  display: block;
}

.feature-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--accent-gold);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* ── Type Grid ── */
.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.type-card {
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.4s;
  backdrop-filter: blur(12px);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.type-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--card-accent, var(--accent-purple)), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.type-card:hover::before { opacity: 1; }

.type-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  border-color: rgba(157,124,216,0.4);
}

.type-code {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 4px;
  display: block;
  line-height: 1;
}

.type-name {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}

.type-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
}

footer a { color: var(--accent-purple); text-decoration: none; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--accent-purple); border-radius: 3px; }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13,18,48,0.95);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.88rem;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(20px);
  white-space: nowrap;
}
#toast.show { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  nav, header { padding: 16px 24px; }
  .section { padding: 100px 24px 60px; }
}

@media (max-width: 600px) {
  .type-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero-btns { flex-direction: column; align-items: center; }
}
