/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: rgba(99,102,241,0.08);
  --hot: #ef4444;
  --hot-light: #fef2f2;
  --new: #22c55e;
  --new-light: #f0fdf4;
  --gold: #f59e0b;
  --silver: #9ca3af;
  --bronze: #d97706;
  --bg: #f5f7fa;
  --card: #ffffff;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --border: #eef0f4;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-hover: 0 8px 25px rgba(99,102,241,0.12), 0 4px 10px rgba(0,0,0,0.04);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  --hover-bg: #f8f9fb;
  --tag-bg: #f0fdf4;
  --radius: 10px;
  --radius-lg: 14px;
  --header-bg: rgba(255,255,255,0.92);
  --nav-bg: #ffffff;
  --section-border: #eef0f4;
  --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* 深色模式 */
[data-theme="dark"] {
  --bg: #0c0f1a;
  --card: #161b2e;
  --card-bg: #161b2e;
  --text: #e8ecf4;
  --text-secondary: #8b95a8;
  --border: #232940;
  --shadow: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-hover: 0 8px 25px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.15);
  --hover-bg: #1c2237;
  --tag-bg: #1a2e1a;
  --header-bg: rgba(12,15,26,0.92);
  --nav-bg: #161b2e;
  --section-border: #232940;
  --hot-light: #1a1a2e;
  --new-light: #1a2e1a;
  --primary-light: rgba(99,102,241,0.12);
}

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 顶部头部 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transition: background 0.35s;
  border-bottom: 1px solid var(--border);
}

.header-top {
  padding: 10px 0;
}

.header-container {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 7px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  transition: color 0.3s;
  letter-spacing: -0.02em;
}

.site-slogan {
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: color 0.3s;
}

/* 右侧导航 */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.header-nav-item {
  padding: 6px 14px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 450;
}

.header-nav-item:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.header-nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

/* 深浅色切换按钮 */
.theme-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.theme-icon { width: 11px; height: 11px; transition: opacity 0.2s; }
.theme-icon svg { width: 100%; height: 100%; }
.theme-icon.sun { display: block; }
.theme-icon.moon { display: none; }
[data-theme="dark"] .theme-icon.sun { display: none; }
[data-theme="dark"] .theme-icon.moon { display: block; color: #fff; }

/* 分类导航 */
.category-nav {
  background: var(--nav-bg);
  transition: background 0.3s;
  border-top: 1px solid var(--border);
}

.nav-container {
  max-width: 1152px;
  margin: 0 auto;
  padding: 10px 16px;
}

.nav-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.nav-item {
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
  background: transparent;
  border: 1px solid transparent;
  font-weight: 450;
}

.nav-item:hover { 
  color: var(--primary); 
  background: var(--primary-light);
}

.nav-item.active { 
  color: var(--primary); 
  background: var(--primary-light);
  font-weight: 600;
  border-color: rgba(99,102,241,0.15);
}

.nav-item span {
  padding-left: 0;
}

/* 分类收起/展开按钮 */
.nav-container {
  position: relative;
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 8px auto 0;
  padding: 4px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.nav-toggle .toggle-icon {
  transition: transform 0.3s;
}

.nav-toggle .toggle-icon.down {
  display: none;
}

/* 收起状态：默认显示3行 */
.nav-scroll.collapsed {
  max-height: 105px;
  overflow: hidden;
}

.nav-scroll.collapsed ~ .nav-toggle .toggle-icon.up {
  display: none;
}

.nav-scroll.collapsed ~ .nav-toggle .toggle-icon.down {
  display: block;
}

/* 主体内容 */
.main-content {
  max-width: 1152px;
  margin: 0 auto;
  padding: 20px 12px 32px;
}

/* 聚合搜索 + 网站统计 */
.search-stats-section {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  align-items: stretch;
}
.search-box {
  flex: 1;
  background: linear-gradient(135deg, #f8f9fe 0%, #f5f4ff 50%, #f2f0fc 100%);
  border-radius: 16px;
  padding: 22px 26px;
  border: 1px solid rgba(99,102,241,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(99,102,241,0.05);
  transition: box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}
.search-box:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.15);
}
.search-engine-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.engine-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(99,102,241,0.08);
  cursor: pointer;
  transition: all 0.25s;
  font-size: 13px;
  color: #64748b;
  user-select: none;
  font-weight: 500;
  backdrop-filter: blur(4px);
}
.engine-tab:hover {
  border-color: rgba(99,102,241,0.25);
  background: rgba(255,255,255,0.9);
  color: #6366f1;
}
.engine-tab.active {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(99,102,241,0.35);
}

.search-input-wrap {
  display: flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(99,102,241,0.12);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.search-input-wrap:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}
.search-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--text-primary);
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
  padding: 12px 28px;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
}
.search-btn:hover { opacity: 0.9; }
.search-btn:active { transform: scale(0.97); }

