/* ============================================================
   AI科技导航 — 暗黑科技风主题样式
   Aesthetic: "Neural Nexus" — deep space + neon glow + glass morphism
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,300;0,400;0,600;0,700;0,800;1,400&family=Rajdhani:wght@300;400;500;600;700&display=swap');

/* ============================================================
   1. CSS VARIABLES — DARK THEME (default)
   ============================================================ */
:root {
  /* Surface */
  --bg-primary: #06060e;
  --bg-secondary: #0c0c1a;
  --bg-card: rgba(16, 16, 32, 0.55);
  --bg-card-hover: rgba(22, 22, 48, 0.75);
  --bg-sidebar: rgba(10, 10, 24, 0.7);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-input-focus: rgba(255, 255, 255, 0.07);

  /* Border */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(255, 255, 255, 0.15);
  --border-input: rgba(255, 255, 255, 0.08);
  --border-input-focus: rgba(0, 212, 255, 0.4);

  /* Text */
  --text-primary: #e2e2f0;
  --text-secondary: #7a7a9a;
  --text-muted: #4e4e6a;
  --text-card-title: #f0f0ff;
  --text-card-desc: #8888aa;

  /* Accent */
  --accent-cyan: #00d4ff;
  --accent-violet: #b14aed;
  --accent-magenta: #ff4081;
  --gradient-accent: linear-gradient(135deg, #00d4ff, #b14aed, #ff4081);
  --gradient-accent-soft: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(177,74,237,0.15));

  /* Effects */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.5);
  --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.15);
  --glow-violet: 0 0 20px rgba(177, 74, 237, 0.15);
  --blur-card: 16px;
  --blur-sidebar: 20px;

  /* Layout */
  --sidebar-width: 200px;
  --header-height: auto;
  --content-max-width: 1400px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Typography */
  --font-display: 'Exo 2', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Rajdhani', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Transition */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   2. LIGHT THEME OVERRIDES
   ============================================================ */
[data-theme="light"] {
  --bg-primary: #f5f5fa;
  --bg-secondary: #eeeef5;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --bg-sidebar: rgba(255, 255, 255, 0.75);
  --bg-input: rgba(0, 0, 0, 0.03);
  --bg-input-focus: rgba(0, 0, 0, 0.05);

  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-card: rgba(0, 0, 0, 0.08);
  --border-card-hover: rgba(0, 0, 0, 0.15);
  --border-input: rgba(0, 0, 0, 0.1);
  --border-input-focus: rgba(0, 150, 200, 0.4);

  --text-primary: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #9a9ab0;
  --text-card-title: #1a1a30;
  --text-card-desc: #6a6a88;

  --accent-cyan: #0099cc;
  --accent-violet: #8b2fc9;
  --accent-magenta: #d63070;
  --gradient-accent: linear-gradient(135deg, #0099cc, #8b2fc9, #d63070);
  --gradient-accent-soft: linear-gradient(135deg, rgba(0,153,204,0.1), rgba(139,47,201,0.1));

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
  --glow-cyan: 0 0 15px rgba(0, 153, 204, 0.1);
  --glow-violet: 0 0 15px rgba(139, 47, 201, 0.1);
}

/* ============================================================
   3. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* ============================================================
   4. BACKGROUND & CANVAS
   ============================================================ */
.bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Dot grid pattern overlay */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
}

[data-theme="light"] .bg-grid {
  background-image: radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px);
}

/* Floating gradient orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 20s ease-in-out infinite;
}

[data-theme="light"] .bg-orb {
  opacity: 0.08;
  filter: blur(100px);
}

.bg-orb--1 {
  width: 600px;
  height: 600px;
  background: var(--accent-cyan);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
  animation-duration: 25s;
}

.bg-orb--2 {
  width: 500px;
  height: 500px;
  background: var(--accent-violet);
  bottom: -150px;
  left: -100px;
  animation-delay: -8s;
  animation-duration: 22s;
}

.bg-orb--3 {
  width: 400px;
  height: 400px;
  background: var(--accent-magenta);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -15s;
  animation-duration: 28s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 30px) scale(1.02); }
}

.bg-orb--3 {
  animation-name: orbFloat3;
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  25% { transform: translate(calc(-50% + 40px), calc(-50% - 30px)) scale(1.08); }
  50% { transform: translate(calc(-50% - 25px), calc(-50% + 25px)) scale(0.92); }
  75% { transform: translate(calc(-50% + 20px), calc(-50% + 35px)) scale(1.04); }
}

/* ============================================================
   5. MAIN LAYOUT
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 40px 60px;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: auto 1fr;
  gap: 0;
  min-height: 100vh;
}

/* ============================================================
   6. HEADER
   ============================================================ */
