:root {
  --bg-0: #07070c;
  --bg-1: #0c0c14;
  --bg-2: #12121c;
  --bg-3: #1a1a26;
  --surface: rgba(20, 20, 32, 0.62);
  --surface-2: rgba(28, 28, 42, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text: #e8e8f0;
  --text-dim: #9a9aab;
  --text-mute: #5f5f70;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --purple: #a855f7;
  --pink: #ec4899;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --orange: #f97316;
  --accent: var(--cyan);
  --accent-2: var(--purple);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --glow-cyan: 0 0 24px rgba(34, 211, 238, 0.35);
  --glow-purple: 0 0 24px rgba(168, 85, 247, 0.35);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur: 220ms;
  --dur-slow: 320ms;
}

body[data-perf="low"] * {
  animation-duration: 0.001ms !important;
  transition-duration: 100ms !important;
}
body[data-perf="low"] .bg-glow,
body[data-perf="low"] .floater,
body[data-perf="low"] .bg-particles {
  display: none !important;
}
body[data-perf="low"] .snippet-card { transform: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-0);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 60px;
}

code, pre, .mono {
  font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
  font-variant-ligatures: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}
.bg-grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(700px) rotateX(58deg) translateY(-12%);
  transform-origin: center top;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 10%, transparent 75%);
  opacity: 0.8;
}
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.bg-glow-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.5), transparent 70%);
  top: -100px; left: -100px;
  animation: drift1 24s ease-in-out infinite alternate;
}
.bg-glow-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.4), transparent 70%);
  bottom: -150px; right: -150px;
  animation: drift2 30s ease-in-out infinite alternate;
}
@keyframes drift1 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(80px, 60px, 0) scale(1.15); } }
@keyframes drift2 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-100px, -40px, 0) scale(1.1); } }
.bg-particles { position: absolute; inset: 0; }
.particle {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.5;
  box-shadow: 0 0 6px currentColor;
  animation: float linear infinite;
}
.particle:nth-child(3n) { background: var(--purple); }
.particle:nth-child(5n) { background: var(--blue); }
@keyframes float {
  0% { transform: translate3d(0, 100vh, 0); opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.7; }
  100% { transform: translate3d(0, -10vh, 0); opacity: 0; }
}

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  z-index: 100;
  background: rgba(10, 10, 16, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
  box-shadow: var(--glow-cyan);
}
.logo-mark svg { width: 18px; height: 18px; }
.logo-text em {
  font-style: normal;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-link.is-active { color: var(--cyan); background: rgba(34, 211, 238, 0.08); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-icon-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--dur) var(--ease);
}
.nav-icon-btn:hover { color: var(--text); border-color: var(--border-hi); background: rgba(255, 255, 255, 0.05); }
.nav-icon-btn svg { width: 16px; height: 16px; }
.nav-burger { display: none; flex-direction: column; gap: 4px; padding: 0; }
.nav-burger span {
  display: block;
  width: 16px; height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav-burger.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: 60px; right: 0;
  width: min(320px, 85vw);
  background: rgba(14, 14, 22, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 0 var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateX(105%);
  transition: transform var(--dur-slow) var(--ease-out);
  z-index: 99;
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-link {
  padding: 14px 16px;
  border-radius: var(--r);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 15px;
  transition: all var(--dur) var(--ease);
}
.mobile-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.mobile-create { margin-top: 12px; width: 100%; }
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
  z-index: 98;
}
.mobile-overlay.is-open { opacity: 1; pointer-events: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 42px;
}
.btn svg { width: 16px; height: 16px; }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.4);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hi);
  transform: translateY(-2px);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); transform: translateY(-2px); }
.btn-sm { padding: 7px 14px; font-size: 13px; min-height: 34px; }
.btn-lg { padding: 14px 26px; font-size: 15px; min-height: 48px; }

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  animation: ripple 0.6s ease-out;
}
@keyframes ripple { to { transform: scale(2.5); opacity: 0; } }

.view { display: none; }
.view.is-active { display: block; animation: viewIn 0.4s var(--ease-out); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#app {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.hero { padding: 40px 0 60px; position: relative; }
.hero-content { max-width: 720px; margin: 0 auto; text-align: center; position: relative; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 24px;
}
.pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.hero-title {
  font-size: clamp(32px, 7vw, 62px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 60%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: clamp(14px, 2.2vw, 17px);
  color: var(--text-dim);
  max-width: 540px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-floaters { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.floater {
  position: absolute;
  padding: 10px 14px;
  border-radius: var(--r);
  background: rgba(20, 20, 32, 0.7);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-family: 'SF Mono', monospace;
  box-shadow: var(--shadow);
  animation: floaty 6s ease-in-out infinite;
}
.floater-1 { top: 10%; left: 5%; animation-delay: -2s; }
.floater-2 { bottom: 15%; right: 5%; animation-delay: -4s; }
@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-3deg); }
  50% { transform: translate3d(0, -12px, 0) rotate(-1deg); }
}
.floater-head { display: flex; gap: 4px; margin-bottom: 6px; }
.floater-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.floater-code { font-size: 11px; line-height: 1.5; }
.tok-kw { color: var(--purple); }
.tok-fn { color: var(--cyan); }
.tok-str { color: var(--green); }
.tok-cm { color: var(--text-mute); }

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 60px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
}
.stat { text-align: center; }
.stat-num {
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}
.stat-label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  font-weight: 600;
}

