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

:root {
  --primary: #4F46E5;
  --primary-light: #6366F1;
  --primary-dark: #4338CA;
  --bg: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-card: #FFFFFF;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(79,70,229,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

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

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

/* Header */
.header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: rgba(79,70,229,0.08);
}

.admin-link {
  background: var(--primary);
  color: white !important;
}

.admin-link:hover {
  background: var(--primary-dark) !important;
}

/* Hero */
.hero {
  padding: 20px 0 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(79,70,229,0.06) 0%, transparent 100%);
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.search-box {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.search-box input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 16px;
  transition: var(--transition);
  background: var(--bg);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.1);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

/* Categories */
.categories {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 64px;
  z-index: 90;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  padding: 10px 18px;
  border-radius: 50px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.category-tab.active {
  background: var(--primary);
  color: white;
}

.category-count {
  font-size: 12px;
  opacity: 0.7;
}

/* Tools Section */
.tools-section {
  padding: 60px 0;
}

.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

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

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

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

.tool-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(99,102,241,0.15));
  color: var(--primary);
}

.tool-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.tool-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.tool-usage {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.7;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 16px;
}

/* Search Modal */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  z-index: 1000;
}

.search-modal.active {
  display: flex;
}

.search-modal-content {
  background: var(--bg);
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.search-modal-content input {
  width: 100%;
  padding: 20px 60px 20px 24px;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  background: transparent;
}

.search-modal-content input:focus {
  outline: none;
}

.close-btn {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
}

.search-results {
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}

.search-result-item:hover {
  background: var(--bg-secondary);
}

.search-result-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(99,102,241,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
}

.search-result-info h4 {
  font-size: 14px;
  font-weight: 600;
}

.search-result-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Footer */
.footer {
  padding: 0px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer p {
  margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
  }
  
  .hero p {
    font-size: 16px;
  }
  
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .tool-card {
    padding: 16px;
  }
  
  .tool-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}

/* ---------- 工具弹框（弹框显示模式） ----------
   面板内只放 iframe，直接展示工具页自带的工具面板头部与内容 */
.tool-modal { display: none; position: fixed; inset: 0; z-index: 9999; }
.tool-modal.active { display: block; }
.tool-modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); }
.tool-modal-panel {
  position: relative; margin: 3vh auto; width: min(1040px, 96vw); height: 94vh;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.tool-modal-frame { width: 100%; height: 100%; border: none; background: #fff; }

@media (max-width: 640px) {
  .tool-modal-panel { width: 100vw; height: 100vh; margin: 0; border-radius: 0; }
}
