:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --accent: #6366f1;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.14);
  --transition: 0.22s ease;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --container: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.bookmark-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.bookmark-nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bookmark-nav-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.site-header .bookmark-toast {
  position: absolute;
  top: calc(100% + 8px);
  right: max(16px, calc((100vw - var(--container)) / 2 + 16px));
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: min(92vw, 360px);
  padding: 12px 14px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  animation: toast-in 0.25s ease;
}

.bookmark-toast.hidden {
  display: none;
}

.bookmark-toast p {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}

.bookmark-toast-close {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
  transition: background var(--transition);
}

.bookmark-toast-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  color: var(--accent);
  flex-shrink: 0;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-text small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-btn {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.filter-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.filter-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* Hero */
.site-main {
  padding: 36px 0 64px;
}

.hero {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 40px;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Sections */
.category-section {
  margin-bottom: 44px;
}

.category-section:last-child {
  margin-bottom: 0;
}

.category-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 16px;
  padding-left: 2px;
}

.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* AI Card */
.ai-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 200px;
  overflow: hidden;
  position: relative;
}

.ai-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.ai-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.ai-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.ai-card-meta {
  flex: 1;
  min-width: 0;
}

.ai-card-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.ai-card-desc {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.ai-card-arrow {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--transition), transform var(--transition);
}

.ai-card-arrow svg {
  width: 100%;
  height: 100%;
}

.ai-card:hover .ai-card-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

.ai-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-card-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ai-card-intro {
  font-size: 13px;
  line-height: 1.65;
  flex: 1;
}

.empty-tip {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  background: var(--bg-subtle);
}

.site-footer p {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Noscript */
.noscript {
  padding: 48px 16px;
}

.noscript h1 {
  margin-bottom: 12px;
}

.noscript ul {
  margin-top: 16px;
  padding-left: 20px;
}

.noscript li {
  margin: 6px 0;
}

.noscript a {
  color: var(--accent);
}

/* Mobile */
@media (max-width: 640px) {
  .site-main {
    padding-top: 24px;
  }

  .hero {
    margin-bottom: 28px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .site-header .bookmark-toast {
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }

  .ai-grid {
    grid-template-columns: 1fr;
  }

  .filter-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .filter-nav::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