.section { padding: 40px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title { font-size: clamp(20px, 3vw, 26px); font-weight: 700; letter-spacing: -0.02em; }
.section-sub { font-size: 13.5px; color: var(--text-dim); margin-top: 4px; }
.link-arrow { color: var(--cyan); font-size: 13.5px; font-weight: 600; transition: transform var(--dur) var(--ease); }
.link-arrow:hover { transform: translateX(3px); }

.page-head { padding: 20px 0 32px; }
.page-title {
  font-size: clamp(26px, 4.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.page-sub { color: var(--text-dim); font-size: 14.5px; }

.snippet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.snippet-card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  transform-style: preserve-3d;
  overflow: hidden;
  contain: layout style paint;
}
.snippet-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(34, 211, 238, 0.5), transparent 45%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}
.snippet-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
}
.snippet-card:hover::before { opacity: 1; }
.snippet-card:active { transform: scale(0.985); }
.snippet-card.is-tapped {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.lang-badge[data-lang="javascript"] { background: rgba(234, 179, 8, 0.15); color: #fde047; }
.lang-badge[data-lang="html"] { background: rgba(249, 115, 22, 0.15); color: #fdba74; }
.lang-badge[data-lang="css"] { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.lang-badge[data-lang="python"] { background: rgba(34, 211, 238, 0.15); color: #67e8f9; }
.lang-badge[data-lang="php"] { background: rgba(168, 85, 247, 0.15); color: #c4b5fd; }
.lang-badge[data-lang="json"] { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.lang-badge[data-lang="bash"] { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.lang-badge[data-lang="other"] { background: rgba(236, 72, 153, 0.15); color: #f9a8d4; }
.fav-btn {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 6px;
  color: var(--text-mute);
  transition: all var(--dur) var(--ease);
  background: transparent;
  border: none;
  flex-shrink: 0;
}
.fav-btn:hover { color: var(--yellow); background: rgba(234, 179, 8, 0.1); }
.fav-btn.is-fav { color: var(--yellow); }
.fav-btn svg { width: 15px; height: 15px; }
.fav-btn.is-fav svg { fill: currentColor; }
.card-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 39px;
}
.card-code {
  position: relative;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  overflow: hidden;
  max-height: 96px;
}
.card-code pre {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-dim);
  white-space: pre;
  overflow: hidden;
}
.card-code::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  pointer-events: none;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.card-meta { font-size: 11px; color: var(--text-mute); display: flex; gap: 8px; align-items: center; }
.card-actions { display: flex; gap: 6px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  transition: all var(--dur) var(--ease);
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn.copied { color: var(--green); border-color: rgba(34, 197, 94, 0.4); }

.card-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.card-reveal.is-visible { opacity: 1; transform: translateY(0); }

.toolbar { margin-bottom: 16px; }
.search-inline {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search-inline:focus-within {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.search-inline svg { width: 16px; height: 16px; color: var(--text-mute); flex-shrink: 0; }
.search-inline input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 10px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  min-width: 0;
}
.search-inline input::placeholder { color: var(--text-mute); }
.clear-btn {
  color: var(--text-mute);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
  transition: all var(--dur) var(--ease);
}
.clear-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 20px;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--border-hi); }
.chip.is-active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(168, 85, 247, 0.2));
  border-color: rgba(34, 211, 238, 0.5);
  color: var(--text);
}
.chip:active { transform: scale(0.95); }

.state-block { padding: 60px 20px; text-align: center; color: var(--text-dim); }
.state-block .state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.6; }
.state-block h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.state-block p { font-size: 13.5px; max-width: 320px; margin: 0 auto 16px; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.cat-card {
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-align: center;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: var(--glow-cyan);
}
.cat-card:active { transform: scale(0.98); }
.cat-icon { font-size: 28px; margin-bottom: 8px; }
.cat-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.cat-count { font-size: 12px; color: var(--text-mute); }

.about-card {
  max-width: 720px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.about-card h2 { font-size: 20px; margin-bottom: 14px; letter-spacing: -0.02em; }
.about-card h3 { font-size: 15px; margin: 20px 0 10px; color: var(--cyan); }
.about-card p { color: var(--text-dim); margin-bottom: 12px; line-height: 1.7; }
.about-card ul { list-style: none; padding-left: 0; }
.about-card li { padding: 6px 0; color: var(--text-dim); font-size: 14px; }
.about-card code {
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

.view-detail { padding: 8px 0; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 20px;
  transition: all var(--dur) var(--ease);
}
.back-btn:hover { color: var(--text); border-color: var(--border-hi); transform: translateX(-2px); }
.back-btn svg { width: 14px; height: 14px; }

.detail-head { margin-bottom: 20px; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.detail-title {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.2;
}
.detail-desc { color: var(--text-dim); font-size: 14.5px; line-height: 1.6; margin-bottom: 14px; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.code-block {
  background: #06060a;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  color: var(--text-mute);
}
.code-head .file-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'SF Mono', monospace;
}
.code-head .dots { display: flex; gap: 5px; }
.code-head .dots span { width: 10px; height: 10px; border-radius: 50%; }
.code-body {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 0;
  max-height: 70vh;
}
.code-body pre { margin: 0; font-size: 12.5px; line-height: 1.65; display: table; min-width: 100%; }
.code-line { display: flex; padding: 0 14px; white-space: pre; }
.code-line .ln {
  color: var(--text-mute);
  user-select: none;
  min-width: 28px;
  padding-right: 14px;
  text-align: right;
  flex-shrink: 0;
  opacity: 0.5;
}
.code-line .lc { color: var(--text); font-family: 'SF Mono', monospace; }

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 8, 0.75);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
  padding: 80px 16px 16px;
}
.search-overlay.is-open { opacity: 1; pointer-events: auto; }
.search-panel {
  max-width: 640px;
  margin: 0 auto;
  background: rgba(18, 18, 26, 0.98);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-8px);
  transition: transform var(--dur) var(--ease-out);
}
.search-overlay.is-open .search-panel { transform: translateY(0); }
.search-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.search-panel-head svg { width: 18px; height: 18px; color: var(--text-mute); flex-shrink: 0; }
.search-panel-head input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  min-width: 0;
}
.kbd-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-mute);
  font-size: 11px;
  font-weight: 600;
  font-family: 'SF Mono', monospace;
}
.kbd-btn:hover { color: var(--text); border-color: var(--border-hi); }
.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.search-result:hover,
.search-result.is-focused { background: rgba(34, 211, 238, 0.08); }
.search-result .sr-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.search-result .sr-meta { font-size: 12px; color: var(--text-mute); }
.search-hint {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-mute);
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 8, 0.75);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  background: rgba(18, 18, 26, 0.98);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--dur-slow) var(--ease-out);
  overflow: hidden;
}
.modal.is-open .modal-panel { transform: translateY(0) scale(1); }
.modal-panel-sm { max-width: 400px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.modal-close {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-mute);
  font-size: 16px;
  transition: all var(--dur) var(--ease);
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field .req { color: var(--red); }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  font-family: inherit;
}
.field textarea {
  font-family: 'SF Mono', monospace;
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  min-height: 140px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.toast-stack {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(360px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r);
  background: rgba(18, 18, 26, 0.98);
  border: 1px solid var(--border-hi);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  animation: toastIn 0.3s var(--ease-out);
  pointer-events: auto;
}
.toast.is-out { animation: toastOut 0.25s var(--ease) forwards; }
.toast-icon {
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 12px;
}
.toast[data-type="success"] .toast-icon { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.toast[data-type="error"] .toast-icon { background: rgba(239, 68, 68, 0.2); color: var(--red); }
.toast[data-type="info"] .toast-icon { background: rgba(34, 211, 238, 0.2); color: var(--cyan); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ADMIN */
.admin-only[hidden] { display: none !important; }
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 211, 238, 0.2));
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all var(--dur) var(--ease);
}
.admin-badge:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 211, 238, 0.3));
  transform: translateY(-1px);
}
.admin-panel {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: var(--r);
  background: rgba(18, 18, 26, 0.95);
  border: 1px solid var(--border-hi);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}