.header {
  grid-column: 1 / -1;
  padding: 50px 0 30px;
  text-align: center;
}

.header__top-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.12);
  margin-bottom: 16px;
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
}

.header__top-link:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.25);
  transform: translateY(-1px);
}

[data-theme="light"] .header__top-link {
  background: rgba(0, 153, 204, 0.06);
  border-color: rgba(0, 153, 204, 0.15);
  color: var(--accent-cyan);
}

[data-theme="light"] .header__top-link:hover {
  background: rgba(0, 153, 204, 0.12);
  border-color: rgba(0, 153, 204, 0.3);
}

.header__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 100px;
  background: var(--gradient-accent-soft);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.header__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.header__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
}

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

.header__subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.header__subtitle-cn {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-top: 4px;
  margin-bottom: 4px;
}

/* Search bar */
.search-wrapper {
  max-width: 580px;
  margin: 28px auto 0;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 50px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

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

.search-input:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-input-focus);
  box-shadow: var(--glow-cyan);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-input:focus ~ .search-icon {
  color: var(--accent-cyan);
}

.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.search-clear.visible {
  opacity: 1;
  visibility: visible;
}

.search-clear:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.search-shortcut {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

[data-theme="light"] .search-shortcut {
  background: rgba(0,0,0,0.04);
}

/* ============================================================
   7. SIDEBAR
   ============================================================ */
.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  padding: 16px 0;
  margin-right: 30px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  border: 1px solid transparent;
}

.sidebar__item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .sidebar__item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.sidebar__item.active {
  color: var(--text-primary);
  background: var(--gradient-accent-soft);
  border-color: var(--border-subtle);
}

.sidebar__item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.sidebar__item.active .sidebar__item-icon {
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.sidebar__item-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

[data-theme="light"] .sidebar__item-count {
  background: rgba(0,0,0,0.05);
}

.sidebar__item.active .sidebar__item-count {
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent-cyan);
}

/* ============================================================
   8. MAIN CONTENT AREA
   ============================================================ */
.content {
  padding: 10px 0 0;
  min-width: 0;
}

/* Category section */
.category {
  margin-bottom: 48px;
  animation: fadeInUp 0.6s ease-out both;
}

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

.category__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.category__icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.15;
}

.category__name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.category__count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  font-family: var(--font-mono);
}

[data-theme="light"] .category__count {
  background: rgba(0,0,0,0.04);
}

/* Site cards grid */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ============================================================
   9. SITE CARD
   ============================================================ */
.site-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(var(--blur-card));
  -webkit-backdrop-filter: blur(var(--blur-card));
  cursor: pointer;
  transition: all var(--transition-smooth);
  overflow: hidden;
  text-decoration: none;
  animation: cardReveal 0.5s ease-out both;
}

/* Top gradient accent bar */
.site-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--gradient-accent));
  opacity: 0.7;
  transition: all var(--transition-smooth);
}

/* Hover glow effect */
.site-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--card-accent, var(--gradient-accent));
  opacity: 0;
  filter: blur(40px);
  transition: opacity var(--transition-smooth);
  pointer-events: none;
}

.site-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.site-card:hover::before {
  opacity: 1;
  height: 3px;
}

.site-card:hover::after {
  opacity: 0.08;
}

.site-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.site-card__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-card-title);
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.site-card__arrow {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: all var(--transition-smooth);
  flex-shrink: 0;
  margin-top: 2px;
}

.site-card:hover .site-card__arrow {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--accent-cyan);
}

.site-card__desc {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-card-desc);
  line-height: 1.5;
  flex: 1;
}

.site-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.site-card__tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all var(--transition-fast);
}

[data-theme="light"] .site-card__tag {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.04);
}

.site-card:hover .site-card__tag {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .site-card:hover .site-card__tag {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.06);
}

/* ============================================================
   10. THEME TOGGLE
   ============================================================ */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-card);
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-card-hover);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-spring);
}

.theme-toggle:hover svg {
  transform: rotate(20deg);
}

