/*
 * Modern Theme Styles - Based on ai-tools-nav
 * Fused with WebStack WordPress Theme
 */

/* CSS Variables */
:root {
  --radius: .5rem;
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 217.2 32.6% 17.5%;
  --card-foreground: 210 40% 98%;
  --primary: 263.4 70% 50.4%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 263.4 70% 50.4%;
  --sidebar-width: 220px;
  --sidebar-collapsed: 60px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #020617, #0f172a, #1e1b4b);
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
}

/* Particle Background */
.particle-container,
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Ensure main content is above particle background */
.page-container,
.main-content,
.site-content,
.hero-section {
  position: relative;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(139,92,246,.8) 0%, transparent 70%);
  border-radius: 50%;
  animation: float-particle 20s linear infinite;
}

@keyframes float-particle {
  0% { transform: translateY(100vh) translate(0) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translate(100px) rotate(720deg); opacity: 0; }
}

/* Grid Background */
.grid-bg {
  background-image: 
    linear-gradient(rgba(139,92,246,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* Glass Effects */
.glass {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.12);
}

.glass-light {
  background: rgba(51, 65, 85, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.08);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.06);
}

/* Card Hover Effect */
.card-hover {
  transition: all .2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139,92,246,.2);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #c4b5fd, #67e8f9, #f9a8d4);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(139,92,246,.4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139,92,246,.6);
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 9999px;
  font-size: .65rem;
  font-weight: 500;
  transition: all .2s ease;
}

.tag-purple {
  background: rgba(139,92,246,.25);
  color: #c4b5fd;
  border: 1px solid rgba(139,92,246,.4);
}

.tag-purple:hover {
  background: rgba(139,92,246,.35);
}

.tag-cyan {
  background: rgba(6,182,212,.25);
  color: #67e8f9;
  border: 1px solid rgba(6,182,212,.4);
}

.tag-cyan:hover {
  background: rgba(6,182,212,.35);
}

.tag-pink {
  background: rgba(244,114,182,.25);
  color: #f9a8d4;
  border: 1px solid rgba(244,114,182,.4);
}

.tag-pink:hover {
  background: rgba(244,114,182,.35);
}

.tag-green {
  background: rgba(16,185,129,.25);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,.4);
}

.tag-green:hover {
  background: rgba(16,185,129,.35);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: .5rem;
  font-weight: 600;
  font-size: .875rem;
  transition: all .2s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,92,246,.4);
}

.btn-secondary {
  background: rgba(255,255,255,.08);
  color: #f1f5f9;
  padding: .5rem 1rem;
  border-radius: .5rem;
  font-weight: 500;
  font-size: .875rem;
  transition: all .2s ease;
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.btn-secondary:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(139,92,246,.5);
}

/* Left Sidebar */
.left-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255,255,255,.08);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width .3s ease, transform .3s ease;
  overflow: hidden;
}

.left-sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

/* Collapsed sidebar - hide text elements */
.left-sidebar.collapsed .sidebar-logo-text,
.left-sidebar.collapsed .sidebar-collapse-text,
.left-sidebar.collapsed .sidebar-section-title,
.left-sidebar.collapsed .sidebar-item-text,
.left-sidebar.collapsed .user-details,
.left-sidebar.collapsed .user-info-btn > .fa-chevron-down {
  display: none;
}

/* Collapsed sidebar - center user avatar */
.left-sidebar.collapsed .user-section {
  display: flex;
  justify-content: center;
}

.left-sidebar.collapsed .user-info-btn {
  padding: 8px;
  justify-content: center;
}

