/* CSS Custom Properties for Theme System */
:root {
  /* Light Theme Colors */
  --primary-color: #6366f1;
  --primary-hover: #5855eb;
  --secondary-color: #f1f5f9;
  --accent-color: #10b981;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* Border Colors */
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  /* Shadow */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Spacing */
  --header-height: 70px;
  --sidebar-width: 280px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Dark Theme */
.dark-theme {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --border-color: #334155;
  --border-hover: #475569;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Header Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-color);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
}

.nav-menu {
  display: flex;
  gap: 3rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color var(--transition-fast);
}

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

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 300px;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 0.75rem;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: var(--bg-tertiary);
  color: var(--primary-color);
}

.theme-icon {
  width: 20px;
  height: 20px;
  transition: all var(--transition-fast);
}

.moon-icon {
  display: none;
}

.dark-theme .sun-icon {
  display: none;
}

.dark-theme .moon-icon {
  display: block;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: all var(--transition-fast);
}

/* Main Layout */
.main {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  padding: 2rem 0;
  overflow-y: auto;
  overflow-x: visible;
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: calc(100vh - var(--header-height));
  transition: all var(--transition-normal);
  z-index: 100;
}

/* 侧边栏切换按钮 */
.sidebar-toggle {
   position: absolute;
   top: 16px;
   right: -6px;
   width: 36px;
   height: 36px;
   display: flex;
   align-items: center;
   justify-content: center;
   background: linear-gradient(135deg, var(--primary-color), var(--primary-color-90));
   box-shadow: 0 0 0 2px var(--bg-primary), 0 6px 18px rgba(99, 102, 241, 0.28);
   border: none;
   border-radius: 12px;
   cursor: pointer;
   outline: none;
   transition: transform 0.22s ease-in-out, box-shadow 0.22s ease, background 0.22s ease, color 0.22s ease;
   z-index: 1100;
   color: var(--text-primary);
 }
.sidebar-toggle:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
  color: var(--primary-color);
}
.sidebar-toggle:hover::before {
  opacity: 1;
}
.sidebar-toggle:active {
  transform: translateY(0) scale(1.02);
  transition: all 0.1s ease;
}
.toggle-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toggle-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
    transform: scale(1.20);
  }
  .dark-theme .toggle-icon {
    filter: drop-shadow(0 1px 3px rgba(255, 255, 255, 0.35));
  }
/* 箭头始终可见，并增强线条清晰度 */
.toggle-icon .toggle-arrow {
   opacity: 1;
   transition: opacity 0.22s ease;
   stroke-width: 2.6;
   vector-effect: non-scaling-stroke;
 }
.toggle-line {
   transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   transform-origin: center;
   display: none;
 }
.toggle-tooltip {
  position: absolute;
  left: -120px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  z-index: 1000;
}
.toggle-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid var(--bg-primary);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.sidebar-toggle:hover .toggle-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(-8px);
}
/* 侧边栏折叠状态 */
.sidebar.collapsed {
  width: 60px;
  padding: 2rem 0.5rem;
}
.sidebar.collapsed .sidebar-content {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-20px);
}
.sidebar.collapsed .sidebar-toggle {
   right: -2px;
   color: var(--text-primary);
   box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.24), 0 10px 24px rgba(0, 0, 0, 0.6);
 }

/* 暗色主题下收起态图标的尺寸与光晕增强 */
.sidebar.collapsed .toggle-icon {
   transform: rotate(180deg) scale(1.20);
 }

/* 暗色主题下按钮常态的描边环稍微提亮，避免被深色背景吞没 */
.dark-theme .sidebar-toggle {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18), 0 6px 18px rgba(99, 102, 241, 0.28);
  color: #ffffff;
}

