/* =============================================
   WoLoveAI - Nebula Theme
   深空星云 · 未来科技风
   ============================================= */

/* ----- CSS Variables ----- */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.18);
  --glass-shadow: rgba(0, 0, 0, 0.3);
  --glass-blur: 16px;

  --accent-cyan: #00d4ff;
  --accent-purple: #8b5cf6;
  --accent-pink: #f472b6;
  --accent-blue: #3b82f6;
  --accent-green: #34d399;

  --text-primary: #f0f0f5;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);

  --font-display: 'Orbitron', 'Noto Sans SC', sans-serif;
  --font-body: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;

  --nav-height: 64px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

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

ul {
  list-style: none;
}

/* ----- Animated Background ----- */
.background-effects {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-gradient {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: floatBg 20s ease-in-out infinite;
}

.bg-gradient-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-purple), transparent);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.bg-gradient-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-cyan), transparent);
  bottom: -5%;
  right: -5%;
  animation-delay: -7s;
}

.bg-gradient-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-pink), transparent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes floatBg {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Stars */
.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 20% 80%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 60% 90%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 80% 15%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 40% 40%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 15% 55%, rgba(255,255,255,0.45), transparent);
  background-size: 200px 200px;
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ----- Navigation ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(10, 10, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(10, 10, 26, 0.92);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  position: relative;
}

.navbar-brand::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.navbar-brand:hover::after {
  transform: scaleX(1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.has-dropdown::after {
  content: '▾';
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
  transition: transform 0.25s ease;
}

.nav-link.has-dropdown.open::after {
  transform: rotate(180deg);
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: rgba(17, 17, 40, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dropdown-item {
  display: block;
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dropdown-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 4px 0;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ----- Hero Section ----- */
.hero {
  padding: 120px 24px 60px;
  text-align: center;
  position: relative;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 100px;
  margin-bottom: 20px;
  font-family: var(--font-display);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 30%, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-subtitle span {
  color: var(--accent-cyan);
}

/* ----- Main Container ----- */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ----- Section ----- */
.section {
  margin-bottom: 48px;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.6s ease forwards;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
.section:nth-child(5) { animation-delay: 0.5s; }
.section:nth-child(6) { animation-delay: 0.6s; }
.section:nth-child(7) { animation-delay: 0.7s; }
.section:nth-child(8) { animation-delay: 0.8s; }

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

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.section-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.section-icon.cyan {
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent-cyan);
}
.section-icon.purple {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple);
}
.section-icon.pink {
  background: rgba(244, 114, 182, 0.12);
  color: var(--accent-pink);
}
.section-icon.blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
}
.section-icon.green {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-green);
}
.section-icon.teal {
  background: rgba(20, 184, 166, 0.12);
  color: #14b8a6;
}
.section-icon.orange {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
}
.section-icon.gray {
  background: rgba(156, 163, 175, 0.12);
  color: #9ca3af;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-primary);
}

.section-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ----- Link Grid ----- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

/* ----- Link Card ----- */
.link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 48px;
}

.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.link-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.03));
  transition: opacity 0.3s ease;
}

.link-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.link-card:hover::after {
  opacity: 1;
}

.link-card:active {
  transform: translateY(0) scale(0.98);
}

.link-card .link-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.link-card:hover .link-icon {
  transform: scale(1.1);
}

.link-card .link-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.link-card:hover .link-name {
  color: #fff;
}

.link-card .link-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.3s ease;
}

.link-card:hover .link-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Color variants for link icons */
.link-icon.cyan-bg { background: rgba(0, 212, 255, 0.15); color: var(--accent-cyan); }
.link-icon.purple-bg { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.link-icon.pink-bg { background: rgba(244, 114, 182, 0.15); color: var(--accent-pink); }
.link-icon.blue-bg { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.link-icon.green-bg { background: rgba(52, 211, 153, 0.15); color: var(--accent-green); }
.link-icon.orange-bg { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.link-icon.teal-bg { background: rgba(20, 184, 166, 0.15); color: #14b8a6; }
.link-icon.rose-bg { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }
.link-icon.indigo-bg { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.link-icon.emerald-bg { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.link-icon.sky-bg { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.link-icon.yellow-bg { background: rgba(250, 204, 21, 0.15); color: #facc15; }
.link-icon.gray-bg { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }

/* Glow effect on hover for specific card types */
.link-card.glow-cyan:hover {
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.1), 0 0 0 1px rgba(0, 212, 255, 0.15);
}
.link-card.glow-purple:hover {
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.1), 0 0 0 1px rgba(139, 92, 246, 0.15);
}
.link-card.glow-pink:hover {
  box-shadow: 0 8px 30px rgba(244, 114, 182, 0.1), 0 0 0 1px rgba(244, 114, 182, 0.15);
}
.link-card.glow-blue:hover {
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.1), 0 0 0 1px rgba(59, 130, 246, 0.15);
}
.link-card.glow-green:hover {
  box-shadow: 0 8px 30px rgba(52, 211, 153, 0.1), 0 0 0 1px rgba(52, 211, 153, 0.15);
}

/* Placeholder card */
.link-card.placeholder {
  cursor: default;
  opacity: 0.4;
}

.link-card.placeholder:hover {
  transform: none;
  box-shadow: none;
  background: var(--bg-card);
  border-color: var(--glass-border);
}

/* ----- Footer ----- */
.footer {
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 32px 24px;
  text-align: center;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.footer-text a {
  color: var(--accent-cyan);
  transition: color 0.2s ease;
}

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

.footer-divider {
  display: inline-block;
  margin: 0 8px;
  color: rgba(255, 255, 255, 0.15);
}

.footer-beian {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-beian img {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  vertical-align: middle;
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ----- Selection ----- */
::selection {
  background: rgba(0, 212, 255, 0.3);
  color: #fff;
}

/* =============================================
   Responsive
   ============================================= */

/* Tablet */
@media (max-width: 1024px) {
  .link-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-link {
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  .dropdown-menu {
    position: static;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    padding: 0 0 0 16px;
    pointer-events: auto;
  }

  .dropdown-menu.show {
    display: block;
  }

  .dropdown-item {
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  .hero {
    padding: 100px 16px 40px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
  }

  .hero-subtitle {
    font-size: 0.92rem;
  }

  .main-container {
    padding: 0 16px 40px;
  }

  .link-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
  }

  .link-card {
    padding: 10px 12px;
    min-height: 42px;
  }

  .link-card .link-name {
    font-size: 0.78rem;
  }

  .section {
    margin-bottom: 32px;
  }

  .footer {
    padding: 24px 16px;
  }

  .footer-text {
    font-size: 0.72rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .link-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}