.left-sidebar.collapsed .user-avatar {
  margin: 0;
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-section-title {
  padding: 8px 12px;
  font-size: .65rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 8px;
  transition: all .2s ease;
  position: relative;
  cursor: pointer;
  min-width: 0;
}

.sidebar-item:hover {
  color: #fff;
  background: rgba(139,92,246,.15);
}

.sidebar-item.active {
  color: #fff;
  background: rgba(139,92,246,.2);
}

.sidebar-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(180deg, #8b5cf6, #06b6d4);
  border-radius: 0 2px 2px 0;
}

.sidebar-item-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-item-icon svg,
.sidebar-item-icon i {
  width: 20px;
  height: 20px;
  font-size: 18px;
}

.sidebar-item-text {
  margin-left: 12px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Has children indicator */
.sidebar-item.has-children {
  cursor: pointer;
}

.sidebar-item.has-children .submenu-arrow {
  margin-left: auto;
  font-size: 10px;
  color: #64748b;
  transition: transform .2s ease;
}

.sidebar-item.has-children:hover .submenu-arrow {
  color: #fff;
}

/* Submenu */
.sidebar-submenu {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transition: max-height .3s ease, opacity .3s ease, visibility .3s ease;
}

.sidebar-submenu.open {
  max-height: 500px;
  opacity: 1;
  visibility: visible;
}

.sidebar-subitem {
  display: flex;
  align-items: center;
  padding: 10px 16px 10px 52px;
  color: #94a3b8;
  font-size: 14px;
  text-decoration: none;
  transition: all .2s ease;
  cursor: pointer;
  position: relative;
}

.sidebar-subitem::before {
  content: '';
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(139,92,246,.4);
}

.sidebar-subitem:hover,
.sidebar-subitem.active {
  background: rgba(255,255,255,.04);
  color: #a78bfa;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(15, 23, 42, 0.5);
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: #94a3b8;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s ease;
  margin-top: 8px;
}

.sidebar-collapse-btn:hover {
  background: rgba(139,92,246,.15);
  border-color: rgba(139,92,246,.3);
  color: #fff;
}

.sidebar-collapse-text {
  white-space: nowrap;
}

/* User Section */
.user-section {
  margin-bottom: 8px;
}

.user-info-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(139,92,246,.2);
  color: #fff;
  cursor: pointer;
  transition: all .2s ease;
}

.user-info-btn:hover {
  background: rgba(139,92,246,.2);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.user-name {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  display: block;
  font-size: .7rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu {
  margin-top: 8px;
  padding: 8px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s ease;
  text-align: left;
  text-decoration: none;
}

.user-menu-item:hover {
  background: rgba(255,255,255,.05);
  color: #fff;
}

.user-menu-item.logout:hover {
  background: rgba(239,68,68,.1);
  color: #ef4444;
}

.user-menu-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 6px 0;
}

/* Auth Buttons */
.auth-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.login-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: #94a3b8;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(139,92,246,.3);
}

.register-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: none;
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.register-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,92,246,.4);
}

/* Submenu */
.sidebar-submenu {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transition: max-height .3s ease, opacity .3s ease, visibility .3s ease;
}

.sidebar-submenu.open {
  max-height: 500px;
  opacity: 1;
  visibility: visible;
}

.sidebar-subitem {
  display: flex;
  align-items: center;
  padding: 8px 12px 8px 52px;
  color: #64748b;
  font-size: .8rem;
  border-radius: 6px;
  transition: all .2s ease;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-subitem:hover {
  color: #cbd5e1;
  background: rgba(255,255,255,.05);
}

.sidebar-subitem.active {
  color: #a78bfa;
}

/* Level 3+ items */
.sidebar-submenu .sidebar-submenu {
  padding-left: 0;
}

.sidebar-submenu .sidebar-item {
  padding-left: 44px !important;
}

.sidebar-submenu .sidebar-submenu .sidebar-item {
  padding-left: 60px !important;
}

/* Has submenu indicator */
.has-submenu {
  cursor: pointer;
}

.has-submenu::after {
  content: "�?;
  margin-left: auto;
  font-size: 1.2rem;
  color: #64748b;
  transition: transform .2s ease;
}

.has-submenu.active::after {
  transform: rotate(90deg);
}

/* Right Sidebar */
.right-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255,255,255,.08);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
}

.right-sidebar-section {
  margin-bottom: 20px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 16px;
}

.right-sidebar-title {
  font-size: .75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.right-sidebar-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  color: #cbd5e1;
  font-size: .85rem;
  transition: color .2s;
  text-decoration: none;
}

.right-sidebar-item:hover {
  color: #fff;
}

.right-sidebar-rank {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(139,92,246,.2);
  color: #c4b5fd;
  font-size: .7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.right-sidebar-rank.top {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
}

.right-sidebar-shortcut {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  margin-bottom: 8px;
  color: #94a3b8;
  font-size: .85rem;
  transition: all .2s;
  cursor: pointer;
  text-decoration: none;
}

.right-sidebar-shortcut:hover {
  background: rgba(139,92,246,.15);
  border-color: rgba(139,92,246,.3);
  color: #fff;
}

.right-sidebar-shortcut i {
  color: #8b5cf6;
}

/* Site Cards */
.site-card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  transition: all .2s ease;
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid rgba(255,255,255,.06);
}

