* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --surface: #f8f8f8;
  --surface-hover: #f0f0f0;
  --text: #111111;
  --text-light: #555555;
  --text-muted: #888888;
  --border: #e5e5e5;
  --border-dark: #cccccc;
  --primary: #000000;
  --primary-hover: #1a1a1a;
  --accent: #0066cc;
  --accent-light: #e6f0ff;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

body.dark {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1f1f1f;
  --text: #ededed;
  --text-light: #999999;
  --text-muted: #666666;
  --border: #2a2a2a;
  --border-dark: #3a3a3a;
  --accent: #3b82f6;
  --accent-light: #1e3a5f;
  --primary: #ffffff;
  --primary-hover: #e0e0e0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  transition: background 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Logo Styles */
.logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.logo-secu {
  color: var(--accent);
}

.logo-lian {
  color: var(--text);
}

.logo span:last-child {
  color: var(--accent);
}

/* Header */
header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

/* Desktop Navigation */
.desktop-nav {
  display: flex;
  gap: 28px;
}

.desktop-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.desktop-nav a:hover {
  opacity: 0.6;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}

.mobile-menu-btn span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Panel */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 99;
  transition: right 0.3s ease;
  padding-top: 80px;
  box-shadow: var(--shadow-lg);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-inner {
  padding: 20px;
}

.mobile-user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.mobile-full {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  padding: 8px 0;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--accent);
  border: none;
  border-radius: 100px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

body.dark .theme-toggle {
  background: var(--accent);
  color: #ffffff;
}

/* Button Styles */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  display: inline-block;
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.btn-primary {
  background: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

.btn-primary:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

body.dark .btn-primary {
  background: var(--primary);
  color: var(--bg);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-large {
  padding: 14px 32px;
  font-size: 1rem;
}

.desktop-only {
  display: inline-block;
}

.or {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Hero */
.hero {
  padding: 60px 0 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tags span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--text-light);
}

h1 {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 20px;
}

h1 .highlight {
  color: var(--accent);
}

.hero-text {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 32px;
  max-width: 480px;
}

.stats-row {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  display: block;
  line-height: 1.2;
}

.stat-name {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Terminal */
.hero-visual {
  position: relative;
}

.terminal {
  background: #0a0a0a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #2a2a2a;
}

.terminal-header {
  background: #1a1a1a;
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  margin-left: 12px;
  font-size: 0.75rem;
  color: #888;
  font-family: monospace;
}

.terminal-body {
  padding: 20px;
  background: #0a0a0a;
}

.terminal-body p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #00ff41;
  margin-bottom: 8px;
}

.prompt {
  color: #00ff41;
  margin-right: 12px;
}

/* Filter Bar */
.filter-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  margin-bottom: 48px;
}

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}

.filter-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.filter-btn.active {
  background: var(--primary);
  color: var(--bg);
}

body.dark .filter-btn.active {
  background: var(--primary);
  color: var(--bg);
}

/* Sort Dropdown */
.sort-wrap {
  position: relative;
}

.sort-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 180px;
  margin-top: 8px;
  display: none;
  z-index: 50;
  overflow: hidden;
}

.sort-dropdown a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  transition: background 0.2s;
}

.sort-dropdown a:hover {
  background: var(--surface-hover);
}

.sort-wrap.active .sort-dropdown {
  display: block;
}

/* Section Head */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
}

.section-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.section-head h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.view-all {
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  border-bottom: 1px dashed var(--border);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Product Card */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--text);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.category-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: monospace;
}

.category-tools { background: #1a2e1a; color: #4caf50; }
.category-commands { background: #1a1a2e; color: #5a5ae6; }
.category-codes { background: #2e1a2e; color: #e65a5a; }
.category-prompts { background: #2e2e1a; color: #ffc107; }

body.dark .category-tools,
body.dark .category-commands,
body.dark .category-codes,
body.dark .category-prompts {
  background: rgba(255,255,255,0.15);
}

.dev-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.product-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.product-desc {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.metrics {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.metric {
  text-align: center;
  flex: 1;
}

.metric-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 0.85rem;
  font-weight: 700;
}

.success-rate { color: var(--success); }
.difficulty-easy { color: var(--success); }
.difficulty-medium { color: var(--warning); }
.difficulty-hard { color: var(--error); }

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.facepile {
  display: flex;
  align-items: center;
}

.facepile img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  margin-left: -6px;
}

.facepile img:first-child {
  margin-left: 0;
}

.facepile-count {
  font-size: 0.7rem;
  margin-left: 6px;
  color: var(--text-light);
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-actions button {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.card-actions button:hover {
  color: var(--text);
  background: var(--border);
}

.buy-btn {
  background: var(--primary) !important;
  color: var(--bg) !important;
  padding: 4px 12px !important;
  border-radius: 100px !important;
  font-size: 0.7rem !important;
  font-weight: 600;
}

.buy-btn:hover {
  opacity: 0.9;
  transform: scale(0.98);
}

.download-btn {
  background: var(--success) !important;
  color: white !important;
  padding: 4px 12px !important;
  border-radius: 100px !important;
  font-size: 0.7rem !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Skeleton */
.skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  height: 320px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.03), transparent);
  animation: shimmer 1.5s infinite;
}

body.dark .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.browse-more {
  text-align: center;
  margin-top: 48px;
}

/* Footer */
footer {
  margin-top: 80px;
  padding: 48px 0 24px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.footer-logo .logo-secu {
  color: var(--accent);
}

.footer-logo .logo-lian {
  color: var(--text);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 16px;
  max-width: 250px;
}

.social {
  display: flex;
  gap: 12px;
}

.social a {
  color: var(--text-light);
  font-size: 1.1rem;
  transition: color 0.2s;
}

.social a:hover {
  color: var(--text);
}

.footer-grid h4 {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-grid a {
  display: block;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.8rem;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.footer-grid a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
  
  h1 {
    font-size: 2.4rem;
  }
  
  .filter-left {
    flex-wrap: wrap;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .desktop-only {
    display: none;
  }
  
  .mobile-signin-btn {
    display: inline-block !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-row {
    gap: 24px;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-left {
    justify-content: space-between;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}