/* Dark theme collapsed state: force white arrow color to override light-theme collapsed rule */
.dark-theme .sidebar.collapsed .sidebar-toggle {
  color: #ffffff !important;
}
.sidebar.collapsed .toggle-line-1 {
   display: none !important;
 }
 .sidebar.collapsed .toggle-line-2 {
   display: none !important;
 }
 .sidebar.collapsed .toggle-line-3 {
   display: none !important;
 }
.sidebar.collapsed .toggle-tooltip {
  left: -100px;
}
.sidebar.collapsed .toggle-tooltip::before {
  content: '展开侧边栏';
}
/* 主内容区域适配 */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem;
  max-width: calc(100vw - var(--sidebar-width));
  transition: all var(--transition-normal);
}
/* 侧边栏收起时的内容区域调整 */
.sidebar.collapsed ~ .content {
  margin-left: 60px;
  max-width: calc(100vw - 60px);
  padding: 2rem 1.5rem;
}
.sidebar-content {
  padding: 0 1.5rem;
  transition: all var(--transition-normal);
  height: 100%;
  overflow-y: auto;
}
.category-section,
.filter-section {
  margin-bottom: 2rem;
}
/* 优化侧边栏滚动条样式 */
.sidebar::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
  transition: background var(--transition-fast);
}
.sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
.category-title,
.filter-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.category-list {
  list-style: none;
}
.category-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0.5rem;
  margin-bottom: 0.25rem;
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: 0.95rem;
  gap: 0.75rem;
}
.category-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: all var(--transition-fast);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}
.category-link:hover .category-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}
.category-link.active .category-icon {
  transform: scale(1.05);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}