.site-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 30px rgba(139,92,246,.35), 0 4px 10px rgba(0,0,0,.2);
  border-color: rgba(139,92,246,.5);
  background: rgba(51, 65, 85, 0.7);
}

.site-card-inner {
  padding: 16px;
}

.site-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.site-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.site-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.site-card-info {
  flex: 1;
  min-width: 0;
}

.site-card-name {
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1px;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.site-card-category {
  font-size: .65rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-card-desc {
  font-size: .75rem;
  color: #94a3b8;
  line-height: 1.5;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.site-card-inner {
  padding: 12px;
}

.site-card-header {
  margin-bottom: 8px;
}

.site-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.site-card-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 4px;
  border: 1px solid;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.site-card-tag:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.site-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.05);
}

/* Badges */
.hot-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #f472b6, #ec4899);
  color: #fff;
  font-size: .55rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.new-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: .55rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* Search Input */
.search-input {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: .75rem 1rem;
  color: #fff;
  font-size: .875rem;
  transition: all .2s ease;
  width: 100%;
}

.search-input:focus {
  outline: none;
  border-color: rgba(139,92,246,.5);
  box-shadow: 0 0 0 2px rgba(139,92,246,.1);
}

.search-input::placeholder {
  color: #64748b;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-right: 300px;
  transition: margin-left .3s ease, margin-right .3s ease;
  min-height: 100vh;
  padding: 80px 24px 20px;
}

.main-content.collapsed {
  margin-left: var(--sidebar-collapsed);
}

/* Tool Category Section */
.tool-category-section {
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.tool-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.tool-category-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.tool-category-icon.purple {
  background: rgba(139,92,246,.2);
}

.tool-category-icon.cyan {
  background: rgba(6,182,212,.2);
}

.tool-category-icon.pink {
  background: rgba(244,114,182,.2);
}

.tool-category-icon.green {
  background: rgba(16,185,129,.2);
}

/* Category icon with gradient background */
.tool-category-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.tool-category-name {
  font-size: .95rem;
  font-weight: 600;
  color: #fff;
}

.tool-category-count {
  font-size: .75rem;
  color: #64748b;
  margin-left: auto;
}

/* Grid Layouts - Controlled by PHP inline style */
.sites-grid {
  display: grid;
  gap: 16px;
}

/* Animations */
@keyframes slide-up {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.animate-slide-up {
  animation: slide-up .3s ease-out forwards;
}

.animate-fade-in {
  animation: fade-in .3s ease-out forwards;
}

/* Override old theme styles */
.page-container {
  background: transparent !important;
}

.sidebar-menu,
.sidebar-menu-inner,
.navbar.user-info-navbar {
  display: none !important;
}

/* Fix body background */
body.page-body {
  background: linear-gradient(135deg, #020617, #0f172a, #1e1b4b) !important;
}

/* Ensure content visibility */
.main-content {
  position: relative;
  z-index: 1;
}

/* Fix for old theme container */
.sites-list {
  width: 100%;
}

/* Override Bootstrap grid */
.sites-list .row {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 16px !important;
  margin: 0 !important;
}

.sites-list .row > div[class*="col-"] {
  width: 100% !important;
  padding: 0 !important;
  float: none !important;
}

/* Fix xe-card from old theme */
.xe-card {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

/* Ensure site cards are visible */
.site-card {
  display: block !important;
  text-decoration: none !important;
}

/* Fix animation visibility */
.animate-slide-up {
  opacity: 0;
  animation-fill-mode: forwards;
}

/* Ensure grid is visible */
.sites-grid {
  display: grid !important;
  visibility: visible !important;
}

/* Categories content container */
.categories-content {
  width: 100%;
  min-height: 500px;
}

/* Debug visibility */
.categories-content,
.tool-category-section,
.sites-grid {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Fix for old theme interference */
.tool-category-section {
  width: 100%;
  margin-bottom: 32px;
}

/* Ensure cards are visible */
.site-card-wrapper {
  display: block;
  width: 100%;
}

/* Fix card link display */
a.site-card {
  color: inherit;
  text-decoration: none;
}

/* Fix icon display */
.site-card-icon img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* Ensure proper box sizing */
.site-card * {
  box-sizing: border-box;
}

/* Fix for any hidden elements */
.tool-category-section,
.sites-grid,
.site-card-wrapper,
.site-card {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Fix for Bootstrap conflicts */
.sites-list .row {
  display: contents;
}

/* Ensure proper z-index stacking */
.left-sidebar {
  z-index: 100;
}

.right-sidebar {
  z-index: 100;
}

.top-navbar,
header.top-navbar,
#topNavbar {
  z-index: 99990 !important;
}

/* Ensure dropdown menus appear above everything */
.top-nav-dropdown-menu,
.top-nav-dropdown,
header .top-nav-dropdown-menu,
header .top-nav-dropdown,
.top-navbar .top-nav-dropdown-menu,
.top-navbar .top-nav-dropdown {
  z-index: 99999 !important;
  position: absolute !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-10px) !important;
  transition: all .2s ease !important;
}

/* Dropdown wrapper needs to create stacking context */
.top-nav-dropdown-wrapper,
header .top-nav-dropdown-wrapper,
.top-navbar .top-nav-dropdown-wrapper {
  position: relative !important;
  z-index: 99998 !important;
}

/* Transparent bridge between link and dropdown */
.top-nav-dropdown-wrapper::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  height: 35px;
  width: 100%;
  z-index: 99997;
  background: transparent;
}

/* Hover to show dropdown */
.top-nav-dropdown-wrapper:hover > .top-nav-dropdown-menu,
.top-nav-dropdown-wrapper:hover > .top-nav-dropdown,
header .top-nav-dropdown-wrapper:hover > .top-nav-dropdown-menu,
header .top-nav-dropdown-wrapper:hover > .top-nav-dropdown,
.top-navbar .top-nav-dropdown-wrapper:hover > .top-nav-dropdown-menu,
.top-navbar .top-nav-dropdown-wrapper:hover > .top-nav-dropdown {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  z-index: 99999 !important;
}

.top-nav-dropdown-wrapper:hover,
header .top-nav-dropdown-wrapper:hover,
.top-navbar .top-nav-dropdown-wrapper:hover {
  z-index: 999999 !important;
}

/* ============================================
   Footer Fix - Not obscured by sidebars
   ============================================ */
.main-footer {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.08);
  margin-left: var(--sidebar-width);
  margin-right: 320px;
  padding: 40px 30px 0;
  box-sizing: border-box;
  width: auto;
  position: relative;
  z-index: 10;
}

.main-footer .footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding-right: 20px;
}

@media (max-width: 1400px) {
  .main-footer {
    margin-right: 280px;
  }
}

.main-footer .footer-container {
  max-width: 1400px;
  margin: 0 auto;
}

.main-footer .footer-top {
  display: flex !important;
  justify-content: space-between !important;
  gap: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(139,92,246,.15);
  align-items: flex-start !important;
}

.main-footer .footer-left {
  flex: 0 0 300px !important;
}

.main-footer .footer-center {
  flex: 1 !important;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main-footer .footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.main-footer .footer-right {
  flex: 0 0 200px !important;
  display: flex !important;
  gap: 20px;
  align-items: flex-start;
  justify-content: flex-end;
}

.main-footer .footer-qr-item {
  text-align: center;
  flex: 1;
  min-width: 100px;
}

.main-footer .footer-qr-img {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,.95);
  border-radius: 10px;
  padding: 6px;
  margin: 0 auto 8px;
  box-shadow: 0 4px 15px rgba(139,92,246,.2);
}

.main-footer .footer-qr-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.main-footer .footer-qr-item span {
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 1400px) {
  .main-footer {
    margin-right: 260px;
  }
}

@media (max-width: 1200px) {
  .main-footer {
    margin-left: 0;
    margin-right: 0;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Ensure main-footer is above particle background */
.main-footer {
  position: relative;
  z-index: 1;
}

/* Responsive */
@media (max-width: 1400px) {
  .right-sidebar {
    width: 260px;
  }
  .main-content {
    margin-right: 260px;
  }
  .main-footer {
    margin-right: 260px;
  }
}

@media (max-width: 1200px) {
  .right-sidebar {
    display: none;
  }
  .main-content {
    margin-right: 0;
  }
  .main-footer {
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .left-sidebar {
    transform: translateX(-100%);
  }
  .left-sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    margin-top: 70px;
  }
  .sites-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .sites-list .row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .site-card-inner {
    padding: 12px;
  }
  .site-card-header {
    margin-bottom: 6px;
  }
  .site-card-icon {
    width: 36px;
    height: 36px;
  }
  .site-card-name {
    font-size: .8rem;
  }
  .site-card-desc {
    font-size: .7rem;
    -webkit-line-clamp: 2;
    display: -webkit-box !important;
  }
  /* 手机端隐藏标签 */
  .site-card-tags {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .sites-grid,
  .sites-list .row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .site-card-inner {
    padding: 10px;
  }
  .site-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  .site-card-name {
    font-size: .75rem;
  }
  .site-card-desc {
    font-size: .65rem;
    -webkit-line-clamp: 2;
    display: -webkit-box !important;
    margin-top: 4px;
  }
}

/* ============================================
   TOP NAVIGATION BAR
   ============================================ */

.top-navbar {
  position: fixed;
  top: 12px;
  left: 240px;
  right: 320px;
  height: 44px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  z-index: 1000;
  transition: all .3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.top-navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
}

@media (max-width: 1400px) {
  .top-navbar-inner {
    max-width: calc(100% - 480px);
    margin-right: 260px;
  }
}

@media (max-width: 1200px) {
  .top-navbar-inner {
    max-width: calc(100% - 240px);
    margin-right: 20px;
  }
}

@media (max-width: 768px) {
  .top-navbar-inner {
    max-width: calc(100% - 80px);
    margin-left: 60px;
    margin-right: 20px;
  }
}

.top-navbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.top-navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

.top-navbar-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-nav-item {
  position: relative;
}

.top-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,.85);
  font-size: 14px;
  text-decoration: none;
  transition: all .2s ease;
  cursor: pointer;
}

.top-nav-link:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.top-nav-link i {
  font-size: 14px;
}

/* Dropdown Menu */
.has-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 180px;
  background: rgba(30, 41, 59, 0.98);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all .2s ease;
  z-index: 1001;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}

.dropdown-menu-right {
  left: auto;
  right: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  text-decoration: none;
  transition: all .2s ease;
}

.dropdown-item:hover {
  background: rgba(255,255,255,.05);
  color: #fff;
}

.dropdown-item i {
  width: 16px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: 6px 0;
}

/* Dropdown hover effect */
.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mega Menu */
.has-mega-menu {
  position: relative;
}

.mega-menu-bridge {
  position: absolute;
  top: 100%;
  left: 0;
  height: 30px;
  width: 100%;
  z-index: 1003;
  cursor: default;
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 29px;
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  background: rgba(30, 41, 59, 0.98);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all .2s ease;
  z-index: 1004;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}

.mega-menu-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mega-menu-group {
  width: 100%;
  min-width: auto;
}

.mega-menu-group-title {
  font-size: 12px;
  font-weight: 600;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  width: 100%;
  box-sizing: border-box;
}

.mega-menu-group-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mega-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12px;
  text-decoration: none;
  transition: all .2s ease;
  width: 100%;
  box-sizing: border-box;
}

.mega-menu-item:hover {
  background: rgba(139,92,246,.15);
  color: #fff;
}

.mega-menu-item i {
  width: 16px;
  text-align: center;
  color: #8b5cf6;
  font-size: 12px;
}

/* Right Side */
.top-navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav-search-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all .2s ease;
}

