* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #ec4899;
  --accent: #06b6d4;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.8);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.2);
  --glow: 0 0 30px rgba(99, 102, 241, 0.3);
}

html {
  background-color: #0f172a;
  background-image: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #0f172a;
  background-image: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Effects */
.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.floating-orb {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  filter: blur(80px);
  opacity: 0.1;
  animation: float 20s infinite ease-in-out;
}

.orb1 {
  width: 300px;
  height: 300px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.orb2 {
  width: 200px;
  height: 200px;
  top: 60%;
  right: 10%;
  animation-delay: -10s;
}

.orb3 {
  width: 150px;
  height: 150px;
  bottom: 20%;
  left: 50%;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(30px, -30px) rotate(90deg); }
  50% { transform: translate(-20px, 20px) rotate(180deg); }
  75% { transform: translate(-30px, -10px) rotate(270deg); }
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.header h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  text-shadow: var(--glow);
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  from { filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3)); }
  to { filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.6)); }
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Table of Contents */
.toc {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.toc:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
}

.toc-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-weight: 500;
  font-size: 0.9rem;
  text-align: center;
}

.toc-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.toc-item:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  border-color: var(--primary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.toc-item:hover::before {
  left: 100%;
}

/* Word Sections */
.word-section {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.word-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.word-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.word-section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Copy Button */
.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  margin-left: 1rem;
}

.copy-button:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent);
  transform: scale(1.05);
}

.copy-button.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #22c55e;
}

.copy-button.copied:hover {
  background: rgba(34, 197, 94, 0.3);
}

.copy-icon {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.copy-button:hover .copy-icon {
  transform: scale(1.1);
}

/* Word List */
.word-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.word-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.word-item:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--accent);
  transform: translateX(10px);
}

.word-item strong {
  color: var(--accent);
  font-size: 1.1rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.word-type {
  color: var(--secondary);
  font-style: italic;
  margin-left: 0.5rem;
}

.word-definition {
  color: var(--text-secondary);
  margin: 0.5rem 0;
}

.word-example {
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

/* Quick Tips */
.quick-tip {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
}

.quick-tip strong {
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-tip strong::before {
  content: "💡";
  font-size: 1.2rem;
}

/* Back to Top */
.back-to-top {
  text-align: center;
  margin-top: 2rem;
}

.back-to-top a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.back-to-top a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

/* Scroll Progress */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(99, 102, 241, 0.2);
  z-index: 1000;
}

.scroll-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 0.3s ease;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .toc-grid {
    grid-template-columns: 1fr;
  }
  
  .word-section {
    padding: 1.5rem;
  }
  
  .word-item:hover {
    transform: none;
  }
  
  .copy-button {
    margin-left: 0.5rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .word-section h2 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}