/* ============================
   AI工具导航站 - 活泼渐变风格
   Warm gradient + playful design
   ============================ */

/* ===== 配色变量 - 亮色（暖白底+珊瑚橙+薄荷绿+葡萄紫） ===== */
:root {
  --bg-primary: #fff9f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #fff4ed;
  --bg-tag: #fff0eb;
  --text-primary: #2d1b3d;
  --text-secondary: #6b5b6e;
  --text-muted: #a8989c;
  --border-color: #fce8de;
  --accent: #ff6b35;
  --accent-hover: #e55118;
  --accent-light: rgba(255, 107, 53, 0.08);
  --accent-2: #7c3aed;
  --accent-3: #06b6d4;
  --accent-4: #10b981;
  --shadow-sm: 0 2px 8px rgba(255,107,53,0.06);
  --shadow-md: 0 6px 20px rgba(255,107,53,0.1);
  --shadow-lg: 0 12px 36px rgba(255,107,53,0.15);
  --shadow-card: 0 4px 16px rgba(45,27,61,0.06);
  --shadow-card-hover: 0 12px 32px rgba(255,107,53,0.18);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --sidebar-w: 230px;
  --header-h: 64px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --tag-free: #10b981;
  --tag-paid: #f59e0b;
  --tag-open: #7c3aed;
  --gradient-hero: linear-gradient(135deg, #ff6b35 0%, #ee5a6f 35%, #7c3aed 70%, #4f46e5 100%);
  --gradient-bulletin: linear-gradient(90deg, #fff3e0 0%, #ffe0e6 50%, #f0e0ff 100%);
  --gradient-footer: linear-gradient(135deg, #2d1b3d 0%, #1a1030 50%, #2d1845 100%);
  --gradient-sidebar-active: linear-gradient(90deg, rgba(255,107,53,0.12) 0%, rgba(124,58,237,0.08) 100%);
}

/* ===== 配色变量 - 暗色（深邃紫黑+霓虹色） ===== */
[data-theme="dark"] {
  --bg-primary: #131022;
  --bg-secondary: #1e1b34;
  --bg-card: #252143;
  --bg-hover: #2d294f;
  --bg-tag: #2a2645;
  --text-primary: #f0e8ff;
  --text-secondary: #b8acc8;
  --text-muted: #786d8a;
  --border-color: #322f50;
  --accent: #ff8c5a;
  --accent-hover: #ff7038;
  --accent-light: rgba(255, 140, 90, 0.1);
  --accent-2: #a78bfa;
  --accent-3: #22d3ee;
  --accent-4: #34d399;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 36px rgba(0,0,0,0.5);
  --shadow-card: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-card-hover: 0 12px 32px rgba(255,140,90,0.2);
  --tag-free: #34d399;
  --tag-paid: #fbbf24;
  --tag-open: #a78bfa;
  --gradient-hero: linear-gradient(135deg, #ff6b35 0%, #ee5a6f 35%, #7c3aed 70%, #4f46e5 100%);
  --gradient-bulletin: linear-gradient(90deg, #2a1f1a 0%, #2a1820 50%, #251f30 100%);
  --gradient-footer: linear-gradient(135deg, #0e0b18 0%, #0a0812 50%, #100a20 100%);
  --gradient-sidebar-active: linear-gradient(90deg, rgba(255,140,90,0.15) 0%, rgba(167,139,250,0.1) 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* 全局装饰背景 */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,107,53,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -200px;
  left: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body::before {
  background: radial-gradient(circle, rgba(255,140,90,0.06) 0%, transparent 70%);
}
[data-theme="dark"] body::after {
  background: radial-gradient(circle, rgba(167,139,250,0.06) 0%, transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

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

img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ============================
   布局
   ============================ */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-logo {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  flex-shrink: 0;
}

.sidebar-logo a {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo a:link { color: var(--text-primary); }

.sidebar-logo .logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gradient-hero);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255,107,53,0.25);
}

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

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  font-weight: 500;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--accent);
  transform: translateX(2px);
}

.nav-link.active {
  background: var(--gradient-sidebar-active);
  color: var(--accent);
  font-weight: 700;
}

.nav-link .nav-icon {
  width: 28px;
  height: 28px;
  margin-right: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: var(--bg-tag);
  font-size: 15px;
  transition: all var(--transition);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  background: var(--accent-light);
  transform: scale(1.08);
}

.nav-link .nav-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform var(--transition);
  opacity: 0.6;
}

.nav-link.expanded .nav-arrow {
  transform: rotate(90deg);
}

.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 8px;
}

.nav-submenu.open {
  max-height: 500px;
}

.nav-submenu .nav-link {
  padding-left: 42px;
  font-size: 12px;
  padding: 7px 14px 7px 42px;
}

.nav-submenu .nav-link::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  position: absolute;
  left: 28px;
  transition: background var(--transition);
}

.nav-submenu .nav-link:hover::before,
.nav-submenu .nav-link.active::before {
  background: var(--accent);
}

/* 侧边栏折叠 */
.sidebar.collapsed { width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .sidebar-nav { width: 0; overflow: hidden; }

/* ===== 主内容区 ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.3s ease;
  min-width: 0;
}

.sidebar.collapsed ~ .main-content { margin-left: 0; }

/* ============================
   顶部Header
   ============================ */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  backdrop-filter: blur(12px);
}

.header-toggle {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-hover);
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
  transition: all var(--transition);
}

.header-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.header-toggle svg { width: 20px; height: 20px; }

.header-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.header-menu a {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  transition: all var(--transition);
  font-weight: 500;
}

.header-menu a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-hover);
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
  transform: rotate(15deg);
}