.top-nav-search-btn:hover {
  background: rgba(255,255,255,.2);
}

.top-nav-login-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  transition: all .2s ease;
}

.top-nav-login-btn:hover {
  background: rgba(255,255,255,.2);
}

.top-nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all .2s ease;
}

.top-nav-user-btn:hover {
  background: rgba(255,255,255,.2);
}

.top-nav-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.top-nav-user-name {
  font-size: 13px;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity .3s ease;
}

.search-overlay.active {
  opacity: 1;
}

.search-overlay-inner {
  width: 100%;
  max-width: 600px;
  padding: 20px;
}

.search-overlay-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: all .2s ease;
}

.search-overlay-close:hover {
  background: rgba(255,255,255,.2);
}

.search-overlay-form {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 16px;
  padding: 8px;
}

.search-overlay-form i {
  padding-left: 16px;
  color: #8b5cf6;
  font-size: 18px;
}

.search-overlay-form input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  padding: 16px 8px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.search-overlay-form input::placeholder {
  color: #64748b;
}

/* Hide browser autocomplete dropdown styling */
.search-overlay-form input:-webkit-autofill,
.search-overlay-form input:-webkit-autofill:hover,
.search-overlay-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0px 1000px rgba(30, 41, 59, 0.8) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* Remove default browser clear button */
.search-overlay-form input::-webkit-search-decoration,
.search-overlay-form input::-webkit-search-cancel-button,
.search-overlay-form input::-webkit-search-results-button,
.search-overlay-form input::-webkit-search-results-decoration {
  display: none;
}