.category-link:hover,
.category-link.active {
  background-color: var(--bg-secondary);
  color: var(--primary-color);
}
.filter-group {
  margin-bottom: 1.5rem;
}
.filter-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}
.checkbox-label:hover {
  color: var(--text-primary);
}
.filter-checkbox {
  display: none;
}
.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  transition: all var(--transition-fast);
}
.filter-checkbox:checked + .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.filter-checkbox:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
/* Content Area */
.content {
  flex: 1;
  padding: 2rem;
  max-width: calc(100vw - var(--sidebar-width));
}
.content-header {
  margin-bottom: 2rem;
}
.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.page-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}
.content-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.sort-options {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sort-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.sort-select:focus {
  outline: none;
  border-color: var(--primary-color);
}
.view-options {
  display: flex;
  gap: 0.5rem;
}
.view-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.view-btn:hover,
.view-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}
.view-btn svg {
  width: 18px;
  height: 18px;
}
/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
  transition: all var(--transition-normal);
}
/* 侧边栏收起时的工具网格布局 */
.sidebar.collapsed ~ .content .tools-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: none;
}
/* 侧边栏收起时的工具卡片优化 */
.sidebar.collapsed ~ .content .tool-card {
  min-height: 180px;
}
.sidebar.collapsed ~ .content .tool-card-header {
  padding: 0.875rem;
}
.sidebar.collapsed ~ .content .tool-content {
  padding: 0 0.875rem 0.875rem 0.875rem;
}
.sidebar.collapsed ~ .content .tool-card-footer {
  padding: 0.875rem;
}
.sidebar.collapsed ~ .content .tool-icon {
  width: 50px;
  height: 50px;
}
.sidebar.collapsed ~ .content .tool-icon svg {
  width: 28px;
  height: 28px;
}
.sidebar.collapsed ~ .content .tool-title {
  font-size: 1rem;
}
.sidebar.collapsed ~ .content .tool-description {
  font-size: 0.75rem;
  -webkit-line-clamp: 1;
}
/* Empty State Styles */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  min-height: 300px;
}
.empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  opacity: 0.6;
}
.empty-icon svg {
  width: 100%;
  height: 100%;
}
.empty-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.empty-description {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.6;
}
/* Tool Card Styles - Enhanced Visual Hierarchy */
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0;
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  height: auto;
  min-height: 200px;
}
.tool-card-header {
  padding: 1rem;
  border-radius: 0.75rem 0.75rem 0 0;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

/* 收藏按钮样式 */
.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.favorite-btn.favorited {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.favorite-btn.favorited:hover {
    background: linear-gradient(135deg, #ff5252, #e53935);
    transform: scale(1.1);
}

.favorite-icon {
    width: 18px;
    height: 18px;
    color: #666;
    transition: all 0.3s ease;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.favorite-btn .favorite-icon path {
    fill: inherit;
    stroke: inherit;
    stroke-width: inherit;
}

.favorite-btn.favorited .favorite-icon {
    fill: currentColor;
    stroke: currentColor;
}

.favorite-btn.favorited .favorite-icon path {
    fill: inherit;
    stroke: inherit;
}

.favorite-btn:hover .favorite-icon {
    color: #ff6b6b;
}

.favorite-btn.favorited .favorite-icon {
    color: white;
}

/* 暗黑模式下的收藏按钮 */
.dark-mode .favorite-btn,
.dark-theme .favorite-btn {
    background: rgba(45, 45, 45, 0.9);
    color: #e0e0e0;
}

.dark-mode .favorite-btn:hover,
.dark-theme .favorite-btn:hover {
    background: rgba(60, 60, 60, 1);
}

.dark-mode .favorite-icon,
.dark-theme .favorite-icon {
    color: #b0b0b0;
}

.dark-mode .favorite-btn:hover .favorite-icon,
.dark-theme .favorite-btn:hover .favorite-icon {
    color: #ff6b6b;
}
.tool-card-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(var(--primary-color-rgb), 0.1), 
    rgba(var(--secondary-color-rgb), 0.05)
  );
  pointer-events: none;
}
.tool-icon {
  width: 60px;
  height: 60px;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.tool-icon svg {
  width: 32px;
  height: 32px;
  color: var(--primary-color);
  transition: all var(--transition-fast);
}
.tool-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.tool-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--primary-color)15, var(--primary-color)05);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid var(--primary-color)20;
  display: inline-block;
  width: fit-content;
}
.tool-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.rating-stars {
  color: #fbbf24;
  font-size: 0.875rem;
  filter: drop-shadow(0 1px 2px rgba(251, 191, 36, 0.3));
}
.rating-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
.tool-content {
  padding: 0 1rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
} gap: 0.75rem;
}
.tool-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-description {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 0.75rem 0;
}
.tool-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0;
}
.tool-tag {
  padding: 0.375rem 0.75rem;
  background: linear-gradient(135deg, var(--primary-color)08, var(--primary-color)15);
  color: var(--primary-color);
  border: 1px solid var(--primary-color)25;
  border-radius: 1rem;
  font-size: 0.625rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.tool-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}
.tool-tag:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.tool-tag:hover::before {
  left: 100%;
}
/* Tool Card Footer - Enhanced Design */
.tool-card-footer {
  padding: 1rem;
  background: linear-gradient(135deg, var(--bg-secondary)50, var(--bg-tertiary)30);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  margin-top: auto;
}
.tool-card-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-color)30, transparent);
}
.tool-action-btn {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 0.875rem 1.75rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.15);
  text-transform: none;
  letter-spacing: 0.02em;
  min-width: 120px;
  justify-content: center;
  margin-left: auto;
}
.tool-action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.5s ease;
}
.tool-action-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), transparent, rgba(99, 102, 241, 0.1));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  pointer-events: none;
}
.tool-action-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-color)90);
  color: white;
  border-color: var(--primary-color);
}
.tool-action-btn:hover::before {
  left: 100%;
}
.tool-action-btn:active {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.2);
}
.tool-action-btn span {
  font-weight: 700;
  text-shadow: none;
  position: relative;
  z-index: 1;
}
.tool-action-btn:hover span {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.tool-action-icon {
  width: 18px;
  height: 18px;
  transition: all var(--transition-fast);
  position: relative;
  z-index: 1;
}
.tool-action-btn:hover .tool-action-icon {
  transform: translateX(3px) rotate(5deg);
}
/* Enhanced Card Hover Effects */
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-color)30;
}
.tool-card:hover .tool-card-footer {
  background: linear-gradient(135deg, var(--primary-color)08, var(--primary-color)15);
}
.tool-card:hover .tool-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}
.tool-card:hover .tool-icon svg {
  transform: scale(1.1);
}
.tool-card:hover .tool-title {
  color: var(--primary-color);
}
.tool-card:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.card-icon svg {
  width: 28px;
  height: 28px;
  object-fit: contain;
  /* 移除颜色覆盖，让SVG保持原有的彩色效果 */
}
.card-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  /* 移除滤镜，让图片保持原有颜色 */
}
.card-icon.has-custom-icon {
  background: transparent;
  border: 1px solid var(--border-color);
}
.card-icon.has-custom-icon svg {
  /* 移除颜色覆盖，让SVG保持原有的彩色效果 */
}
.card-icon.has-custom-icon img {
  /* 移除滤镜，让图片保持原有颜色 */
}