.theme-toggle .icon-sun,
[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

.theme-toggle .icon-moon,
[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

/* ============================================================
   11. BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-card);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--accent-cyan);
  border-color: var(--border-card-hover);
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   12. STATS BAR
   ============================================================ */
.stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 10px;
  padding: 8px 0;
}

.stats__item {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats__number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats__divider {
  width: 1px;
  height: 14px;
  background: var(--border-subtle);
}

/* ============================================================
   13. NO RESULTS
   ============================================================ */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  display: none;
}

.no-results.visible {
  display: block;
}

.no-results__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.no-results__text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.no-results__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ============================================================
   14. ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Staggered card animation */
.site-card:nth-child(1) { animation-delay: 0.02s; }
.site-card:nth-child(2) { animation-delay: 0.04s; }
.site-card:nth-child(3) { animation-delay: 0.06s; }
.site-card:nth-child(4) { animation-delay: 0.08s; }
.site-card:nth-child(5) { animation-delay: 0.10s; }
.site-card:nth-child(6) { animation-delay: 0.12s; }
.site-card:nth-child(7) { animation-delay: 0.14s; }
.site-card:nth-child(8) { animation-delay: 0.16s; }
.site-card:nth-child(9) { animation-delay: 0.18s; }

/* Category stagger */
.category:nth-child(1) { animation-delay: 0s; }
.category:nth-child(2) { animation-delay: 0.08s; }
.category:nth-child(3) { animation-delay: 0.16s; }
.category:nth-child(4) { animation-delay: 0.24s; }
.category:nth-child(5) { animation-delay: 0.32s; }
.category:nth-child(6) { animation-delay: 0.40s; }
.category:nth-child(7) { animation-delay: 0.48s; }
.category:nth-child(8) { animation-delay: 0.56s; }
.category:nth-child(9) { animation-delay: 0.64s; }
.category:nth-child(10) { animation-delay: 0.72s; }

/* ============================================================
   15. CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

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

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ============================================================
   16. MOBILE SIDEBAR (horizontal scroll)
   ============================================================ */
.mobile-nav {
  display: none;
}

/* ============================================================
   17. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .app {
    padding: 0 24px 40px;
  }

  .sites-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
    padding: 0 16px 32px;
  }

  .header {
    padding: 32px 0 20px;
  }

  .header__title {
    font-size: 1.8rem;
  }

  .header__subtitle {
    font-size: 0.95rem;
  }

  .header__subtitle-cn {
    font-size: 1rem;
  }

  /* Hide desktop sidebar, show horizontal mobile nav */
  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
    gap: 6px;
    padding: 12px 0;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mobile-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav__item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
    flex-shrink: 0;
  }

  [data-theme="light"] .mobile-nav__item {
    background: rgba(0,0,0,0.03);
  }

  .mobile-nav__item.active {
    color: var(--text-primary);
    background: var(--gradient-accent-soft);
    border-color: var(--border-subtle);
  }

  .mobile-nav__item-icon {
    font-size: 0.85rem;
  }

  .sites-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-card {
    padding: 16px 18px 14px;
  }

  .category__header {
    margin-bottom: 14px;
  }

  .category {
    margin-bottom: 32px;
  }

  .stats {
    gap: 14px;
  }

  .search-wrapper {
    margin-top: 20px;
  }

  .theme-toggle {
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
  }

  .back-to-top {
    bottom: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 480px) {
  .header__title {
    font-size: 1.5rem;
  }

  .header__badge {
    font-size: 0.65rem;
    padding: 5px 12px;
  }

  .search-input {
    padding: 12px 16px 12px 42px;
    font-size: 0.92rem;
  }
}

/* ============================================================
   18. FOCUS VISIBLE (Accessibility)
   ============================================================ */
.site-card:focus-visible,
.sidebar__item:focus-visible,
.search-input:focus-visible,
.theme-toggle:focus-visible,
.back-to-top:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* ============================================================
   19. HIGHLIGHT MATCH
   ============================================================ */
.highlight {
  background: rgba(0, 212, 255, 0.2);
  color: var(--accent-cyan);
  border-radius: 2px;
  padding: 0 1px;
}

[data-theme="light"] .highlight {
  background: rgba(0, 153, 204, 0.15);
  color: var(--accent-cyan);
}

/* ============================================================
   20. FOOTER
   ============================================================ */
.footer {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px 0 10px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 20px;
}

.footer__text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.footer__text a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer__text a:hover {
  color: var(--accent-cyan);
}