/* Hero section search input styling */
.hero-section input[type="text"] {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.hero-section input[type="text"]:-webkit-autofill,
.hero-section input[type="text"]:-webkit-autofill:hover,
.hero-section input[type="text"]:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0px 1000px rgba(30, 41, 59, 0.8) inset;
  transition: background-color 5000s ease-in-out 0s;
}

.hero-section input[type="text"]::-webkit-search-decoration,
.hero-section input[type="text"]::-webkit-search-cancel-button,
.hero-section input[type="text"]::-webkit-search-results-button,
.hero-section input[type="text"]::-webkit-search-results-decoration {
  display: none;
}

.search-overlay-form button {
  padding: 12px 24px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.search-overlay-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,92,246,.4);
}

/* Adjust main content for top navbar */
.main-content {
  margin-top: 60px;
}

/* Fix right sidebar position */
.right-sidebar {
  top: 0 !important;\n  height: 100vh !important;
  z-index: 100 !important;
}

.top-navbar {
  z-index: 200 !important;
}
idebar position */
.right-sidebar {
  top: 0 !important;\n  height: 100vh !important;
  z-index: 100 !important;
}

.top-navbar {
  z-index: 200 !important;
}

/* ============================================
   Article Content Image Fix - Force max-width
   ============================================ */
