:root{
  --bg0:#0b1020;
  --bg1:#10192f;
  --bg2:#141b36;
  --panel:rgba(255,255,255,.08);
  --panel-strong:rgba(255,255,255,.12);
  --border:rgba(255,255,255,.15);
  --text:#eef2ff;
  --muted:#a5b4fc;
  --muted2:#94a3b8;
  --accent:#60a5fa;
  --accent2:#a78bfa;
  --shadow:0 20px 50px rgba(0,0,0,.28);
}

*{ box-sizing:border-box; }
html,body{
  margin:0;
  height:100%;
}
body{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","PingFang SC","Helvetica Neue",Arial,sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(96,165,250,.22), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(167,139,250,.16), transparent 35%),
    linear-gradient(135deg,var(--bg0),var(--bg1) 45%,var(--bg2));
  color:var(--text);
  overflow:hidden;
}

.bg-blur{
  position:fixed;
  inset:auto;
  width:460px;
  height:460px;
  border-radius:50%;
  filter:blur(75px);
  opacity:.5;
  pointer-events:none;
  z-index:-1;
}
.bg-blur-1{ top:-120px; left:-120px; background:rgba(96,165,250,.45); }
.bg-blur-2{ right:-140px; bottom:-120px; background:rgba(167,139,250,.35); }

.app-shell{
  display:grid;
  grid-template-columns:290px 1fr;
  gap:16px;
  height:100vh;
  padding:16px;
}

.glass-panel{
  background:var(--panel);
  border:1px solid var(--border);
  backdrop-filter:blur(20px) saturate(150%);
  -webkit-backdrop-filter:blur(20px) saturate(150%);
  box-shadow:var(--shadow);
  border-radius:24px;
}

.sidebar{
  padding:16px;
  overflow:auto;
  min-width:0;
}

.sidebar-header{
  margin-bottom:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.brand-icon{
  width:44px;
  height:44px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg, rgba(96,165,250,.9), rgba(167,139,250,.85));
  color:white;
  font-size:20px;
  font-weight:700;
  box-shadow:0 10px 25px rgba(96,165,250,.28);
}

.brand-title{
  font-size:18px;
  font-weight:700;
  letter-spacing:.2px;
}

.brand-subtitle{
  margin-top:2px;
  color:var(--muted2);
  font-size:12px;
}

.sidebar-section{
  margin-top:8px;
}

.section-title{
  font-size:12px;
  color:var(--muted2);
  letter-spacing:.12em;
  text-transform:uppercase;
  margin-bottom:10px;
}

.category-tree{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.group{
  border-radius:16px;
  overflow:hidden;
}

.group-btn{
  width:100%;
  border:none;
  background:rgba(255,255,255,.03);
  color:var(--text);
  text-align:left;
  padding:12px 14px;
  cursor:pointer;
  border-radius:16px;
  transition:transform .22s ease, background .22s ease, box-shadow .22s ease;
  font-size:14px;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.group-btn:hover{
  transform:translateX(4px);
  background:rgba(255,255,255,.07);
}

.group-btn.active{
  background:linear-gradient(135deg, rgba(96,165,250,.26), rgba(167,139,250,.18));
  box-shadow:0 8px 20px rgba(0,0,0,.14);
}

.group-btn .arrow{
  opacity:.72;
  transition:transform .28s ease;
}

.group-btn.open .arrow{
  transform:rotate(90deg);
}

.children{
  margin-left:12px;
  border-left:1px solid rgba(255,255,255,.12);
  padding-left:10px;
  margin-top:8px;
  max-height:0;
  overflow:hidden;
  transition:max-height .35s cubic-bezier(.22,1,.36,1);
}

.children.open{
  max-height:999px;
}

.main-content{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-width:0;
  overflow:hidden;
}

.topbar{
  padding:14px;
}

.search-form{
  display:flex;
  align-items:center;
  gap:10px;
}

.search-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.08);
  color:var(--text);
  flex:0 0 auto;
}

.search-form input{
  flex:1;
  height:42px;
  border:none;
  outline:none;
  border-radius:14px;
  padding:0 14px;
  font-size:15px;
  background:rgba(255,255,255,.9);
  color:#0f172a;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.4);
}

.search-form input::placeholder{
  color:#64748b;
}

.search-form button{
  height:42px;
  padding:0 18px;
  border:none;
  border-radius:14px;
  font-weight:700;
  color:white;
  cursor:pointer;
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow:0 10px 20px rgba(96,165,250,.22);
  transition:transform .2s ease, opacity .2s ease;
}

.search-form button:hover{
  transform:translateY(-1px);
  opacity:.95;
}

.hero{
  padding:18px 20px;
  margin:0 0 2px 0;
}

.hero-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color:#dbeafe;
  background:rgba(96,165,250,.16);
  border:1px solid rgba(96,165,250,.18);
  border-radius:999px;
  padding:6px 10px;
  margin-bottom:12px;
}

.hero-title{
  margin:0;
  font-size:28px;
  line-height:1.1;
  letter-spacing:-.03em;
}

.hero-desc{
  margin:10px 0 0;
  color:var(--muted2);
  font-size:14px;
  line-height:1.7;
  max-width:760px;
}

.site-grid{
  overflow:auto;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:14px;
  padding-right:4px;
  padding-bottom:6px;
}

.site-card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:22px;
  padding:16px;
  box-shadow:var(--shadow);
  transition:transform .28s cubic-bezier(.22,1,.36,1), background .28s ease, border-color .28s ease;
  animation:fadeUp .42s ease both;
}

.site-card:hover{
  transform:translateY(-4px);
  background:var(--panel-strong);
  border-color:rgba(255,255,255,.22);
}

.site-name{
  margin:0 0 8px;
  font-size:17px;
  font-weight:700;
}

.site-url{
  display:inline-block;
  color:#93c5fd;
  text-decoration:none;
  font-size:13px;
  word-break:break-all;
}

.site-url:hover{
  text-decoration:underline;
}

.site-desc{
  margin:10px 0 0;
  color:#d1d5db;
  font-size:14px;
  line-height:1.6;
}

.tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.tag{
  font-size:12px;
  padding:5px 9px;
  border-radius:999px;
  background:rgba(148,163,184,.16);
  color:#e0f2fe;
  border:1px solid rgba(255,255,255,.08);
}

.empty-state{
  padding:18px;
  border-radius:20px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color:var(--muted2);
}

.fade-in{
  animation:fadeUp .35s ease both;
}

@keyframes fadeUp{
  from{
    opacity:0;
    transform:translateY(10px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

@media (max-width: 960px){
  body{ overflow:auto; }
  .app-shell{
    grid-template-columns:1fr;
    height:auto;
    min-height:100vh;
  }
  .sidebar{
    max-height:320px;
  }
  .main-content{
    overflow:visible;
  }
  .site-grid{
    padding-bottom:24px;
  }
}