*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;-webkit-text-size-adjust:100%}
body,button,input{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,"PingFang SC","Microsoft YaHei","Noto Sans SC",sans-serif}

:root{
  --bg:#f0f2f6;
  --surface:#ffffff;
  --surface-alt:#f7f9fd;
  --text:#131a2c;
  --text-soft:#3b4256;
  --muted:#6b7589;
  --subtle:#8d97ab;
  --line:#dee4ef;
  --line-soft:#e9eef5;
  --accent:#2563eb;
  --accent-soft:rgba(37,99,235,0.08);
  --accent-glow:rgba(37,99,235,0.05);
  --radius:10px;
  --radius-sm:6px;
  --shadow-sm:0 1px 2px rgba(0,0,0,0.04);
  --shadow:0 4px 16px rgba(0,0,0,0.06),0 1px 3px rgba(0,0,0,0.04);
  --motion:200ms cubic-bezier(0.16,1,0.3,1);
  --max-w:1200px;
}
html.is-dark{
  --bg:#0b1120;
  --surface:#151e31;
  --surface-alt:#1a2439;
  --text:#eaf0f8;
  --text-soft:#bcc6d6;
  --muted:#8a95aa;
  --subtle:#6a758b;
  --line:#273152;
  --line-soft:#1f2846;
  --accent:#6095fa;
  --accent-soft:rgba(96,149,250,0.10);
  --accent-glow:rgba(96,149,250,0.06);
  --shadow-sm:0 1px 2px rgba(0,0,0,0.16);
  --shadow:0 4px 16px rgba(0,0,0,0.20),0 1px 3px rgba(0,0,0,0.12);
}
html.is-dark img.fh-logo{filter:brightness(0.85) saturate(1.1)}

body{
  background:var(--bg);
  color:var(--text);
  line-height:1.6;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
.fh-inner{width:100%;max-width:var(--max-w);margin:0 auto;padding:0 20px}

/* Hero / brand */
.fh-hero{
  background:var(--surface);
  border-bottom:1px solid var(--line-soft);
  padding:22px 0 20px;
}
.fh-hero-inner{display:flex;align-items:center;gap:14px}
.fh-hero-text{min-width:0}
.fh-hero-text h1{
  font-size:19px;
  font-weight:750;
  line-height:1.3;
  letter-spacing:-0.01em;
  color:var(--text);
}
.fh-hero-text p{
  font-size:13px;
  color:var(--muted);
  margin-top:3px;
}

/* Toolbar */
.fh-toolbar{
  background:var(--surface);
  border-bottom:1px solid var(--line-soft);
  padding:14px 0;
  position:sticky;
  top:0;
  z-index:100;
}
.fh-toolbar-row{
  display:flex;
  align-items:center;
  gap:12px;
}
.fh-logo{
  width:36px;height:36px;
  border-radius:var(--radius-sm);
  object-fit:contain;
  background:var(--surface-alt);
  padding:5px;
  flex:0 0 36px;
}
.fh-search-wrap{
  flex:1;
  display:flex;
  align-items:center;
  gap:8px;
  background:var(--surface-alt);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:0 12px;
  height:42px;
  transition:border-color var(--motion),box-shadow var(--motion);
}
.fh-search-wrap:focus-within{
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}
.fh-search-icon{color:var(--subtle);flex:0 0 18px}
.fh-search-input{
  flex:1;min-width:0;height:40px;border:0;outline:0;
  background:transparent;color:var(--text);font-size:14px;
}
.fh-search-input::placeholder{color:var(--subtle)}
.fh-theme-toggle{
  width:36px;height:36px;flex:0 0 36px;
  display:flex;align-items:center;justify-content:center;
  border-radius:var(--radius-sm);
  border:1px solid var(--line);
  background:var(--surface-alt);
  color:var(--muted);
  cursor:pointer;
  transition:background var(--motion),color var(--motion);
}
.fh-theme-toggle:hover{background:var(--accent-soft);color:var(--accent)}

/* Filter tags */
.fh-filter-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding:12px 0 0;
}
.fh-tag{
  padding:5px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--text-soft);
  font-size:12px;
  font-weight:550;
  cursor:pointer;
  transition:all var(--motion);
  white-space:nowrap;
}
.fh-tag:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
.fh-tag.is-active{border-color:var(--accent);background:var(--accent);color:#fff}

/* Grid */
.fh-main{flex:1;padding:24px 0 40px}
.fh-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
  gap:14px;
}
.fh-section-label{
  grid-column:1/-1;
  font-size:14px;
  font-weight:700;
  color:var(--muted);
  padding:16px 0 2px 2px;
  letter-spacing:0.03em;
  border-bottom:1px solid var(--line-soft);
  margin-bottom:2px;
}
.fh-section-label:first-child{padding-top:0}