.admin-panel .btn {
  justify-content: flex-start;
  font-size: 12px;
  padding: 8px 12px;
  min-height: 36px;
}

@media (max-width: 1024px) { .floater { display: none; } }
@media (max-width: 768px) {
  body { padding-top: 56px; }
  #app { padding: 20px 16px 60px; }
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-create { display: none; }
  .hero { padding: 24px 0 40px; }
  .hero-title { font-size: 34px; }
  .hero-sub { font-size: 14.5px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); padding: 20px; gap: 16px; margin-top: 40px; }
  .snippet-grid { grid-template-columns: 1fr; gap: 12px; }
  .snippet-card { padding: 16px; transform: none !important; }
  .snippet-card::before { display: none; }
  .code-body pre { font-size: 12px; }
  .code-body { max-height: 60vh; }
  .field-row { grid-template-columns: 1fr; }
  .modal-panel { max-height: 95vh; }
  .admin-panel { bottom: 12px; left: 12px; right: 12px; flex-direction: row; }
  .admin-panel .btn { flex: 1; justify-content: center; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 30px; }
  .page-title { font-size: 24px; }
  .stat-num { font-size: 22px; }
  .btn-lg { padding: 12px 20px; font-size: 14px; }
}
@media (max-width: 375px) {
  #app { padding: 16px 12px 50px; }
  .hero-title { font-size: 26px; }
}
@media (max-width: 320px) {
  .hide-xs { display: none; }
  .logo-text { font-size: 13px; }
}
@media (max-width: 768px) {
  body { overflow-x: hidden; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}