.theme-toggle svg { width: 20px; height: 20px; }

.mobile-menu-btn { display: none; }

/* ============================
   Hero搜索区
   ============================ */
.hero {
  position: relative;
  padding: 48px 20px 32px;
  text-align: center;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
  background: var(--gradient-hero);
}

[data-theme="dark"] .hero {
  opacity: 0.95;
}

/* Hero装饰圆 */
.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 10%;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  pointer-events: none;
}

.hero-title {
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 8px;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
  font-weight: 400;
}

/* 搜索框 */
.search-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.search-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-tab {
  padding: 5px 16px;
  font-size: 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.search-tab:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

.search-tab.active {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: none;
  border-radius: 18px;
  transition: all var(--transition);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.search-box:focus-within {
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  transform: translateY(-1px);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 16px 22px;
  font-size: 15px;
  color: #333;
}

.search-box input::placeholder { color: #bbb; }

.search-btn {
  padding: 10px 28px;
  margin: 5px;
  background: var(--gradient-hero);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(255,107,53,0.3);
}

.search-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(255,107,53,0.4);
}

/* 搜索联想 */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  margin-top: 6px;
}

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

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 13px;
}

.suggestion-item:hover { background: var(--bg-hover); }

.suggestion-item .sug-icon {
  width: 28px;
  height: 28px;
  background: var(--accent-light);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: bold;
  flex-shrink: 0;
}

.suggestion-item .sug-name { font-weight: 600; color: var(--text-primary); }

.suggestion-item .sug-desc {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: auto;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================
   公告栏
   ============================ */
.bulletin-bar {
  max-width: 1200px;
  margin: 20px auto 20px;
  padding: 10px 18px;
  background: var(--gradient-bulletin);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  overflow: hidden;
}

.bulletin-label {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bulletin-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 22px;
}

.bulletin-content {
  position: absolute;
  white-space: nowrap;
  animation: scroll 35s linear infinite;
}

.bulletin-content span {
  margin-right: 60px;
  color: var(--text-secondary);
}

.bulletin-content span date {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 4px;
}

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

/* ============================
   推荐区
   ============================ */
.recommend-section {
  max-width: 1200px;
  margin: 0 auto 28px;
  padding: 0 20px;
}

.recommend-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.recommend-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.recommend-tab:hover { color: var(--accent); }

.recommend-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.recommend-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.recommend-item:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
  border-color: var(--accent);
}

.recommend-item .item-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-hero);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255,107,53,0.2);
}

.recommend-item .item-info { min-width: 0; flex: 1; }

.recommend-item .item-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.recommend-item .item-desc {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================
   分类区
   ============================ */
.category-section {
  max-width: 1200px;
  margin: 0 auto 36px;
  padding: 0 20px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.category-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-header h2::before {
  content: '';
  width: 5px;
  height: 22px;
  background: var(--gradient-hero);
  border-radius: 3px;
}

.category-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-tag);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.category-more {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  padding: 5px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  transition: all var(--transition);
  font-weight: 500;
  cursor: pointer;
}

.category-more:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* 子分类标签 */
.sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.sub-tab {
  padding: 6px 16px;
  font-size: 13px;
  border-radius: 20px;
  background: var(--bg-tag);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
  font-weight: 500;
}

.sub-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-secondary);
}

.sub-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(255,107,53,0.25);
}

/* 工具网格 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

/* 工具卡片 - 核心视觉元素 */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  animation: cardIn 0.4s ease backwards;
}

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

/* 卡片顶部彩色渐变条 */
.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-hero);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.tool-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-5px);
  border-color: var(--accent);
}

.tool-card:hover::before { transform: scaleX(1); }

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-hero);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255,107,53,0.18);
  transition: all var(--transition);
}

