:root {
  --bg: #0f172a;
  --surface: rgba(30, 41, 59, 0.88);
  --surface-solid: #1e293b;
  --surface-hover: #334155;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --brand: #40c057;
  --brand-hover: #51cf66;
  --brand-glow: rgba(64, 192, 87, 0.28);
  --accent: #ffd43b;
  --success: #22c55e;
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(64, 192, 87, 0.12), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(56, 189, 248, 0.06), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(64, 192, 87, 0.07), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Mobile Header */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 50;
}

.mobile-header button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
}

.mobile-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #2b8a3e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  margin-left: 12px;
}

.mobile-title {
  margin-left: 10px;
  font-weight: 700;
  font-size: 16px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  z-index: 40;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

@media (min-width: 1024px) {
  .sidebar { transform: translateX(0); }
  .mobile-header { display: none; }
}

.sidebar-brand {
  padding: 28px 24px;
  border-bottom: 1px solid var(--border);
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #2b8a3e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 8px 24px var(--brand-glow);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(64, 192, 87, 0.18), transparent);
  color: var(--brand);
  border-left: 3px solid var(--brand);
}

.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }

.nav-label { flex: 1; font-size: 14px; font-weight: 500; }

.nav-count {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 999px;
}

.nav-item.active .nav-count {
  background: rgba(64, 192, 87, 0.15);
  color: var(--brand);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.admin-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.admin-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 35;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.overlay.show { opacity: 1; visibility: visible; }

/* Main */
.main {
  min-height: 100vh;
  padding: 0 16px 60px;
}

@media (min-width: 1024px) {
  .main { margin-left: 260px; padding: 0 32px 60px; }
}

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

@media (min-width: 1024px) {
  .container { padding-top: 40px; }
}

/* Search */
.search-section {
  position: relative;
  margin-bottom: 32px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 4px 24px var(--brand-glow);
}

.search-icon { color: var(--text-muted); width: 22px; height: 22px; flex-shrink: 0; }

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
}

.search-input::placeholder { color: var(--text-muted); }

.hot-tags-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.hot-tags-label { color: var(--text-muted); }

.hot-tag {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.hot-tag:hover {
  background: rgba(64, 192, 87, 0.12);
  border-color: rgba(64, 192, 87, 0.3);
  color: var(--brand);
}

/* Search Suggestions */
.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
  z-index: 30;
  display: none;
  overflow: hidden;
}

.suggestions.show { display: block; }

.suggestions-header {
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.suggestion-item:last-child { border-bottom: none; }

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

.suggestion-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.suggestion-title { font-size: 14px; font-weight: 500; }
.suggestion-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.suggestion-cat { margin-left: auto; font-size: 12px; color: var(--text-muted); }

/* Hero */
.hero {
  position: relative;
  border-radius: var(--radius);
  padding: 40px 32px;
  margin-bottom: 40px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(64, 192, 87, 0.15), rgba(6, 182, 212, 0.08)),
    var(--surface);
  border: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(64, 192, 87, 0.22), transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(64, 192, 87, 0.12);
  border: 1px solid rgba(64, 192, 87, 0.25);
  border-radius: 999px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.5px;
}

@media (min-width: 768px) {
  .hero-title { font-size: 36px; }
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 560px;
  margin: 0;
}

/* Section */
.section {
  margin-bottom: 40px;
  scroll-margin-top: 80px;
}

.section.hidden-section { display: none; }

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

.section-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.section-count {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

.card-tool {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-tool:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.card-tool:hover .card-title { color: var(--brand); }

.card-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

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

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 5px;
  transition: color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.card-arrow {
  margin-left: auto;
  color: var(--text-muted);
  opacity: 0;
  transition: all 0.2s;
  flex-shrink: 0;
}

.card-tool:hover .card-arrow {
  opacity: 1;
  color: var(--brand);
  transform: translateX(3px);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--text-muted);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.no-results-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.no-results-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.no-results-desc { font-size: 14px; margin: 0; }