/* 基础图片限制 */
.article-content img,
.article-content figure img,
.article-content .wp-block-image img,
.article-content img[class*="wp-image-"] {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
    display: block !important;
}
.article-content figure,
.article-content .wp-block-image {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 额外保护：确保图片容器不会溢出 */
.article-content p {
    max-width: 100% !important;
    overflow: hidden !important;
}
.article-content p img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
}

/* ============================================
   Mobile Responsive Styles
   ============================================ */
@media (max-width: 768px) {
  /* Main content adjustments */
  .main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 60px 16px 40px !important;
  }
  
  /* Footer mobile adjustments */
  .main-footer {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  .main-footer .footer-container {
    padding: 0 !important;
  }
  
  .main-footer .footer-top {
    flex-direction: column !important;
    gap: 20px !important;
  }
  
  .main-footer .footer-left {
    flex: none !important;
    width: 100% !important;
  }
  
  .main-footer .footer-center {
    flex: none !important;
    width: 100% !important;
  }
  
  .main-footer .footer-right {
    flex: none !important;
    width: 100% !important;
    justify-content: center !important;
    gap: 30px !important;
  }
  
  .main-footer .footer-qr-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: row !important;
  }
  
  .main-footer .footer-qr-img {
    margin: 0 !important;
  }
  
  .main-footer .footer-qr-item span {
    text-align: left;
  }
  
  /* Hero section */
  .hero-section {
    padding: 40px 16px 30px !important;
  }
  
  .hero-section h1 {
    font-size: clamp(28px, 8vw, 48px) !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }
  
  /* Hot tags */
  .hero-section .hot-tags {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  
  /* Stats */
  .hero-section .stats {
    gap: 30px !important;
  }
  
  /* Cards grid */
  .site-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  /* Article cards */
  .article-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Right sidebar hidden on mobile */
  .right-sidebar {
    display: none !important;
  }
  
  /* Left sidebar as overlay */
  .left-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .left-sidebar.open {
    transform: translateX(0);
  }
}

