/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --border: rgba(59, 130, 246, 0.15);
  --border-hover: rgba(59, 130, 246, 0.4);
  --glass: rgba(15, 23, 42, 0.8);
  --glass-border: rgba(59, 130, 246, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

/* ===== Particle Canvas ===== */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== Pages ===== */
.page {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.page.active {
  display: flex;
  flex-direction: column;
}

/* ===== Top Navigation ===== */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 26, 0.5);
  border-bottom: 1px solid var(--border);
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 14px;
  transition: color var(--transition);
  position: relative;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width var(--transition);
  border-radius: 1px;
}

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

.nav-link:hover::after {
  width: 100%;
}

.ai-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}

.ai-badge:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a78bfa;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px #a78bfa; }
  50% { opacity: 0.5; box-shadow: 0 0 12px #a78bfa; }
}

/* ===== Main Content ===== */
.home-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  padding-top: 60px;
  padding-bottom: 40px;
}

/* ===== Logo ===== */
.logo-section {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}

.logo-n {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-ai {
  font-size: 42px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-left: 2px;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 10%;
  width: 80%;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 2px;
  animation: glow-line 3s ease-in-out infinite;
}

@keyframes glow-line {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 8px var(--accent-glow); }
  50% { opacity: 1; box-shadow: 0 0 20px var(--accent-glow); }
}

.tagline {
  color: var(--text-muted);
  font-size: 16px;
  margin-top: 12px;
  letter-spacing: 4px;
  font-weight: 300;
}

/* ===== Search Box ===== */
.search-wrapper {
  width: 100%;
  max-width: 680px;
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 4px 6px 4px 18px;
  backdrop-filter: blur(20px);
  transition: all var(--transition);
  box-shadow: var(--shadow), 0 0 40px rgba(59, 130, 246, 0.05);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 30px var(--accent-glow), 0 0 80px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.search-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color var(--transition);
}

.search-box:focus-within .search-icon {
  color: var(--accent);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 16px;
  padding: 14px 12px;
  letter-spacing: 0.3px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.ai-search-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--accent-gradient);
  border-radius: 12px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.ai-search-btn:hover {
  box-shadow: 0 0 24px var(--accent-glow);
  transform: scale(1.02);
}

.ai-search-btn:active {
  transform: scale(0.98);
}

.voice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
  margin-right: 4px;
}

.voice-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
}

/* ===== AI Suggestions ===== */
.ai-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  padding: 12px;
  display: none;
  box-shadow: var(--shadow);
  z-index: 100;
  animation: slideDown 0.2s ease;
}

.ai-suggestions.show {
  display: block;
}

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

.suggestion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--accent-secondary);
  font-size: 13px;
  font-weight: 500;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 14px;
}

.suggestion-item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
}

.suggestion-item svg {
  flex-shrink: 0;
  opacity: 0.5;
}

/* ===== Quick Tags ===== */
.quick-tags {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.tag-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-secondary);
  font-size: 13px;
  transition: all var(--transition);
  backdrop-filter: blur(10px);
}

.tag-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.tag-icon {
  font-size: 15px;
}

/* ===== AI Feature Cards ===== */
.ai-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 48px;
  width: 100%;
  max-width: 680px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all var(--transition);
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.feature-text h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.feature-text p {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== Footer ===== */
.home-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

.copyright {
  color: var(--text-muted);
  font-size: 12px;
  opacity: 0.6;
}

/* ===== Animations ===== */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.feature-card:nth-child(1) { animation: float 4s ease-in-out infinite; }
.feature-card:nth-child(2) { animation: float 4s ease-in-out infinite 0.5s; }
.feature-card:nth-child(3) { animation: float 4s ease-in-out infinite 1s; }
.feature-card:nth-child(4) { animation: float 4s ease-in-out infinite 1.5s; }

/* ===== Typing Effect ===== */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

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

/* ===== Loading Spinner ===== */
.search-loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .logo {
    font-size: 44px;
  }

  .logo-ai {
    font-size: 30px;
  }

  .top-nav {
    padding: 12px 16px;
  }

  .nav-left {
    gap: 16px;
  }

  .ai-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .search-wrapper {
    max-width: 100%;
  }

  .tagline {
    font-size: 13px;
    letter-spacing: 2px;
  }

  .quick-tags {
    gap: 8px;
  }

  .tag-item {
    padding: 6px 14px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 36px;
  }

  .logo-ai {
    font-size: 24px;
  }

  .ai-features {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-card {
    padding: 14px 8px;
  }

  .feature-icon {
    font-size: 22px;
  }
}