.tool-card:hover .tool-icon {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 6px 18px rgba(255,107,53,0.28);
}

.tool-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-new-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
  font-weight: 600;
}

.tool-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tool-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tool-tag {
  font-size: 10px;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--bg-tag);
  color: var(--text-muted);
  font-weight: 500;
}

.tool-tag.tag-free { color: var(--tag-free); background: rgba(16,185,129,0.1); }
.tool-tag.tag-paid { color: var(--tag-paid); background: rgba(245,158,11,0.1); }
.tool-tag.tag-open { color: var(--tag-open); background: rgba(124,58,237,0.1); }

.tool-link {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: gap var(--transition);
}

.tool-card:hover .tool-link { gap: 6px; }

.tool-link svg { width: 12px; height: 12px; }

/* ============================
   筛选条
   ============================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.filter-label {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.filter-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-option {
  padding: 5px 16px;
  font-size: 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}

.filter-option:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.filter-option.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(255,107,53,0.25);
}

.filter-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================
   Footer
   ============================ */
.footer {
  background: var(--gradient-footer);
  padding: 40px 20px 24px;
  margin-top: 48px;
  border-radius: 24px 24px 0 0;
  position: relative;
  overflow: hidden;
}

/* Footer装饰 */
.footer::before {
  content: '';
  position: absolute;
  top: -50px;
  right: 10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,107,53,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  margin-bottom: 24px;
  position: relative;
}

.footer-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #fff;
}

.footer-section ul li { margin-bottom: 8px; }

.footer-section ul li a {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  transition: all var(--transition);
}

.footer-section ul li a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.footer-bottom a {
  color: rgba(255,255,255,0.5);
  margin: 0 8px;
  transition: color var(--transition);
}

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

/* ============================
   悬浮工具栏
   ============================ */
.float-tools {
  position: fixed;
  right: 24px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 80;
}

.float-btn {
  width: 46px;
  height: 46px;
  border: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
}

.float-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.12) rotate(8deg);
  box-shadow: var(--shadow-lg);
}

.float-btn svg { width: 20px; height: 20px; }

/* 回到顶部按钮 */
.float-btn.back-top {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.float-btn.back-top.show {
  opacity: 1;
  pointer-events: auto;
}

.float-btn.back-top.show:hover {
  background: var(--accent);
}

/* ============================
   移动端遮罩
   ============================ */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.mobile-overlay.show { display: block; }

/* ============================
   响应式
   ============================ */
@media (max-width: 1024px) {
  .hero-title { font-size: 28px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 250px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.show { transform: translateX(0); }

  .main-content { margin-left: 0; }
  .sidebar.collapsed ~ .main-content { margin-left: 0; }

  .mobile-menu-btn { display: flex; }
  .header-menu { display: none; }

  .hero { padding: 36px 16px 24px; border-radius: 0 0 20px 20px; }
  .hero-title { font-size: 24px; }

  .search-tabs { gap: 3px; }
  .search-tab { padding: 4px 12px; font-size: 11px; }

  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .tool-card { padding: 14px; border-radius: 14px; }
  .tool-icon { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
  .tool-name { font-size: 13px; }
  .tool-desc { font-size: 11px; }

  .recommend-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .recommend-item .item-icon { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }

  .float-tools { right: 14px; bottom: 60px; }
  .float-btn { width: 42px; height: 42px; }

  .footer { border-radius: 16px 16px 0 0; padding: 32px 16px 20px; }
}

@media (max-width: 480px) {
  .tool-grid { grid-template-columns: 1fr; }

  .search-box input { font-size: 14px; padding: 14px 16px; }
  .search-btn { padding: 8px 18px; font-size: 13px; }

  .hero-title { font-size: 22px; }
  .hero-subtitle { font-size: 13px; }

  .category-header h2 { font-size: 18px; }
}

/* ============================
   工具类
   ============================ */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.no-data {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 14px;
}

.fade-in { animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 卡片入场动画延迟（通过JS设置nth-child） */
.tool-card:nth-child(1) { animation-delay: 0.02s; }
.tool-card:nth-child(2) { animation-delay: 0.04s; }
.tool-card:nth-child(3) { animation-delay: 0.06s; }
.tool-card:nth-child(4) { animation-delay: 0.08s; }
.tool-card:nth-child(5) { animation-delay: 0.10s; }
.tool-card:nth-child(6) { animation-delay: 0.12s; }
.tool-card:nth-child(7) { animation-delay: 0.14s; }
.tool-card:nth-child(8) { animation-delay: 0.16s; }
.tool-card:nth-child(n+9) { animation-delay: 0.18s; }