/* Card */
.fh-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px;
  border-radius:var(--radius);
  background:var(--surface);
  border:1px solid var(--line-soft);
  cursor:pointer;
  text-decoration:none;
  color:inherit;
  transition:all var(--motion);
}
.fh-card:hover{
  border-color:var(--accent);
  box-shadow:var(--shadow);
  transform:translateY(-2px);
}
.fh-card:active{transform:translateY(0)}
.fh-card-badge{
  width:38px;height:38px;flex:0 0 38px;
  display:flex;align-items:center;justify-content:center;
  border-radius:var(--radius-sm);
  background:var(--accent-soft);
  color:var(--accent);
  font-size:12px;
  font-weight:780;
  border:1px solid rgba(37,99,235,0.10);
}
html.is-dark .fh-card-badge{border-color:rgba(96,149,250,0.14)}
.fh-card-info{min-width:0;flex:1}
.fh-card-name{
  font-size:14px;
  font-weight:660;
  line-height:1.3;
  color:var(--text);
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.fh-card-desc{
  font-size:12px;
  line-height:1.5;
  color:var(--muted);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  margin-top:2px;
}
.fh-card-arrow{color:var(--subtle);flex:0 0 14px;transition:transform var(--motion),color var(--motion)}
.fh-card:hover .fh-card-arrow{color:var(--accent);transform:translateX(2px)}

/* Empty */
.fh-empty-state{
  grid-column:1/-1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:60px 20px;
  text-align:center;
  color:var(--muted);
}
.fh-empty-state strong{font-size:15px;color:var(--text-soft);margin-bottom:4px}
.fh-empty-state p{font-size:13px;max-width:320px}

/* Footer */
.fh-footer-main{
  border-top:1px solid var(--line-soft);
  background:var(--surface);
  padding:18px 0;
  margin-top:auto;
  color:var(--muted);
  font-size:12px;
}
.fh-footer-main .fh-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:6px;
}
.fh-footer-main nav{display:flex;gap:14px}
.fh-footer-main a{color:var(--muted);text-decoration:none;transition:color var(--motion)}
.fh-footer-main a:hover{color:var(--accent)}

/* Responsive */
@media(max-width:768px){
  .fh-inner{padding:0 14px}
  .fh-grid{grid-template-columns:1fr;gap:10px}
  .fh-card{padding:14px}
  .fh-card-badge{width:34px;height:34px;flex:0 0 34px;font-size:11px}
  .fh-card-name{font-size:13px}
  .fh-hero{padding:16px 0 14px}
  .fh-hero-text h1{font-size:16px}
  .fh-hero-text p{font-size:12px}
  .fh-footer-main .fh-inner{flex-direction:column;text-align:center}
}
@media(min-width:769px)and(max-width:1024px){.fh-grid{grid-template-columns:repeat(2,1fr)}}

/* Skeleton */
.fh-skeleton{
  border-radius:var(--radius);
  background:var(--line-soft);
  overflow:hidden;
  position:relative;
}
.fh-skeleton::after{
  content:'';position:absolute;inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,0.50),transparent);
  animation:fh-shimmer 1.4s ease-in-out infinite;
  transform:translateX(-100%);
}
html.is-dark .fh-skeleton::after{background:linear-gradient(90deg,transparent,rgba(255,255,255,0.06),transparent)}
@keyframes fh-shimmer{to{transform:translateX(100%)}}

::-webkit-scrollbar{width:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:rgba(107,117,137,0.18);border-radius:999px}