/* 搜索记录 */
.search-history {
  margin-top: 10px;
  display: none;
}
.search-history.show {
  display: block;
}
.search-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.search-history-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.search-history-clear {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}
.search-history-clear:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.06);
}
.search-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.search-history-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.7);
  border: 1px solid #e8e8ec;
  border-radius: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-history-item:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: rgba(99,102,241,0.04);
}
.search-history-item .delete-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 10px;
  color: var(--text-muted);
  transition: all 0.15s;
  flex-shrink: 0;
}
.search-history-item .delete-item:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.08);
}
[data-theme="dark"] .search-history-item {
  background: rgba(30,30,46,0.6);
  border-color: var(--border);
}
[data-theme="dark"] .search-history-item:hover {
  border-color: #818cf8;
  color: #a5b4fc;
  background: rgba(99,102,241,0.08);
}

.stats-box {
  width: 220px;
  min-width: 180px;
  background: linear-gradient(160deg, #f8f9fe 0%, #f3f2ff 100%);
  border-radius: 16px;
  padding: 24px 20px;
  border: 1px solid rgba(99,102,241,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(99,102,241,0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stats-item {
  text-align: center;
  padding: 14px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(99,102,241,0.06);
  backdrop-filter: blur(4px);
  transition: all 0.25s;
}
.stats-item:hover {
  background: rgba(255,255,255,0.85);
  border-color: rgba(99,102,241,0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.08);
}
.stats-num {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: #6366f1;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.stats-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* 工具区域 */
.tool-section { margin-bottom: 32px; }

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--section-border);
  transition: border-color 0.3s;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.3s;
  letter-spacing: -0.02em;
}

.title-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-icon.hot { background: linear-gradient(135deg, #ef4444, #f97316); }
.title-icon.new { background: linear-gradient(135deg, #22c55e, #10b981); }

.section-desc {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.3s;
}

/* ========== 常用工具 ========== */
.common-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) { .common-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 900px) { .common-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .common-grid { grid-template-columns: repeat(3, 1fr); } }

.common-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.common-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  opacity: 0;
  transition: opacity 0.3s;
}

.common-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: rgba(99,102,241,0.2);
}

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

.common-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  overflow: hidden;
  flex-shrink: 0;
}
.common-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
  transition: transform 0.3s ease;
}
.common-card:hover .common-card-icon img {
  transform: scale(1.08);
}
  font-weight: bold;
  flex-shrink: 0;
}

.common-card-info { flex: 1; min-width: 0; }

.common-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s;
  letter-spacing: -0.01em;
}

.common-card:hover .common-card-name {
  color: var(--primary);
}

.common-card-tags {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s;
}