/* 深色主题下保持彩色图标效果 */
.dark-theme .card-icon.has-custom-icon img {
  /* 移除滤镜，让图片保持原有颜色 */
}
.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.card-tag {
  padding: 0.25rem 0.75rem;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.card-action {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.card-action:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}
.card-price {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.75rem;
  background-color: var(--accent-color);
  color: white;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}



/* Load More Button */
.load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.load-more-btn {
  padding: 1rem 2rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.load-more-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

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

/* Skeleton Loading Animation */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
}

.skeleton-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.skeleton-title {
  height: 1.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  width: 70%;
}

.skeleton-description {
  height: 1rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.skeleton-description:last-of-type {
  width: 60%;
  margin-bottom: 1rem;
}

.skeleton-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.skeleton-tag {
  height: 1.5rem;
  width: 60px;
  border-radius: 1rem;
}

.skeleton-button {
  height: 2.5rem;
  border-radius: 0.75rem;
}

/* Responsive Design */

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  
  /* 平板设备上侧边栏收起时的布局调整 */
  .sidebar.collapsed ~ .content .tools-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  
  .search-input {
    width: 250px;
  }
  
  .content {
    padding: 1.5rem;
  }
  
  .page-title {
    font-size: 2rem;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }
  
  .nav-menu {
    display: none;
  }
  
  .search-input {
    width: 200px;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .sidebar {
    position: fixed;
    left: -100%;
    top: var(--header-height);
    width: 280px;
    height: calc(100vh - var(--header-height));
    z-index: 999;
    transition: left var(--transition-normal);
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .content {
    width: 100%;
    max-width: 100vw;
    margin-left: 0;
    padding: 1rem;
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  


  .page-title {
    font-size: 1.75rem;
  }
  
  .page-subtitle {
    font-size: 1rem;
  }
  
  .content-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .sort-options {
    justify-content: space-between;
  }
  
  .view-options {
    justify-content: center;
  }
  
  .header-container {
    padding: 0 1rem;
  }
  
  .search-container {
    order: 3;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }
  
  .search-container.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .search-input {
    width: 100%;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
  .header-container {
    padding: 0 0.75rem;
  }
  
  .content {
    padding: 0.75rem;
  }
  
  .tool-card {
    padding: 1rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .logo-text {
    display: none;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-secondary: #000000;
  }
  
  .dark-theme {
    --border-color: #ffffff;
    --text-secondary: #ffffff;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .tool-card:hover {
    transform: none;
  }
}

/* Print Styles */
@media print {
  .header,
  .sidebar,
  .back-to-top,
  .load-more-container {
    display: none;
  }
  
  .main {
    margin-top: 0;
  }
  
  .content {
    max-width: none;
    padding: 0;
  }
  
  .tool-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}