:root {
  --bg: #0a0a0f;
  --bg-card: #13131f;
  --bg-card-hover: #1a1a2e;
  --accent: #a855f7;
  --accent2: #ec4899;
  --accent3: #6366f1;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --border: #1e293b;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans TC', sans-serif;
  margin: 0;
  overflow-x: hidden;
}
.font-mono { font-family: 'JetBrains Mono', monospace; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #312e4a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.hero-bg {
  background: radial-gradient(ellipse at 20% 0%, rgba(168,85,247,0.15), transparent 50%),
              radial-gradient(ellipse at 80% 50%, rgba(236,72,153,0.12), transparent 50%),
              radial-gradient(ellipse at 40% 100%, rgba(99,102,241,0.1), transparent 50%);
}

.glass {
  background: rgba(19,19,31,0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(168,85,247,0.12);
  border-radius: 16px;
  transition: all 0.3s ease;
}
.glass:hover {
  border-color: rgba(168,85,247,0.3);
  background: rgba(26,26,46,0.8);
}

.grad-text {
  background: linear-gradient(135deg, #a855f7, #ec4899, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.code-block {
  background: #0d0d18;
  border: 1px solid #1e1e3a;
  border-radius: 10px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c4b5fd;
  position: relative;
  overflow: hidden;
}

.nav-item {
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}
.nav-item.active {
  border-left-color: var(--accent);
  background: rgba(168,85,247,0.08);
  color: #c4b5fd;
}
.nav-item:hover {
  background: rgba(168,85,247,0.05);
  color: #d8b4fe;
}

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse-glow { 0%,100% { box-shadow: 0 0 20px rgba(168,85,247,0.2); } 50% { box-shadow: 0 0 40px rgba(168,85,247,0.4); } }
@keyframes fadeInUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }

.fade-up { animation: fadeInUp 0.5s ease forwards; }
.float-anim { animation: float 4s ease-in-out infinite; }
.pulse-fade { animation: pulseFade 4s ease-in-out infinite; }
.pulse-glow { animation: pulse-glow 3s ease-in-out infinite; }

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

.tab-btn {
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}
.tab-btn.active {
  color: #c4b5fd;
  border-bottom-color: var(--accent);
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(168,85,247,0.15);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: #c4b5fd;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0;
}
.code-block:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(168,85,247,0.3); }
.copy-btn.copied { background: rgba(34,197,94,0.2); border-color: rgba(34,197,94,0.3); color: #4ade80; }

.timeline-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  transition: all 0.3s;
  cursor: pointer;
  flex-shrink: 0;
}
.timeline-dot.active {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  box-shadow: 0 0 20px rgba(168,85,247,0.5);
  transform: scale(1.15);
  color: #fff;
}
.timeline-dot.done {
  background: rgba(34,197,94,0.2);
  border: 1px solid rgba(34,197,94,0.4);
  color: #4ade80;
}
.timeline-dot.pending {
  background: rgba(30,41,59,0.5);
  border: 1px solid rgba(99,102,241,0.2);
  color: #64748b;
}
.timeline-line {
  flex: 1;
  min-width: 20px;
  height: 2px;
  background: #1e293b;
  transition: background 0.3s;
}
.timeline-line.done { background: rgba(34,197,94,0.4); }

.bpm-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  outline: none;
}
.bpm-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(168,85,247,0.6);
}
.bpm-slider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(168,85,247,0.6);
}

.glossary-card {
  overflow: hidden;
  transition: all 0.3s ease;
}
.glossary-card .expand-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.glossary-card.expanded .expand-content {
  max-height: 600px;
}
.glossary-card .chevron {
  transition: transform 0.3s ease;
}
.glossary-card.expanded .chevron {
  transform: rotate(180deg);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.section-anchor {
  scroll-margin-top: 80px;
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
}

.wave-bar {
  display: inline-block;
  width: 3px;
  height: 20px;
  margin: 0 1px;
  border-radius: 2px;
  background: linear-gradient(180deg, #a855f7, #ec4899);
  animation: waveOpacity 1.2s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes waveOpacity { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

.compare-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.2);
  font-size: 18px;
  color: #c4b5fd;
}

.progress-bar {
  height: 4px;
  background: #1e1e3a;
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.fade-enter-active, .fade-leave-active { transition: opacity 0.3s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