@media (max-width: 480px) {
  .site-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================
   Mobile Responsive Fixes - Extended
   ============================================ */
@media (max-width: 768px) {
  /* Top Navbar */
  .top-navbar {
    left: 0 !important;
    width: 100% !important;
  }
  
  .top-navbar-inner {
    padding: 0 16px !important;
  }
  
  .top-navbar-nav {
    gap: 16px !important;
  }
  
  .top-nav-link {
    font-size: 13px !important;
    white-space: nowrap !important;
  }
  
  /* Left Sidebar - Hidden by default on mobile */
  .left-sidebar {
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease !important;
    z-index: 1000 !important;
  }
  
  .left-sidebar.open {
    transform: translateX(0) !important;
  }
  
  /* Right Sidebar - Hidden on mobile */
  .right-sidebar {
    display: none !important;
  }
  
  /* Main Content */
  .main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 60px 16px 40px !important;
  }
  
  /* Hero Section */
  .hero-section {
    padding: 40px 16px 30px !important;
  }
  
  .hero-section h1 {
    font-size: clamp(28px, 8vw, 48px) !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }
  
  .hero-section p {
    font-size: 14px !important;
  }
  
  /* Hot tags */
  .hero-section .hot-tags,
  .hero-section div[style*="flex-wrap: wrap"] {
    gap: 8px !important;
  }
  
  .hero-section .hot-tags a,
  .hero-section div[style*="flex-wrap: wrap"] a {
    font-size: 12px !important;
    padding: 4px 10px !important;
  }
  
  /* Stats */
  .hero-section .stats,
  .hero-section div[style*="gap: 60px"] {
    gap: 30px !important;
    flex-wrap: wrap !important;
  }
  
  /* Feature Cards Grid */
  .hero-section div[style*="grid-template-columns: repeat(auto-fit"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Category Sections */
  .fav-category {
    padding: 16px !important;
  }
  
  .fav-category-header {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: flex-start !important;
  }
  
  /* Site Cards Grid */
  .xe-card {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .row .xe-card {
    width: 50% !important;
    float: left !important;
    padding: 0 8px !important;
  }
  
  /* Site Card Inner */
  .xe-widget {
    padding: 12px !important;
  }
  
  .xe-user-img img {
    width: 36px !important;
    height: 36px !important;
  }
  
  .xe-user-name strong {
    font-size: 13px !important;
  }
  
  .xe-comment p {
    font-size: 12px !important;
  }
  
  /* Child Category Tags */
  .child-cat-tags {
    gap: 8px !important;
  }
  
  .child-cat-tag {
    font-size: 12px !important;
    padding: 6px 12px !important;
  }
  
  /* Articles Grid */
  .article-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* AI Guide Cards */
  .ai-guide-card {
    flex: 0 0 260px !important;
  }
  
  /* Footer */
  .main-footer > div[style*="max-width: 1400px"] {
    padding: 0 20px !important;
  }
  
  .main-footer > div > div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 30px !important;
  }
  
  .main-footer > div > div > div {
    flex: 1 1 auto !important;
    width: 100% !important;
  }
  
  .main-footer .footer-links {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  
  .main-footer .footer-links a {
    white-space: nowrap !important;
  }
  
  /* Footer QR codes */
  .main-footer div[style*="flex: 0 0 200px"] {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }
  
  /* Footer bottom */
  .main-footer .footer-bottom {
    flex-direction: column !important;
    gap: 12px !important;
    text-align: center !important;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .row .xe-card {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
  }
  
  .top-navbar-nav .has-mega-menu {
    display: none !important;
  }
  
  .hero-section h1 {
    font-size: 24px !important;
  }
}

/* ============================================
   CRITICAL: Dropdown Menu - Highest Priority
   ============================================ */
body.page-body .top-navbar {
  overflow: visible !important;
}

body.page-body .top-navbar-inner {
  overflow: visible !important;
}

body.page-body .top-navbar-nav {
  overflow-x: visible !important;
  overflow-y: visible !important;
}

/* Allow mobile menu to override position */
body.page-body .top-navbar-nav:not(.mobile-open) {
  position: relative !important;
}

/* 下拉菜单相对于wrapper定位 */
body.page-body .top-nav-dropdown-wrapper {
  position: relative !important;
}

body.page-body .top-nav-dropdown-wrapper > .top-nav-dropdown-menu,
body.page-body .top-nav-dropdown-wrapper > .top-nav-dropdown {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  z-index: 99999 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease !important;
  margin-top: 8px !important;
}

body.page-body .top-nav-dropdown-wrapper:hover > .top-nav-dropdown-menu,
body.page-body .top-nav-dropdown-wrapper:hover > .top-nav-dropdown {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

