/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #10101c;
  --bg-card: #14142a;
  --bg-card-hover: #1a1a36;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(139, 92, 246, 0.4);
  --text-primary: #f0f0f8;
  --text-secondary: #a0a0c0;
  --text-muted: #606080;
  --accent: #8b5cf6;
  --accent-2: #06b6d4;
  --accent-3: #f59e0b;
  --gradient: linear-gradient(135deg, #8b5cf6, #06b6d4);
  --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
  --gradient-green: linear-gradient(135deg, #22c55e, #06b6d4);
  --glow: 0 0 40px rgba(139, 92, 246, 0.15);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 64px;
}

[data-theme="light"] {
  --bg-primary: #f5f5fa;
  --bg-secondary: #eeeef5;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5ff;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(139, 92, 246, 0.4);
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #9090a0;
  --glow: 0 0 40px rgba(139, 92, 246, 0.08);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 18, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
[data-theme="light"] .navbar {
  background: rgba(245, 245, 250, 0.88);
}
.nav-container {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-height);
  display: flex; align-items: center; gap: 24px;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
  font-weight: 800; font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.logo-icon { color: var(--accent); font-size: 1.2rem; }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-link {
  padding: 6px 14px; border-radius: 8px;
  text-decoration: none; font-size: 0.88rem; font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: rgba(139, 92, 246, 0.1);
}
.nav-actions {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

/* ===== Search Box ===== */
.search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  transition: var(--transition);
  min-width: 220px;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}
.search-icon { font-size: 0.85rem; opacity: 0.6; }
.search-box input {
  border: none; background: none; outline: none;
  font-size: 0.88rem; color: var(--text-primary);
  width: 100%; font-family: inherit;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-shortcut {
  padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  font-size: 0.72rem; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.theme-toggle {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px;
  cursor: pointer; font-size: 1rem;
  transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); }

/* ===== Main Content ===== */
.main-content {
  max-width: 1200px; margin: 0 auto;
  padding: calc(var(--nav-height) + 32px) 24px 60px;
}

/* ===== Hero ===== */
.hero { margin-bottom: 48px; }
.hero-content {
  display: flex; align-items: center; gap: 48px;
  padding: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  position: relative; overflow: hidden;
}
.hero-content::before {
  content: '';
  position: absolute; inset: 0;
  background: 
    radial-gradient(ellipse at top left, rgba(139,92,246,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(6,182,212,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.hero-text { position: relative; flex: 1; }
.hero-badge {
  display: inline-block;
  padding: 4px 14px; border-radius: 20px;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.25);
  font-size: 0.78rem; color: var(--accent);
  font-weight: 600; margin-bottom: 20px;
  animation: badge-pulse 3s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.hero-title {
  font-size: 2.2rem; font-weight: 800;
  letter-spacing: -0.04em; margin-bottom: 12px;
  line-height: 1.2;
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.1rem; color: var(--text-secondary);
  margin-bottom: 10px; font-weight: 500;
}
.hero-desc {
  font-size: 0.88rem; color: var(--text-muted);
  margin-bottom: 28px; line-height: 1.7;
}
.hero-stats {
  display: flex; align-items: center; gap: 24px;
}
.hero-stat {
  display: flex; align-items: baseline; gap: 6px;
}
.hero-stat-num {
  font-size: 1.6rem; font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-stat-label {
  font-size: 0.82rem; color: var(--text-muted);
}
.hero-stat-divider {
  width: 1px; height: 32px;
  background: var(--border);
}

/* Hero Visual Grid */
.hero-visual { flex-shrink: 0; }
.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.hero-float-card {
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}
.hero-float-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.card-1 { animation: float 6s ease-in-out infinite; }
.card-2 { animation: float 6s ease-in-out 1s infinite; }
.card-3 { animation: float 6s ease-in-out 2s infinite; }
.card-4 { animation: float 6s ease-in-out 0.5s infinite; }
.card-5 { animation: float 6s ease-in-out 1.5s infinite; }
.card-6 { animation: float 6s ease-in-out 2.5s infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ===== Filter Bar ===== */
.filter-section { margin-bottom: 36px; }
.filter-bar {
  display: flex; gap: 6px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: transparent; border: none;
  font-size: 0.82rem; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.filter-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}
.filter-btn.active {
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
}
.filter-icon { font-size: 0.9rem; }

/* ===== Tools Grid ===== */
.tools-section { margin-bottom: 64px; }
.section-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px;
}
.section-title {
  font-size: 1.2rem; font-weight: 700;
  white-space: nowrap;
}
.tool-count-label {
  padding: 3px 10px; border-radius: 20px;
  background: rgba(139,92,246,0.1);
  font-size: 0.75rem; color: var(--accent);
  font-weight: 600;
}
.section-line {
  flex: 1; height: 1px;
  background: var(--border);
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ===== Tool Card ===== */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative; overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column;
}
.tool-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--glow), var(--shadow-card);
}
.tool-card-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(139,92,246,0.06) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.tool-card:hover .tool-card-glow { opacity: 1; }
.tool-card-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.tool-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.15);
}
.tool-card-info { flex: 1; min-width: 0; }
.tool-name {
  font-size: 0.95rem; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tool-origin {
  font-size: 0.72rem; color: var(--text-muted);
}
.tool-desc {
  font-size: 0.82rem; color: var(--text-secondary);
  line-height: 1.6; margin-bottom: 14px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.tool-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.mini-tag {
  padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  font-size: 0.7rem; color: var(--text-muted);
}
.free-badge {
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 700;
  white-space: nowrap;
}
.free-badge.full {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.free-badge.partial {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.tool-arrow {
  font-size: 0.8rem; color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.tool-card:hover .tool-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ===== No Results ===== */
.no-results {
  text-align: center;
  padding: 60px 20px;
}
.no-results-icon { font-size: 2.5rem; display: block; margin-bottom: 16px; }
.no-results-text {
  font-size: 1.1rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: 8px;
}
.no-results-hint {
  font-size: 0.88rem; color: var(--text-muted);
}

/* ===== Featured Section ===== */
.featured-section { margin-bottom: 64px; }
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.featured-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
}
.featured-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--glow), var(--shadow-card);
}
.featured-card-icon {
  font-size: 2rem; margin-bottom: 14px;
}
.featured-card-title {
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: 10px; color: var(--text-primary);
}
.featured-card-desc {
  font-size: 0.85rem; color: var(--text-secondary);
  line-height: 1.6; margin-bottom: 18px;
}
.featured-card-meta {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.featured-card-tags {
  font-size: 0.78rem; color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 40px 24px 24px;
}
.footer-content {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 32px;
}
.footer-logo {
  font-size: 1.1rem; font-weight: 800;
  color: var(--text-primary); display: block; margin-bottom: 8px;
}
.footer-desc { font-size: 0.85rem; color: var(--text-muted); }
.footer-right { display: flex; gap: 20px; }
.footer-link {
  font-size: 0.9rem; color: var(--text-secondary);
  text-decoration: none; transition: var(--transition);
}
.footer-link:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding-top: 20px; border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem; color: var(--text-muted);
}
.footer-domain {
  color: var(--accent); text-decoration: none;
}
.footer-domain:hover { text-decoration: underline; }

/* ===== About Page ===== */
.about-layout {
  max-width: 800px; margin: 0 auto;
  padding: calc(var(--nav-height) + 32px) 24px 60px;
}
.about-hero {
  text-align: center;
  padding: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  margin-bottom: 48px;
  position: relative; overflow: hidden;
}
.about-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(139,92,246,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.about-hero-title {
  font-size: 2rem; font-weight: 800; margin-bottom: 12px;
}
.about-hero-desc {
  font-size: 1rem; color: var(--text-secondary);
  line-height: 1.8;
}
.about-section { margin-bottom: 48px; }
.about-section-title {
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.about-section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.about-content {
  font-size: 0.92rem; color: var(--text-secondary);
  line-height: 1.8;
}
.about-content a {
  color: var(--accent); text-decoration: none;
}
.about-content a:hover { text-decoration: underline; }

/* ===== Tags Page ===== */
.tags-layout {
  max-width: 900px; margin: 0 auto;
  padding: calc(var(--nav-height) + 32px) 24px 60px;
}
.page-title { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.page-desc { color: var(--text-muted); margin-bottom: 48px; }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 60px; }
.tag-bubble {
  padding: 8px 18px; border-radius: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  transition: var(--transition); text-decoration: none;
  color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 6px;
}
.tag-bubble:hover, .tag-bubble.active {
  background: rgba(139,92,246,0.1);
  border-color: var(--accent); color: var(--accent);
}
.tag-count {
  font-size: 0.75rem; color: var(--text-muted);
  background: var(--bg-secondary); padding: 1px 6px; border-radius: 10px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-content { flex-direction: column; padding: 32px 24px; }
  .hero-title { font-size: 1.7rem; }
  .hero-visual { display: none; }
  .featured-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .search-box { min-width: 0; flex: 1; }
  .search-shortcut { display: none; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
  .hero-stat-divider { display: none; }
  .filter-bar { gap: 4px; }
  .filter-btn { padding: 6px 10px; font-size: 0.78rem; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
