:root {
  --bg: #f0f4f8;
  --bg2: #e8eef4;
  --card: #ffffff;
  --text: #1a2332;
  --text2: #5a6578;
  --text3: #8b95a5;
  --line: rgba(26,35,50,.08);
  --accent: #6366f1;
  --accent2: #8b5cf6;
  --green: #10b981;
  --radius: 14px;
  --max: 1080px;
  --shadow: 0 4px 24px rgba(26,35,50,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --bg2: #1a2332;
    --card: #1e293b;
    --text: #f1f5f9;
    --text2: #94a3b8;
    --text3: #64748b;
    --line: rgba(255,255,255,.08);
    --shadow: 0 4px 24px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(240,244,248,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) {
  .topbar { background: rgba(15,20,25,.92); }
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.brand-text { font-size: 17px; font-weight: 700; }
.brand-text small { display: block; font-size: 11px; font-weight: 400; color: var(--text3); }
.brand a { color: inherit; text-decoration: none; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a {
  font-size: 13px; color: var(--text2); padding: 6px 12px;
  border-radius: 8px;
}
.topnav a:hover { background: var(--bg2); color: var(--accent); text-decoration: none; }

.page { max-width: var(--max); margin: 0 auto; padding: 28px 20px 56px; }

.hero { text-align: center; margin-bottom: 28px; }
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  color: var(--accent); background: rgba(99,102,241,.1);
  padding: 5px 14px; border-radius: 980px; margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 800; letter-spacing: -.03em;
  margin-bottom: 10px; line-height: 1.25;
}
.hero-sub { font-size: 15px; color: var(--text2); max-width: 560px; margin: 0 auto 20px; line-height: 1.65; }

.search-box {
  max-width: 520px; margin: 0 auto 20px;
  display: flex; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px; box-shadow: var(--shadow);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.search-input {
  flex: 1; border: none; background: transparent;
  font: inherit; font-size: 15px; padding: 10px 14px;
  color: var(--text); outline: none;
}
.search-input::placeholder { color: var(--text3); }

.ad-slot { margin: 20px auto; text-align: center; }
.ad-banner {
  width: 66%; max-width: 100%; height: auto;
  border-radius: 10px; cursor: pointer; display: block; margin: 0 auto;
}
@media (max-width: 640px) { .ad-banner { width: 100%; } }

.quote-bar {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 640px) { .quote-bar { grid-template-columns: 1fr; } }
.quote-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow);
  min-height: 88px;
}
.quote-card--pos { border-left: 3px solid var(--green); }
.quote-card--fun { border-left: 3px solid var(--accent2); }
.quote-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; margin-bottom: 8px; }
.quote-label--pos { color: var(--green); }
.quote-label--fun { color: var(--accent2); }
.quote-text {
  font-size: 14px; color: var(--text2); line-height: 1.65;
  min-height: 2.8em;
}
.quote-typed { word-break: break-word; }
.quote-cursor {
  display: inline-block; margin-left: 1px;
  color: var(--accent); font-weight: 300;
  animation: quote-blink 1s step-end infinite;
  vertical-align: baseline;
}
.quote-card--pos .quote-cursor { color: var(--green); }
.quote-card--fun .quote-cursor { color: var(--accent2); }
.quote-card.is-typing .quote-cursor { opacity: 1; }
@keyframes quote-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cat-nav {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px; justify-content: center;
}
.cat-pill {
  appearance: none; border: 1px solid var(--line);
  background: var(--card); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 980px;
  color: var(--text2); transition: all .15s;
}
.cat-pill:hover { border-color: var(--accent); color: var(--accent); }
.cat-pill.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent; color: #fff;
}

.nav-section { margin-bottom: 28px; }
.section-head { margin-bottom: 14px; }
.section-label { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.section-title { font-size: 20px; font-weight: 700; margin-top: 4px; }
.section-desc { font-size: 13px; color: var(--text3); margin-top: 4px; }

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.site-card {
  display: block; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; color: inherit; text-decoration: none;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.site-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.35);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.site-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.site-card:hover .site-name { color: var(--accent); }
.site-desc {
  font-size: 13px; color: var(--text2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.site-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.site-tag {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; background: rgba(99,102,241,.1); color: var(--accent);
}

.empty-tip { text-align: center; padding: 40px; color: var(--text3); font-size: 14px; }

.about {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  margin-top: 8px;
}
.about h2 { font-size: 18px; margin-bottom: 10px; }
.about p { font-size: 14px; color: var(--text2); line-height: 1.7; }

.footer {
  text-align: center; font-size: 12px; color: var(--text3);
  padding: 28px 0 8px; margin-top: 24px;
}

.footer-sitemap {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px;
  margin-top: 32px; padding: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.footer-sitemap a {
  font-size: 13px; color: var(--text2); padding: 6px 10px;
  border-radius: 8px; background: var(--bg);
}
.footer-sitemap a:hover { color: var(--accent); text-decoration: none; }

.breadcrumb {
  font-size: 13px; color: var(--text3); margin-bottom: 16px;
}
.breadcrumb a { color: var(--text2); }
.breadcrumb span[aria-hidden] { margin: 0 6px; opacity: .5; }

.hero--compact { margin-bottom: 20px; }
.hero--compact h1 { font-size: clamp(22px, 4vw, 32px); }

.site-detail {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 24px; margin-bottom: 24px;
}
.site-detail-cat { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.site-detail h1 { font-size: clamp(24px, 4vw, 36px); font-weight: 800; margin-bottom: 12px; }
.site-detail-desc { font-size: 15px; color: var(--text2); line-height: 1.7; margin-bottom: 16px; }
.site-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 12px; }
.site-detail-url { font-size: 12px; color: var(--text3); word-break: break-all; }

.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; padding: 10px 18px;
  border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.btn-primary:hover { opacity: .92; text-decoration: none; color: #fff; }
.btn-secondary {
  background: var(--bg); border: 1px solid var(--line); color: var(--text2);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.related-cats, .related-sites { margin-top: 32px; }
.related-cats h2, .related-sites h2 {
  font-size: 18px; margin-bottom: 14px;
}
.cat-links {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
}
.cat-link-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); color: inherit; text-decoration: none;
}
.cat-link-card:hover { border-color: rgba(99,102,241,.35); text-decoration: none; }
.cat-link-icon { font-size: 20px; }
.cat-link-name { font-weight: 700; font-size: 14px; }
.cat-link-count { font-size: 12px; color: var(--text3); }

.section-title a { color: inherit; text-decoration: none; }
.section-title a:hover { color: var(--accent); }
.section-desc a { font-size: 13px; }

.noscript-nav section { margin-bottom: 24px; }
.noscript-nav h2 { font-size: 16px; margin-bottom: 8px; }
.noscript-nav ul { padding-left: 20px; font-size: 14px; line-height: 1.8; color: var(--text2); }

.crawl-nav {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.crawl-nav a { display: inline; }

@media (max-width: 640px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .site-grid { grid-template-columns: 1fr; }
}