/* ========== 热门工具 - 排行榜 ========== */
.rankings {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 1200px) { .rankings { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .rankings { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .rankings { grid-template-columns: repeat(2, 1fr); } }

/* 排行榜卡片 */
.grid-section { padding: 16px 0; }
.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.grid-col {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.grid-col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.grid-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  font-weight: 600;
}
.grid-icon.cyan { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.grid-icon.blue { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.grid-icon.orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.grid-icon.green { background: linear-gradient(135deg, #10b981, #34d399); }
.grid-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.grid-items { list-style: none; margin: 0; padding: 0 0 8px 0; }
.grid-items li { padding: 6px 12px; }
.grid-items li:last-child { border-bottom: none; }
.grid-items a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  line-height: 1.4;
}
.grid-items a:hover { color: var(--primary); }
.grid-items a .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
  transition: background 0.2s;
}
.grid-items a:hover .dot { background: var(--primary); }
[data-theme="dark"] .grid-col-header { border-color: var(--border); }
[data-theme="dark"] .grid-items a { color: var(--text-secondary); }
[data-theme="dark"] .grid-items a:hover { color: #a5b4fc; }
[data-theme="dark"] .grid-items a .dot { background: #475569; }
[data-theme="dark"] .grid-items a:hover .dot { background: #a5b4fc; }
@media (max-width: 900px) { .grid-container { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .grid-container { grid-template-columns: 1fr; } }

.rank-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.rank-card:hover {
  border-color: rgba(239,68,68,0.3);
  box-shadow: 0 8px 25px rgba(239,68,68,0.1), 0 4px 10px rgba(0,0,0,0.04);
  transform: translateY(-3px);
}

/* 排名标签 */
.rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  z-index: 1;
}

.rank-badge.top1 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.rank-badge.top2 { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.rank-badge.top3 { background: linear-gradient(135deg, #d97706, #b45309); }
.rank-badge.default { background: rgba(0,0,0,0.4); }

.rank-card-image {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: bold;
}

.rank-card-content {
  padding: 10px;
}

.rank-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.rank-card-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  flex-shrink: 0;
}

.rank-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s;
}

.rank-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s;
}

/* 热度指示条 */
.rank-heat {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rank-heat-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.rank-heat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hot), #f97316);
  border-radius: 2px;
  transition: width 0.3s;
}

.rank-heat-value {
  font-size: 10px;
  color: var(--hot);
  font-weight: 600;
  flex-shrink: 0;
}

/* ========== 最新工具（文字简洁版） ========== */
.card-list.text-only {
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) { .card-list.text-only { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 900px) { .card-list.text-only { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .card-list.text-only { grid-template-columns: repeat(3, 1fr); } }

.card-list.text-only .list-card {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}

.card-list.text-only .list-card:hover {
  border-color: rgba(34,197,94,0.3);
  background: var(--hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34,197,94,0.08), 0 2px 8px rgba(0,0,0,0.04);
}

.card-list.text-only .list-card-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  letter-spacing: -0.01em;
}

.card-list.text-only .list-card-name:hover {
  color: var(--new);
}

.card-list.text-only .list-card-desc {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.card-list.text-only .list-card-tags {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-list.text-only .list-card-tag {
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 4px;
  background: rgba(34,197,94,0.08);
  color: #16a34a;
  font-weight: 500;
}

.card-list.text-only .list-card-tag:first-child {
  opacity: 1;
}

/* ========== 热门工具 ========== */
.hot-tabs-wrapper {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.hot-tabs {
  width: 80px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hot-tabs input {
  display: none;
}

.hot-tabs label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card-bg);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hot-tabs label .tab-num {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 5px;
  transition: all 0.25s ease;
}

.hot-tabs label:hover {
  color: var(--primary);
  border-color: rgba(99,102,241,0.3);
  transform: translateX(3px);
}

.hot-tabs label:hover .tab-num {
  background: var(--primary);
  color: #fff;
}

.hot-tabs input:checked + label {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  transform: translateX(3px);
}

.hot-tabs input:checked + label .tab-num {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.hot-content {
  flex: 1;
  min-width: 0;
}

/* ========== 热门工具面板样式 ========== */
.hot-panel .list-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: var(--shadow);
}

.hot-panel .list-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  opacity: 0;
  transition: opacity 0.3s;
}

.hot-panel .list-card:hover {
  border-color: rgba(99,102,241,0.2);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.12), 0 4px 10px rgba(0, 0, 0, 0.04);
  transform: translateY(-3px);
}

.hot-panel .list-card:hover::before {
  opacity: 1;
}

.hot-panel .list-card:hover .list-card-name {
  color: var(--primary);
}

.hot-panel .list-card-image {
  width: 100%;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(34, 197, 94, 0.06));
  color: var(--primary);
  font-size: 22px;
  font-weight: bold;
  position: relative;
}

.hot-panel .list-card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.hot-panel .list-card-content { padding: 12px; }

.hot-panel .list-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.hot-panel .list-card-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

.hot-panel .list-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.25s;
  letter-spacing: -0.01em;
}

.hot-panel .list-card-logo {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

.hot-panel .list-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.25s;
  text-align: left;
}

/* 名称和按钮行 */
.hot-panel .list-card-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 8px 10px 3px;
}

.hot-panel .list-card-title-row .list-card-name {
  padding: 0;
  font-size: 13px;
}

.hot-panel .list-card-btn {
  font-size: 10px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.25s;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.hot-panel .list-card-btn:hover {
  background: #10b981;
  color: #fff;
  transform: scale(1.05);
  border-color: #10b981;
}

.hot-panel .list-card-category {
  font-size: 10px;
  color: #6366f1;
  background: rgba(99,102,241,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  border: 1px solid rgba(99,102,241,0.12);
}

@media (max-width: 1200px) {
  .hot-tabs-wrapper { flex-direction: column; }
  .hot-tabs { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .hot-tabs label { flex: 1; min-width: 60px; padding: 6px 8px; font-size: 12px; }
  .hot-panel.pro { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) { .hot-panel.pro { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .hot-panel.pro { grid-template-columns: repeat(2, 1fr); } }

/* 图片卡片样式 */
.hot-panel .list-card-img {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow);
}

.hot-panel .list-card-img::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
}

.hot-panel .list-card-img:hover {
  border-color: rgba(99,102,241,0.2);
  box-shadow: 0 8px 25px rgba(88,102,241,0.12), 0 4px 10px rgba(0,0,0,0.04);
  transform: translateY(-3px);
}

.hot-panel .list-card-img:hover::before {
  opacity: 1;
}

.hot-panel .list-card-img .list-card-img-wrap {
  width: 100%;
  height: 80px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f4ff, #e8ecf4);
  position: relative;
  flex-shrink: 0;
}

[data-theme="dark"] .hot-panel .list-card-img .list-card-img-wrap {
  background: linear-gradient(135deg, #1a1f36, #252d4a);
}

.hot-panel .list-card-img .list-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hot-panel .list-card-img:hover .list-card-img-wrap img {
  transform: scale(1.06);
}

.hot-panel .list-card-img .list-card-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px 3px;
}

.hot-panel .list-card-img .list-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: color 0.25s;
  letter-spacing: -0.01em;
}

.hot-panel .list-card-img:hover .list-card-name {
  color: var(--primary);
}

.hot-panel .list-card-img .list-card-logo {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
}

.hot-panel .list-card-img .list-card-category {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary);
  background: rgba(88,102,241,0.08);
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 500;
}

.hot-panel .list-card-img .list-card-tags {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
  padding: 3px 10px 8px;
}

.hot-panel .list-card-img .list-card-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #16a34a;
  background: rgba(34,197,94,0.08);
  white-space: nowrap;
  font-weight: 500;
}

.hot-panel .list-card-img:hover .list-card-tag {
  background: rgba(34,197,94,0.12);
}

/* ========== 最新工具 ========== */
.card-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) { .card-list { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .card-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .card-list { grid-template-columns: repeat(2, 1fr); } }

.list-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}

.list-card:hover {
  border-color: rgba(34,197,94,0.2);
  box-shadow: 0 6px 20px rgba(34,197,94,0.08), 0 2px 8px rgba(0,0,0,0.04);
  transform: translateY(-3px);
}

.list-card-image {
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
}

.list-card-content { padding: 12px; }

.list-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.list-card-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

.list-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s;
  letter-spacing: -0.01em;
}

.list-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s;
}

.list-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.list-card-tag {
  padding: 2px 7px;
  font-size: 10px;
  border-radius: 4px;
  color: #16a34a;
  background: rgba(34,197,94,0.08);
  font-weight: 500;
}

.list-card-tag.hot {
  color: #dc2626;
  background: rgba(239,68,68,0.08);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  grid-column: 1 / -1;
}

/* 底部 */
.footer {
  background: #141828;
  color: #94a3b8;
  padding: 20px 12px;
}

/* 网站数据统计 */
.site-stats {
  display: flex;
  justify-content: center;
  gap: 80px;
  padding: 28px 12px;
  border-top: 1px solid var(--border);
}

.stats-item {
  text-align: center;
}

.stats-number {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.stats-label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

[data-theme="dark"] .stats-number {
  color: #e2e8f0;
}

[data-theme="dark"] .stats-label {
  color: #94a3b8;
}

[data-theme="dark"] .footer {
  background: #0a0d17;
  border-top: 1px solid var(--border);
}

.footer-container {
  max-width: 1152px;
  margin: 0 auto;
  text-align: center;
}

.friend-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 16px;
  font-size: 13px;
}

.friend-links .footer-title { color: #cbd5e1; }
.friend-links a { color: #94a3b8; text-decoration: none; transition: color 0.2s; }
.friend-links a:hover { color: #fff; }

.copyright {
  font-size: 11px;
  text-align: center;
  line-height: 1.8;
}
.copyright-links {
  margin-bottom: 6px;
}
.copyright-links a {
  color: #64748b;
  text-decoration: none;
  margin: 0 6px;
}
.copyright-links a:hover { color: #e2e8f0; }
.copyright span { color: #64748b; margin: 0 4px; }
[data-theme="dark"] .copyright-links a { color: #94a3b8; }
[data-theme="dark"] .copyright-links a:hover { color: #fff; }
[data-theme="dark"] .copyright span { color: #94a3b8; }

/* ==================== 自适应模式 ==================== */

/* --- 平板 (<=1200px) --- */
@media (max-width: 1200px) {
  /* 隐藏左右浮动边栏 */
  .float-sidebar,
  .custom-links-sidebar {
    display: none !important;
  }

  /* 页面宽度自适应 */
  .container {
    max-width: 100%;
    padding: 0 20px;
  }

  /* 搜索区域适配 */
  .search-stats-section {
    flex-direction: column;
  }
  .stats-box {
    width: 100%;
    min-width: auto;
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* 热门工具Tab按钮竖向排列改为更紧凑 */
  .hot-panel .hot-tabs {
    min-width: 70px;
  }

  .hot-panel .hot-tab-label {
    font-size: 12px;
    padding: 10px 6px;
  }

  /* 常用工具卡片3列 */
  .common-tools .card-list,
  .latest-tools .card-list {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 热门工具图片卡片3列 */
  .hot-panel .hot-content .card-list {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 底部四栏改为两栏 */
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- 小平板/大手机 (<=992px) --- */
@media (max-width: 992px) {
  /* 常用工具卡片2列 */
  .common-tools .card-list,
  .latest-tools .card-list {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 热门工具图片卡片2列 */
  .hot-panel .hot-content .card-list {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 热门工具Tab改为横向 */
  .hot-panel {
    flex-direction: column;
  }

  .hot-panel .hot-tabs {
    flex-direction: row;
    min-width: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0;
  }

  .hot-panel .hot-tab-label {
    padding: 8px 14px;
    white-space: nowrap;
  }

  .hot-panel .hot-tab-label .tab-num {
    display: none;
  }

  /* 分类页卡片2列 */
  .category-tools {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- 手机 (<=768px) --- */
@media (max-width: 768px) {
  /* 搜索区域适配 */
  .search-engine-tabs {
    gap: 6px;
  }
  .engine-tab {
    padding: 5px 10px;
    font-size: 12px;
  }
  .engine-tab { font-size: 12px; padding: 4px 12px; }
  .search-input { padding: 10px 12px; font-size: 13px; }
  .search-btn { padding: 10px 16px; font-size: 13px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stats-num { font-size: 18px; }

  /* 隐藏左右浮动边栏 */
  .float-sidebar,
  .custom-links-sidebar {
    display: none !important;
  }

  /* 隐藏顶部栏目、分类导航、广告 */
  .header-nav {
    display: none !important;
  }

  body.home .category-nav,
  body.category .category-nav,
  body.detail .category-nav {
    display: none !important;
  }

  body.home .ad-banner {
    display: none !important;
  }

  /* 隐藏底部友情链接和统计 */
  .friend-links {
    display: none !important;
  }

  .site-stats {
    display: none !important;
  }

  /* 页面宽度 */
  .container {
    padding: 0 12px;
  }

  /* 常用工具卡片1列 */
  .common-tools .card-list,
  .latest-tools .card-list {
    grid-template-columns: 1fr;
  }

  /* 热门工具图片卡片1列 */
  .hot-panel .hot-content .card-list {
    grid-template-columns: 1fr;
  }

  /* 热门工具图片卡片高度自适应 */
  .hot-panel .list-card-img {
    height: auto;
  }

  .hot-panel .list-card-img-wrap {
    height: 60px;
  }

  /* 底部四栏改为1栏 */
  .footer-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* section标题更紧凑 */
  .section-title {
    font-size: 16px;
    margin-bottom: 12px;
  }

  /* 分类页卡片1列 */
  .category-tools {
    grid-template-columns: 1fr;
  }

  /* 面包屑更紧凑 */
  .breadcrumb {
    font-size: 12px;
    margin-bottom: 12px;
  }

  /* 详情页内容适配 */
  .detail-main {
    padding: 16px;
  }

  .detail-header h1 {
    font-size: 20px;
  }

  .detail-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  .detail-features {
    grid-template-columns: 1fr;
  }

  /* 顶部导航紧凑 */
  .header-top {
    padding: 8px 12px;
  }

  .logo-text {
    font-size: 14px;
  }

  .site-slogan {
    display: none;
  }

  /* 版权信息 */
  .copyright {
    font-size: 11px;
  }

  .copyright-links a {
    margin: 0 4px;
    font-size: 11px;
  }

  .copyright span {
    display: block;
    margin: 2px 0;
  }

  /* 分类导航滚动 */
  body.home .category-nav .container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .category-nav .nav-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .category-nav .nav-item {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* --- 小手机 (<=480px) --- */
@media (max-width: 480px) {
  .header-top {
    min-width: auto;
    padding: 6px 10px;
  }

  .logo-img {
    width: 24px;
    height: 24px;
  }

  .logo-text {
    font-size: 13px;
  }

  .theme-toggle {
    width: 24px;
    height: 24px;
  }

  .container {
    padding: 0 10px;
  }

  .section-title {
    font-size: 15px;
  }

  /* 卡片更紧凑 */
  .common-card,
  .latest-card {
    padding: 8px 10px;
  }

  .hot-panel .list-card-img {
    padding: 6px 8px;
  }

  .hot-panel .list-card-img-wrap {
    height: 50px;
  }

  /* 分类页卡片紧凑 */
  .category-tools .tool-card {
    padding: 12px 14px;
  }

  /* 详情页 */
  .detail-main {
    padding: 12px;
  }

  .detail-header h1 {
    font-size: 18px;
  }

  .copyright {
    font-size: 10px;
  }

  .copyright-links a {
    margin: 0 3px;
    font-size: 10px;
  }
}

/* ==================== 面包屑导航（全局） ==================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .separator {
  color: var(--border);
}

.breadcrumb .current {
  color: var(--text);
  font-weight: 500;
}

/* ==================== 全局卡片通用样式 ==================== */
.card-base {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}

.card-base:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

[data-theme="dark"] .card-base:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

/* 广告横幅样式 */
.ad-banner {
  margin: 20px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--card-bg);
  width: 100%;
  max-width: 1152px;
  border: 1px solid var(--border);
}

.ad-banner a {
  display: block;
  width: 100%;
}

.ad-banner img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

@media (max-width: 768px) {
  .ad-banner {
    margin: 12px 0;
    max-width: 100%;
  }
}

/* 左侧浮动快捷链接 */
.float-sidebar {
  position: fixed;
  left: 30px;
  top: 300px;
  width: 140px;
  height: 420px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  z-index: 999;
  overflow: hidden;
}

.float-sidebar-title {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  text-align: center;
  letter-spacing: 0.5px;
}

.float-sidebar-list {
  padding: 4px 0;
}

.float-sidebar-item {
  display: block;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.float-sidebar-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
}

.float-sidebar-dot {
  display: none;
}

.float-sidebar-name {
  font-weight: 500;
}

/* 搜索区域深色模式 - 与页面其他区域保持一致 */
[data-theme="dark"] .search-box {
  background: var(--card-bg);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
[data-theme="dark"] .search-box:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
[data-theme="dark"] .stats-box {
  background: var(--card-bg);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
[data-theme="dark"] .search-input {
  background: transparent;
  color: #e2e8f0;
}
[data-theme="dark"] .search-input::placeholder {
  color: #64748b;
}
[data-theme="dark"] .stats-item {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
}
[data-theme="dark"] .stats-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
[data-theme="dark"] .engine-tab {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
  color: #94a3b8;
}
[data-theme="dark"] .engine-tab:hover {
  background: rgba(255,255,255,0.1);
  color: #a5b4fc;
  border-color: rgba(99,102,241,0.3);
}
[data-theme="dark"] .search-input-wrap {
  border-color: var(--border);
  background: rgba(255,255,255,0.04);
}
[data-theme="dark"] .search-input-wrap:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* 深色模式适配 */
[data-theme="dark"] .float-sidebar {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ==================== 右侧浮动自定义链接 ==================== */
.float-history {
  position: fixed;
  right: 20px;
  top: 300px;
  width: 180px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  z-index: 100;
  max-height: 420px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.float-history::-webkit-scrollbar {
  width: 4px;
}

.float-history::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.float-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.float-history-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.float-history-add {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.float-history-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 11px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  min-width: 0;
  transition: border-color 0.2s;
}

.float-history-input:focus {
  border-color: var(--primary);
}

.float-history-input::placeholder {
  color: #aaa;
}

.float-history-add-btn {
  padding: 7px 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 500;
}

.float-history-add-btn:hover {
  background: var(--primary-dark);
}

.float-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}

.float-history-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 7px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12px;
  position: relative;
}

.float-history-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.float-history-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.float-history-del {
  opacity: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.float-history-item:hover .float-history-del {
  opacity: 1;
}

.float-history-del:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.float-history-empty {
  text-align: center;
  color: #aaa;
  font-size: 12px;
  padding: 20px 0;
}

/* 深色模式适配 */
[data-theme="dark"] .float-history {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* 响应式：移动端隐藏 */
@media (max-width: 1400px) {
  .float-sidebar,
  .float-history {
    display: none;
  }
}
