* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
  min-height: 100vh;
  color: #2c3e50;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 48px 0 32px;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
  position: relative;
}
.admin-link {
  position: absolute;
  top: 16px;
  right: 24px;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  transition: background 0.2s;
}
.admin-link:hover { background: rgba(255, 255, 255, 0.25); }
.badge-db, .badge-file {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: #667eea;
  font-weight: 600;
}
.badge-file {
  color: #28a745;
}
.site-header h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-header h1 i { font-size: 30px; }
.subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  margin-bottom: 24px;
}
.subtitle strong { color: #fff; font-weight: 700; }

.search-bar {
  max-width: 480px;
}
.search-bar input {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.95);
  color: #2c3e50;
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}
.search-bar input:focus {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

main { padding: 40px 0 60px; }

.category-block {
  margin-bottom: 40px;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.cat-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f2f5;
}
.cat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}
.cat-title h2 { font-size: 20px; font-weight: 600; }
.cat-count {
  margin-left: auto;
  background: #f0f2f5;
  color: #667eea;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

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

.tool-card {
  display: flex;
  align-items: center;
  padding: 20px;
  background: #fafbfc;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #667eea, #764ba2);
  opacity: 0;
  transition: opacity 0.2s;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
  background: #fff;
  border-color: #e8eaf6;
}
.tool-card:hover::before { opacity: 1; }

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  margin-right: 14px;
}
.tool-info { flex: 1; min-width: 0; }
.tool-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #2c3e50;
}
.tool-info p {
  font-size: 13px;
  color: #7f8c9a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-arrow {
  color: #b0bac5;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: 8px;
  transition: transform 0.2s;
}
.tool-card:hover .tool-arrow {
  transform: translateX(3px);
  color: #667eea;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  background: #fff;
  border-radius: 16px;
  color: #7f8c9a;
}
.empty-state i {
  font-size: 64px;
  color: #cbd5e0;
  margin-bottom: 16px;
}
.empty-state h2 { font-size: 22px; margin-bottom: 8px; color: #4a5568; }
.empty-state code {
  background: #f0f2f5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
}

.site-footer {
  text-align: center;
  padding: 24px;
  color: #7f8c9a;
  font-size: 13px;
}
.site-footer code {
  background: #e8eaf6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #667eea;
}

.category-block.hidden { display: none; }
.tool-card.hidden { display: none; }

@media (max-width: 600px) {
  .site-header { padding: 32px 0 24px; }
  .site-header h1 { font-size: 24px; }
  .category-block { padding: 20px; }
  .tool-grid { grid-template-columns: 1fr; }
}
